1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115
|
# forgejo-cli
CLI tool for interacting with Forgejo
[Matrix Chat](https://matrix.to/#/#forgejo-cli:cartoon-aa.xyz)
## Installation
### Pre-built
Pre-built binaries are available for `x86_64` Windows and Linux (GNU) on the
[releases tab](https://codeberg.org/Cyborus/forgejo-cli/releases/latest).
### From source
Install with `cargo install`
```
# Latest version
cargo install forgejo-cli
# From `main`
cargo install --git https://codeberg.org/Cyborus/forgejo-cli.git --branch main
```
### Fedora
An **unofficial** [COPR repository](https://copr.fedorainfracloud.org/coprs/lihaohong/forgejo-cli/) is available. Fedora users can install forgejo-cli with
```sh
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`.
### 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/Cyborus/forgejo-cli
```
...or include it in the flake inputs of your NixOS system:
```nix
{
inputs = {
# ...
forgejo-cli.url = "git+https://codeberg.org/Cyborus/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.
```bash
# 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 info 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 info 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 info 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](LICENSE-APACHE) or [MIT License](LICENSE-MIT)
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.
|