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

Feature request: Add commands for branch management and comment retrieval #253

Open
opened 2025年10月11日 13:41:02 +02:00 by timstoop · 0 comments
Contributor
Copy link

Summary

Currently codeberg-cli lacks dedicated commands for branch management and retrieving comments separately from issue/PR details. This makes it difficult to build tools that need to work with branches or fetch comments efficiently.

Missing Features

1. Branch Management

  • List branches: berg repo branches --repo owner/repo

    • API: GET /repos/{owner}/{repo}/branches
    • Output: List of branches with commit info
  • Delete branch: berg repo branch delete BRANCH_NAME --repo owner/repo

    • API: DELETE /repos/{owner}/{repo}/branches/{branch}
    • Safety: Require confirmation or --force flag

2. Comment Retrieval

  • List issue comments: berg issue comments ID --repo owner/repo

    • API: GET /repos/{owner}/{repo}/issues/{issue}/comments
    • Current workaround: berg issue view ID --comments but includes full issue details
  • List PR comments: berg pull comments ID --repo owner/repo

    • API: GET /repos/{owner}/{repo}/issues/{pr}/comments
    • Current workaround: berg pull view ID --comments but includes full PR details
  • List PR review comments: berg pull review-comments ID --repo owner/repo

    • API: GET /repos/{owner}/{repo}/pulls/{pr}/comments
    • These are code-level review comments (different from discussion comments)
    • No current workaround available

Use Case

Building MCP (Model Context Protocol) server for Codeberg that needs efficient access to:

  • Branch lists for showing available branches before creating PRs
  • Branch deletion for cleanup after merge
  • Comment retrieval without fetching full issue/PR data
  • Review comments for code review analysis

Alternatives Considered

  • Using berg api - but it's limited to version endpoint
  • Direct API calls via HTTP client - defeats purpose of using CLI wrapper
  • Parsing --comments output - inefficient when only comments are needed

Would appreciate these additions to make codeberg-cli more complete for automation and tooling!

## Summary Currently `codeberg-cli` lacks dedicated commands for branch management and retrieving comments separately from issue/PR details. This makes it difficult to build tools that need to work with branches or fetch comments efficiently. ## Missing Features ### 1. Branch Management - **List branches**: `berg repo branches --repo owner/repo` - API: `GET /repos/{owner}/{repo}/branches` - Output: List of branches with commit info - **Delete branch**: `berg repo branch delete BRANCH_NAME --repo owner/repo` - API: `DELETE /repos/{owner}/{repo}/branches/{branch}` - Safety: Require confirmation or `--force` flag ### 2. Comment Retrieval - **List issue comments**: `berg issue comments ID --repo owner/repo` - API: `GET /repos/{owner}/{repo}/issues/{issue}/comments` - Current workaround: `berg issue view ID --comments` but includes full issue details - **List PR comments**: `berg pull comments ID --repo owner/repo` - API: `GET /repos/{owner}/{repo}/issues/{pr}/comments` - Current workaround: `berg pull view ID --comments` but includes full PR details - **List PR review comments**: `berg pull review-comments ID --repo owner/repo` - API: `GET /repos/{owner}/{repo}/pulls/{pr}/comments` - These are code-level review comments (different from discussion comments) - No current workaround available ## Use Case Building MCP (Model Context Protocol) server for Codeberg that needs efficient access to: - Branch lists for showing available branches before creating PRs - Branch deletion for cleanup after merge - Comment retrieval without fetching full issue/PR data - Review comments for code review analysis ## Alternatives Considered - Using `berg api` - but it's limited to version endpoint - Direct API calls via HTTP client - defeats purpose of using CLI wrapper - Parsing `--comments` output - inefficient when only comments are needed Would appreciate these additions to make `codeberg-cli` more complete for automation and tooling!
Sign in to join this conversation.
No Branch/Tag specified
main
v0.5.1
v0.5.0
v0.4.11
v0.4.10
v0.4.9
v0.4.8
v0.4.7
v0.4.6
v0.4.5
v0.4.4
v0.4.3
v0.4.1
v0.4.2
v0.4.0
v0.3.5
v0.3.4
v0.3.2
v0.3.1
v0.3.0
v0.2.1
v0.2.0
v0.1.1
v0.1.0
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
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#253
Reference in a new issue
Aviac/codeberg-cli
No description provided.
Delete branch "%!s()"

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?