Skip to main content

A Codeberg CLI

Project description

cb — A Codeberg CLI

CI PyPI - Python Version PyPI PyPI - License

cb is a native CLI for Codeberg (a Forgejo instance) — think gh for Codeberg. Built with Xclif.

# One-time setup
cb auth login

# Work with repos, issues, PRs, releases
cb repo list
cb issue create --title "Fix the thing"
cb pr create --base main --head fix
cb release create v0.2.0

Install

pip install codeberg-cli  # or: uv tool install codeberg-cli

Or from source:

git clone https://codeberg.org/ThatXliner/codeberg-cli
cd cb
uv tool install .

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

# Clone one
cb repo clone ThatXliner/cb

# Open an issue
cb issue create --title "suggestion" --body "what about..."

Commands

cb auth — authentication

Command Description
login Store a Codeberg access token
logout Remove stored credentials
status Show login state
whoami Print current username

cb repo — repositories

Infer owner/repo from git remote origin. Override with --repo.

Command Description
create Create a repo (--org, --private, --description)
list List repos for a user or org
clone Clone via git clone
view Show repo details (--web to open browser)
fork Fork a repo
delete Delete a repo (requires confirmation)

cb label — labels

Command Description
list (alias: ls) List repo labels
create Create a label (--color, --description)
delete Delete a label by ID

cb milestone — milestones

Command Description
list (alias: ls) List milestones (--state)
create Create a milestone (--description, --due-on)

cb issue — issues

Command Description
create Create an issue (--labels, omit --body to open stdin)
list List issues (--state, --label, --limit)
view View an issue with comments (--web)
close Close an issue
reopen Reopen a closed issue

cb pr — pull requests

Command Description
create Open a PR (omit --body to open $EDITOR)
list List PRs (alias: ls)
view View a PR (--web)
merge Merge with `--style merge
checkout Fetch and checkout a PR locally (alias: co)
close Close without merging

cb release — releases

Command Description
create Tag a release (--prerelease, --draft)
list List releases
view View a release (--web)
upload Attach a file to a release

cb api — raw API access

cb api GET /version
cb api POST /repos/owner/repo/issues --data '{"title": "hi"}'

Config

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

Comparison

There are two other CLI tools you can use with Codeberg:

cb fj (forgejo-cli) berg (codeberg-cli)
Language Python Rust Rust
Codeberg-native Yes (targets codeberg.org/api/v1) Generic (any Forgejo instance) Yes
Issues create, list, view, close, reopen open, edit, comment, close yes
Pull requests create, list, view, merge, checkout, close create, merge yes
Releases create, list, view, upload publish
Repos create, list, clone, view, fork, delete create, edit, star, watch yes
Labels create, list, delete yes
Milestones create, list yes
Raw API cb api GET /path
AGit PRs (no-fork) yes
Org/team mgmt yes
Install pip install codeberg-cli prebuilt binaries cargo install codeberg-cli
Size ~300 lines Rust binary Rust binary

Choose fj if you self-host Forgejo or need org/team management. Choose berg if you want labels and milestones from a Rust binary. Choose cb if you want a minimal, readable Python CLI with release management and raw API access — cb is also the only one that uploads release assets.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

codeberg_cli-0.1.0.tar.gz (20.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

codeberg_cli-0.1.0-py3-none-any.whl (30.5 kB view details)

Uploaded Python 3

File details

Details for the file codeberg_cli-0.1.0.tar.gz.

File metadata

  • Download URL: codeberg_cli-0.1.0.tar.gz
  • Upload date:
  • Size: 20.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for codeberg_cli-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e60f3f8c8777b5618128f7f1b544489cc8efb9d4d2fd9a8db249e7977c70ab56
MD5 8e8f4f0ec0272d6d55f7eec7d5278c38
BLAKE2b-256 6b653ac2d7884a824eb85351f84aa0561d9b71d4d73ff5eb85ba99a63a79f037

See more details on using hashes here.

File details

Details for the file codeberg_cli-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: codeberg_cli-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 30.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for codeberg_cli-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a3f5af52593a9b3a51d36f2a6f479eeece33c753190fc056d44f28f5a1b23cdd
MD5 0773ae102941dd24d718fd8525e42977
BLAKE2b-256 8e9e84eac46769b55c3a80f48a832b26abaa5d4e8cc5e81c61335753e38f6fb3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page