This PR handles 3 main topics: 1. It adds configurations files (yay 😬) to `codeberg-cli` which can be used on the app level. Currently 4 levels of configuration sources are accepted: - local config in a `berg.toml` file - global config in the systems data directory under the subfolder `.berg-cli/berg.toml` - environment variables with the name of the fields in the config prefixed by `BERG`, e.g. `BERG_BASE_URL` - some sensibly picked default values 2. It adds the possibility to adjust the `base_url` effectively removing the constrain of the tool that it only works for the `codeberg.org` domain 3. Includes some local testing infra setup as well as some of the first snapshot tests ### Todo - [x] replace the `.config` extension with `.toml` since it's a TOML file tools will probably use the extension for detection - [x] add output tests for `berg config --help` ### Related to - #108 - #90 - #84 Co-authored-by: RobWalt <robwalter96@gmail.com> Co-authored-by: Aviac <aviac@mailbox.org> Reviewed-on: RobWalt/codeberg-cli#111 Reviewed-by: RobWalt <robwalt@noreply.codeberg.org> Co-authored-by: aviac <aviac@mailbox.org> Co-committed-by: aviac <aviac@mailbox.org> |
||
|---|---|---|
| .woodpecker | ||
| assets | ||
| infra | ||
| src | ||
| tests | ||
| .gitignore | ||
| Cargo.lock | ||
| Cargo.toml | ||
| CHANGELOG.md | ||
| cog.toml | ||
| CONTRIBUTING.md | ||
| flake.lock | ||
| flake.nix | ||
| LICENSE | ||
| Makefile.toml | ||
| README.md | ||
| shell.nix | ||
Project Update: Moving to forgmartelo
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, forgmartelo 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 (berg)
CLI Tool for Codeberg similar to gh and glab.
Installation
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.3.6
Usage
Run berg -h for the help menu. Each subcommand also has it's own help menu
Codeberg CLI app
Usage: berg [COMMAND]
Commands:
auth Authentication subcommands
user User subcommands
issue Issue subcommands
pull Pull request subcommands
label Label subcommands
repo Repository subcommands
milestone Milestone subcommands
completion Print completion script
help Print this message or the help of the given subcommand(s)
Options:
-h, --help Print help (see more with '--help')
-V, --version Print version
Development
Please take a look at CONTRIBUTING.md before opening PRs. We can't accept PRs which don't stick to the guidelines.