A Forgejo CLI — works with Codeberg and any Forgejo instance
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 — likegh. - ~5ms startup vs ~250ms for the Python original (Rust binary vs Python interpreter)
--jsonon all commands for machine-readable output--repo owner/repoflag on issue/PR commands (likegh) — 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