10 releases

1.0.0 Mar 13, 2023
0.4.4 Oct 28, 2024
0.4.3 Jul 29, 2024
0.4.2 Jun 26, 2024
0.1.0 Feb 8, 2023

#507 in Command line utilities

Download history 30/week @ 2024-07-22 166/week @ 2024-07-29 3/week @ 2024-08-05 9/week @ 2024-08-12 5/week @ 2024-08-19 2/week @ 2024-08-26 2/week @ 2024-09-02 13/week @ 2024-09-09 18/week @ 2024-09-16 30/week @ 2024-09-23 18/week @ 2024-09-30 15/week @ 2024-10-07 25/week @ 2024-10-14 4/week @ 2024-10-21 154/week @ 2024-10-28

200 downloads per month

AGPL-3.0-or-later

410KB
4K SLoC

License: AGPL v3 crates.io

`fjo` Updates
### 2024-04-20

`codeberg-cli` is un-deprecated since `fjo` development came to a halt before reaching feature pairity and I think we're better off including the findings here.

### End of 2023

We are thrilled to share a pivotal update on our software project. Thanks to recent developments, our project is now compatible with all Forgejo instances, not limited to Codeberg. As part of this expansion, the primary development focus will shift to our forked repository, [fjo](https://codeberg.org/VoiDD/fjo) in the future.

Rest assured, `codeberg-cli` will remain active. Our plan is to seamlessly incorporate new changes from the forked project here. We'll continue to make small adjustments to ensure smooth use, particularly for Codeberg, such as optimizing default values and Codeberg-specific features.

We appreciate your ongoing support and anticipate delivering even more enhancements soon.

codeberg-cli logo

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

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

Checking the installation

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

berg 0.4.0

Usage

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

Codeberg 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
  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:
      --non-interactive  Whether or not to disable all interactive features.
                         In this case arguments have to be provided in the console!
                         
  -h, --help             Print help
  -V, --version          Print version

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

Dependencies

~26–42MB
~743K SLoC