- Rust 99.6%
- Nix 0.4%
|
Cyborus
d8c2b12f43
Merge pull request 'feat: --identity argument' ( #255 ) from LordMZTE/forgejo-cli:ssh-id-flag into main
Reviewed-on: forgejo-contrib/forgejo-cli#255 Reviewed-by: Cyborus <cyborus@disroot.org> |
||
|---|---|---|
| .woodpecker |
style: rename deploy workflow to publish
|
|
| src | feat: --identity argument | |
| .gitignore | feat: add Nix flake | |
| build.rs | feat!: hardcode oauth client ids | |
| Cargo.lock | chore: update forgejo-api to 0.8.0 | |
| Cargo.toml | chore: update forgejo-api to 0.8.0 | |
| Dockerfile | ||
| flake.lock | chore(nix): update flake | |
| flake.nix | build: add rustfmt to Nix dev shell | |
| LICENSE-APACHE | ||
| LICENSE-MIT | ||
| README.md | Update README with binstall instructions | |
forgejo-cli
CLI tool for interacting with Forgejo
Installation
Pre-built
Pre-built binaries are available for x86_64 Windows and Linux (GNU) on the
releases tab.
From source
Install with cargo install or cargo binstall
# Latest version compiled from source
cargo install forgejo-cli
# From `main`
cargo install --git https://codeberg.org/forgejo-contrib/forgejo-cli.git --branch main
# Using precompiled releases (requires cargo-binstall)
cargo binstall forgejo-cli
Debian and Ubuntu
forgejo-cli is included in the official repositories as of Debian unstable and Ubuntu plucky.
sudo apt install forgejo-cli
Fedora
An unofficial COPR repository is available. Fedora users can install forgejo-cli with
sudo dnf copr enable lihaohong/forgejo-cli
sudo dnf install forgejo-cli
If you see an error about copr not being an available command, run sudo dnf install dnf-plugins-core.
Guix
If it's not already done, you need to update Guix (Guix is rolling release):
guix pull
One done you can then install forgejo-cli with the following command:
guix install forgejo-cli
Nix
A Nix flake is included in this repository that you may use. You could install it into your Nix profile, for example:
nix profile install git+https://codeberg.org/forgejo-contrib/forgejo-cli
...or include it in the flake inputs of your NixOS system:
{
inputs = {
# ...
forgejo-cli.url = "git+https://codeberg.org/forgejo-contrib/forgejo-cli";
};
# ...
}
OCI Container
forgejo-cli is available as an OCI container for use in CI, at
codeberg.org/cyborus/forgejo-cli:latest
Usage
Instance-specific aliases
While you can just use the fj binary directly, it can be useful to alias it
with the --host flag set, to create shorthands for certain instances.
# For example, a `cb` command for interacting with codeberg
alias cb="fj --host codeberg.org"
# Or code.forgejo.org
alias cfj="fj --host code.forgejo.org"
# Or any other instance you want!
# And the alias name can be whatever, as long as the `--host` flag is set.
Now, when you reference a repository such as forgejo/forgejo, it will
implicitly get it from whichever alias you used!
$ cb repo view forgejo/forgejo
forgejo/forgejo
> Beyond coding. We forge.
Primary language is Go
# etc...
When using fj directly, you'd have to use a URL to access it.
$ fj repo view codeberg.org/forgejo/forgejo
forgejo/forgejo
> Beyond coding. We forge.
Primary language is Go
# etc...
# Notice the "cfj", trying to access code.forgejo.org, still works when you specify Codeberg in the repository name!
$ cfj repo view codeberg.org/forgejo/forgejo
forgejo/forgejo
> Beyond coding. We forge.
Primary language is Go
# etc...
Licensing
This project is licensed under either Apache License Version 2.0 or MIT License at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.