1
1
Fork
You've already forked cb
0
A Forgejo CLI — works with Codeberg and any Forgejo instance
  • Rust 100%
kelsey df423507ef fix: correct API field names and add raw response support
- Add get_raw() method to Client for non-JSON endpoints (e.g. .diff)
- Fix pr diff to use get_raw() instead of JSON parsing
- Fix release list/view to read "name" field instead of "title"
- Fix resolve_repo to handle bare repo names via auth user lookup
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026年05月19日 15:37:44 -07:00
src fix: correct API field names and add raw response support 2026年05月19日 15:37:44 -07:00
.gitignore rewrite: complete Rust CLI rewrite — fast, non-interactive, agent-friendly 2026年05月19日 14:54:18 -07:00
Cargo.lock rewrite: complete Rust CLI rewrite — fast, non-interactive, agent-friendly 2026年05月19日 14:54:18 -07:00
Cargo.toml rewrite: complete Rust CLI rewrite — fast, non-interactive, agent-friendly 2026年05月19日 14:54:18 -07:00
LICENSE initial: fork of ThatXliner/codeberg-cli@fddb139 2026年05月19日 14:45:24 -07:00
README.md rewrite: complete Rust CLI rewrite — fast, non-interactive, agent-friendly 2026年05月19日 14:54:18 -07:00
test-pr-file test: pr test commit from cb CLI test 2026年05月19日 15:10:46 -07:00

cb — A Forgejo CLI

cb is a CLI for Codeberg (a Forgejo instance) — think gh for Codeberg. It also works with any Forgejo instance.

Written in Rust. Designed for agents and humans alike.

# One-time setup
cb auth login
# Work with repos, issues, PRs, releases — all fully non-interactive
cb repo create --name my-project --private
cb issue create --repo owner/repo --title "Fix the thing"
cb pr create --repo owner/repo --title "Add feature" --base main --head feature
cb release create --repo owner/repo --tag v0.1.0

Install

cargo install --git https://codeberg.org/kernelzeroday/cb.git

Or from source:

git clone https://codeberg.org/kernelzeroday/cb.git
cd cb
cargo install --path .

Quickstart

# Authenticate (tokens at https://codeberg.org/user/settings/applications)
cb auth login
# Who am I?
cb auth whoami
# List your repos
cb repo list
# Create a repo (fully non-interactive — all flags)
cb repo create --name my-repo --private --description "My cool project"
# View repo details
cb repo view owner/repo
# List issues
cb issue list --repo owner/repo
# Open an issue
cb issue create --repo owner/repo --title "suggestion" --body "what about..."
# See everything you can do
cb --help

Key Differences from the Original Python cb

This is a complete Rust rewrite of ThatXliner/codeberg-cli. Key improvements:

  • Fully non-interactive — all commands accept flags only. No prompts. The original Python version prompted for name, visibility, and remote setup during repo create. This version takes --name, --private, etc. directly — like gh.
  • ~5ms startup vs ~250ms for the Python original (Rust binary vs Python interpreter)
  • --json on all commands for machine-readable output
  • --repo owner/repo flag on issue/PR commands (like gh) — infer from git remote or specify explicitly
  • Self-contained binary — no Python interpreter, no pip/uv required

Config

Token stored in $XDG_CONFIG_HOME/cb/config.toml (managed by cb auth login / cb auth logout).

The Rust version automatically detects and migrates tokens from the old Python codeberg-cli config location.

Comparison

cb is the most feature-complete Forgejo CLI. See the original Python project's feature matrix for details — the Rust version covers the same surface area.

Commands

Command Status
cb auth login/logout/status/whoami
cb repo create/list/view/delete/fork/star/unstar/clone
cb issue create/list/view/close/reopen/edit/delete/comment
cb pr create/list/view/merge/close/reopen/checkout/commits/diff
cb release create/list/view/delete
cb label create/list/delete
cb milestone create/list/delete
cb org list/view/members
cb notifications
cb user
cb api (raw API access)
cb config path/get/set

License

MIT