10
309
Fork
You've already forked codeberg-cli
33
CLI Tool for forgejo similar to gh, glab and tea
Rust 74.2%
Nix 25.8%
Filip Czaplicki e42744cd7e feat: add colors to --help/-h ( #262 )
User can disable colors via `NO_COLOR=1` environment variable if needed
Co-authored-by: Filip Czaplicki <github@starsep.com>
Reviewed-on: #262
Reviewed-by: Aviac <aviac@noreply.codeberg.org>
Co-authored-by: Filip Czaplicki <starsep@noreply.codeberg.org>
Co-committed-by: Filip Czaplicki <starsep@noreply.codeberg.org>
2026年01月11日 13:22:51 +01:00
assets chore(README): fix broken gifs #4 2023年03月13日 06:28:15 +01:00
nix maintenance work ( #269 ) 2026年01月11日 13:19:04 +01:00
src feat: add colors to --help/-h ( #262 ) 2026年01月11日 13:22:51 +01:00
.gitignore refactor: move .envrc to example and ignore user-specific configs ( #240 ) 2025年09月27日 10:23:20 +02:00
Cargo.lock maintenance work ( #269 ) 2026年01月11日 13:19:04 +01:00
Cargo.toml maintenance work ( #269 ) 2026年01月11日 13:19:04 +01:00
CHANGELOG.md chore: update changelog for minor release 2025年09月15日 21:19:18 +02:00
CONTRIBUTING.md docs: Establish conventional commit format ( #67 ) 2023年02月25日 18:25:03 +00:00
flake.lock maintenance work ( #269 ) 2026年01月11日 13:19:04 +01:00
flake.nix build: add more checks from crane 2025年09月27日 10:50:15 +02:00
LICENSE chore: update repo infos everywhere ( #139 ) 2024年11月11日 18:15:55 +01:00
README.md chore: improve README ( #237 ) 2025年09月16日 22:01:54 +02:00
rust-toolchain.toml chore: maintenance ( #229 ) 2025年09月10日 20:11:05 +02:00

License: AGPL v3 crates.io Please don't upload to GitHub

codeberg-cli logo

Support

If you want to support me take a look at my liberapay

codeberg-cli (berg)

CLI Tool for Codeberg similar to gh and glab.

Shell running the issue view command Shell running the issue view command

Installation

Prerequisites

For API communication reasons, the package depends on openssl package. Please make sure to install this with your systems respective package manager before continuing.

Cargo

The easiest way to install the berg command is using cargo. (If you haven't installed rust/cargo yet, take a look here)

Build from source

Clone the repo and install berg with

cargo install --path .

Via crates.io

Anywhere, just run

cargo install codeberg-cli

Fedora Linux

An unofficial COPR repository is available. Fedora users can install codeberg-cli with

sudo dnf copr enable lihaohong/codeberg-cli
sudo dnf install codeberg-cli

If you see an error about copr not being an available command, run sudo dnf install dnf-plugins-core.

Void Linux

Run the following:

sudo xbps-install codeberg-cli

Nix/NixOS

Run the following:

nix-shell -p codeberg-cli

or

nix develop nixpkgs#codeberg-cli

macOS (Homebrew)

Run the following:

brew install codeberg-cli

Checking the installation

After that, the berg command should be available for you. Check it with berg -V

berg 0.5.0

Usage

Run berg -h for the help menu. Each subcommand also has it's own help menu

Codeberg/Forgejo CLI app
Usage: berg [OPTIONS] <COMMAND>
Commands:
 api API subcommands
 auth Authentication subcommands
 config Config subcommands
 user User subcommands
 issue Issue subcommands
 pull Pull request subcommands
 label Label subcommands
 release Release subcommands
 repo Repository subcommands
 milestone Milestone subcommands
 notification Notification subcommands
 completion Print completion script
 help Print this message or the help of the given subcommand(s)
Options:
 <omitted>

Non-Codeberg Forgejo

If you want to use this tool with instances of forgejo other than codeberg.org this is possible through extra configuration either through files or through environment variables:

  • file approach: You can generate the default configuration via berg config generate. Please take a look at the command line options via the --help flag. Please also note that you can check the current configuration values and where they are sourced from via berg config info.
  • environment variable approach: All of the options from the file approach are also available via environment variables. For now the best way to get the available options is to take a look at the output from berg config info. The environment variable names are the option names prefixed by BERG_. Example: base_url in config files is equivalent to BERG_BASE_URL in environment variables

Please note that the environment variables take precedence over the config file options. Also: There exist several visibility ranges for config files (local vs. global) and berg tries to resolve this recursively starting from the most local path walking upwards. Local configurations take precedence over global ones.

Example log into locally hosted instance of forgejo

BERG_BASE_URL=localhost:8000 berg auth login

Development

Please take a look at CONTRIBUTING.md before opening PRs. We can't accept PRs which don't stick to the guidelines.

Similar Projects

The development of codeberg-cli has gone to sleep several times due to me being busy. I just want to encourage you checking out similar other projects which are trying to achieve some similar goals:

  • fjo - A collective approach of re-writing codeberg-cli
  • forgejo-cli - A CLI application for interacting with forgejo in general