CLI Tool for Codeberg similar to gh and glab
Find a file
aviac 9a203bff2b feat: add-config-to-support-different-base-url (#111)
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>
2023-10-27 21:59:22 +00:00
.woodpecker fix: failing ci because of woodpecker update (#102) 2023-09-19 19:23:06 +00:00
assets chore(README): fix broken gifs #4 2023-03-13 06:28:15 +01:00
infra feat: add-config-to-support-different-base-url (#111) 2023-10-27 21:59:22 +00:00
src feat: add-config-to-support-different-base-url (#111) 2023-10-27 21:59:22 +00:00
tests feat: add-config-to-support-different-base-url (#111) 2023-10-27 21:59:22 +00:00
.gitignore feat: add-config-to-support-different-base-url (#111) 2023-10-27 21:59:22 +00:00
Cargo.lock feat: add-config-to-support-different-base-url (#111) 2023-10-27 21:59:22 +00:00
Cargo.toml feat: add-config-to-support-different-base-url (#111) 2023-10-27 21:59:22 +00:00
CHANGELOG.md Build: Increase cocogitto utilization for release purposes (#87) 2023-05-22 19:11:52 +00:00
cog.toml Build: Increase cocogitto utilization for release purposes (#87) 2023-05-22 19:11:52 +00:00
CONTRIBUTING.md docs: Establish conventional commit format (#67) 2023-02-25 18:25:03 +00:00
flake.lock feat: add nix flake for development (#95) 2023-09-16 12:30:58 +00:00
flake.nix feat: add-config-to-support-different-base-url (#111) 2023-10-27 21:59:22 +00:00
LICENSE chore(license): update license 2023-02-24 22:15:48 +01:00
Makefile.toml refactor(crate-layout): Refactor to non-workspace architecture (#72) 2023-03-13 05:13:03 +00:00
README.md chore: add update about fork to readme (#113) 2023-10-27 21:44:22 +00:00
shell.nix feat(scaffolding): starting new with clap instead of structopt 2023-02-24 22:15:48 +01:00

License: AGPL v3 crates.io

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 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

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.