10
310
Fork
You've already forked codeberg-cli
33

feat: add --repo flag to issue and pull list commands #242

Merged
Aviac merged 3 commits from timstoop/codeberg-cli:feature/repo-flag-issues-pulls into main 2025年10月06日 15:44:03 +02:00
Contributor
Copy link

Add optional --repo flag to berg issue list and berg pull list
commands to allow querying repositories without being in a git
directory. The flag accepts OWNER/REPO format.

  • Add --repo flag to issue list (-r short option)
  • Add --repo flag to pull list (-R short option)
  • Make parse_owner_and_repo() pub(crate) for reuse
  • Improve error message consistency
  • Change ListPullRequestArgs from Copy to Clone for String field

🤖 Generated with Claude Code

Co-Authored-By: Claude noreply@anthropic.com

Add optional --repo flag to `berg issue list` and `berg pull list` commands to allow querying repositories without being in a git directory. The flag accepts OWNER/REPO format. - Add --repo flag to issue list (-r short option) - Add --repo flag to pull list (-R short option) - Make parse_owner_and_repo() pub(crate) for reuse - Improve error message consistency - Change ListPullRequestArgs from Copy to Clone for String field 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Add optional --repo flag to `berg issue list` and `berg pull list`
commands to allow querying repositories without being in a git
directory. The flag accepts OWNER/REPO format.
- Add --repo flag to issue list (-r short option)
- Add --repo flag to pull list (-R short option)
- Make parse_owner_and_repo() pub(crate) for reuse
- Improve error message consistency
- Change ListPullRequestArgs from Copy to Clone for String field
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Author
Contributor
Copy link

I personally would like this feature to help with implementing an MCP correctly, but there are other reasons you may want this as well:

  • API/Automation use cases: Enables scripts and CI/CD pipelines to query issues/PRs from multiple repositories without needing to clone them or be in a git directory. Critical for automation tools.
  • Consistency with existing commands: Commands like repo info, repo clone, repo delete, and repo fork already accept OWNER/REPO arguments. This makes issue list and pull list consistent with the rest of the CLI.
  • Multi-repo workflows: Users managing multiple repositories can now query issues/PRs without constantly switching directories - useful for project maintainers, triage, or cross-repo searches.
  • Parity with gh and glab: GitHub CLI (gh) and GitLab CLI (glab) both support specifying repos via flags. Since berg positions itself as "similar to gh and glab", this brings feature parity.
  • Low risk, high value: Small change with no breaking behavior (flag is optional), reuses existing code patterns, well-tested approach already proven in repo commands.
I personally would like this feature to help with implementing an MCP correctly, but there are other reasons you may want this as well: * API/Automation use cases: Enables scripts and CI/CD pipelines to query issues/PRs from multiple repositories without needing to clone them or be in a git directory. Critical for automation tools. * Consistency with existing commands: Commands like repo info, repo clone, repo delete, and repo fork already accept OWNER/REPO arguments. This makes issue list and pull list consistent with the rest of the CLI. * Multi-repo workflows: Users managing multiple repositories can now query issues/PRs without constantly switching directories - useful for project maintainers, triage, or cross-repo searches. * Parity with gh and glab: GitHub CLI (gh) and GitLab CLI (glab) both support specifying repos via flags. Since berg positions itself as "similar to gh and glab", this brings feature parity. * Low risk, high value: Small change with no breaking behavior (flag is optional), reuses existing code patterns, well-tested approach already proven in repo commands.
Aviac requested changes 2025年10月06日 09:01:06 +02:00
Dismissed
Aviac left a comment
Owner
Copy link

Thanks for the contribution to both of you two! Just a tiny nit and we should be fine to merge this!

Thanks for the contribution to both of you two! Just a tiny nit and we should be fine to merge this!
@ -41,3 +41,3 @@
/// parses a string of format OWNER/REPO
fn parse_owner_and_repo(owner_and_repo: &str)-> anyhow::Result<(String,String)>{
pub(crate)fn parse_owner_and_repo(owner_and_repo: &str)-> anyhow::Result<(String,String)>{
Owner
Copy link

If you want to reuse this, please put it in a module own directory level above. So something like src/actions/parsing.rs. Otherwise this just entangles the submodules needlessly.

If you want to reuse this, please put it in a module own directory level above. So something like `src/actions/parsing.rs`. Otherwise this just entangles the submodules needlessly.
Author
Contributor
Copy link

Done in the latest commit.

Done in the latest commit.
Move parse_owner_and_repo function from src/actions/repo/mod.rs to
src/actions/parsing.rs to avoid entangling submodules, as suggested
in upstream review feedback.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Resolve merge conflicts after upstream renamed GeneralArgs to GlobalArgs
and integrate parsing module changes.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Sign in to join this conversation.
No reviewers
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Aviac/codeberg-cli!242
Reference in a new issue
Aviac/codeberg-cli
No description provided.
Delete branch "timstoop/codeberg-cli:feature/repo-flag-issues-pulls"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?