Metadata-Version: 2.4
Name: codeberg-cli
Version: 0.2.0
Summary: A Forgejo CLI — works with Codeberg and any Forgejo instance
Project-URL: Homepage, https://codeberg.org/ThatXliner/codeberg-cli
Project-URL: Repository, https://codeberg.org/ThatXliner/codeberg-cli
Project-URL: Issues, https://codeberg.org/ThatXliner/codeberg-cli/issues
Author-email: Bryan Hu <thatxliner@gmail.com>
License-Expression: MIT
License-File: LICENSE
Keywords: cli,codeberg,forgejo
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Version Control :: Git
Requires-Python: >=3.12
Requires-Dist: httpx
Requires-Dist: platformdirs
Requires-Dist: tomlkit
Requires-Dist: xclif>=0.4.3
Description-Content-Type: text/markdown

# cb — A Codeberg CLI

[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/codeberg-cli)](https://pypi.org/project/codeberg-cli)
[![PyPI](https://img.shields.io/pypi/v/codeberg-cli)](https://pypi.org/project/codeberg-cli)
[![PyPI - License](https://img.shields.io/pypi/l/codeberg-cli)](#license)

`cb` is a CLI for [Codeberg](https://codeberg.org) (a [Forgejo](https://forgejo.org) instance) — think `gh` for Codeberg. It also works with any Forgejo instance. Built with [Xclif](https://xclif.readthedocs.io).

```text
# 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

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

Or from source:

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

## Quickstart

```bash
# 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..."

# See everything you can do
cb --help
```

## Config

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

View or change config:

```bash
cb config path  # Show config file location
cb config get   # Print all config values
cb config set base_url "https://codeberg.org/api/v1"     # Codeberg (default)
cb config set base_url "https://git.example.com/api/v1"  # Self-hosted Forgejo
```

## Comparison

| | **cb** | **fj** (forgejo-cli) | **berg** (codeberg-cli) |
|---|---|---|---|
| Language | Python | Rust | Rust |
| Multi-instance | Yes (configurable via `cb config set base_url`) | Any Forgejo instance | Yes |
| Issues | create, list, view, close, reopen, comment, edit | open, edit, comment, close | yes |
| Pull requests | create, list, view, merge, checkout, close, comment, edit | create, merge | yes |
| Releases | create, list, view, upload | publish | — |
| Repos | create, list, clone, view, fork, delete, star, unstar | create, edit, star, watch | yes |
| Labels | create, list, delete | — | yes |
| Milestones | create, list | — | yes |
| Notifications | list | — | yes |
| User profiles | view | search, keys | — |
| Raw API | `cb api GET /path` | — | — |
| Config management | `cb config get/set/path` | — | `berg config` |
| AGit PRs (no-fork) | — | yes | — |
| Org/team mgmt | — | yes | — |
| Install | `pip install codeberg-cli` | prebuilt binaries | `cargo install codeberg-cli` |

**Choose `fj`** if you self-host Forgejo or need org/team management or Actions workflows. **Choose `berg`** if you want your tools to be written in Rust. **Choose `cb`** if you want a minimal, readable Python CLI — it's the only one that uploads release assets, the only one with a raw API command, and the most fully-featured for everyday issue/PR/repo workflows. We will be actively working on making ours the most feature complete, just open an issue!

## License

MIT
