# forgejo-cli-ex
[](https://crates.io/crates/forgejo-cli-ex)
[](LICENSE)
[](https://github.com/JKamsker/forgejo-cli-ex)
[](https://codeberg.org/JKamsker/forgejo-cli-ex)
[](https://blog.kamsker.at/blog/how-fj-ex-was-built)
`fj-ex` extends the official Forgejo CLI (`fj`) with functionality that requires hitting **web UI endpoints** — full action logs, artifacts, cancel/rerun, workflow dispatch, and more.
## Install
```sh
cargo install forgejo-cli-ex
fj-ex --help
```
## Quickstart
```sh
# Login (interactive)
fj-ex auth login --host forge.example.com
# Mint a NuGet API key (requires `fj auth login` + `fj-ex auth login`)
fj-ex token mint nuget --host forge.example.com --owner my-org
# List recent runs
fj-ex actions runs --repo owner/name --latest
# Stream job logs to stdout
fj-ex actions logs job --repo owner/name --latest --job-index 0
# Cancel / rerun (preview first with --dry-run)
fj-ex actions cancel --repo owner/name --run-index 50 --dry-run
fj-ex actions rerun --repo owner/name --latest --failed-only
# Runner registration token + queued jobs (requires `fj auth login`)
fj-ex actions runners token --repo owner/name
fj-ex actions runners jobs --repo owner/name --waiting
```
> `--host` can be omitted — `fj-ex` infers it from the current repo's git remotes, or falls back to `$FJ_FALLBACK_HOST`.
## Commands
| `auth` | Login, logout, status, list saved sessions |
| `actions runs` | List workflow runs (filter by status, workflow, latest) |
| `actions jobs` | List jobs for a run, optionally `--watch` |
| `actions logs` | Download logs for a job or full run |
| `actions artifacts` | List / download artifacts |
| `actions cancel` | Cancel a running workflow |
| `actions rerun` | Rerun a workflow (optionally `--failed-only`) |
| `actions trigger` | Dispatch a `workflow_dispatch` event |
| `actions runners` | Runner tokens + queued jobs (REST API; uses `fj` token store) |
| `smoke-test` | Non-destructive end-to-end validation |
Full command reference with all flags: [docs/commands.md](docs/commands.md)
## Target resolution
Most commands accept `--host`/`-H`, `--repo`/`-r`, or `--remote`/`-R`. If omitted, `fj-ex` infers host and repo from the current directory's git remotes.
## Credentials
Credentials and cookies are stored in plaintext at:
```text
%APPDATA%\Cyborus\forgejo-cli\data\ui-creds.json # Windows
~/.local/share/Cyborus/forgejo-cli/data/ui-creds.json # Linux
```
`fj-ex actions runners` uses the API token stored by the official `fj` CLI at:
```text
%APPDATA%\Cyborus\forgejo-cli\data\keys.json # Windows
~/.local/share/Cyborus/forgejo-cli/data/keys.json # Linux
```
`fj-ex token mint nuget` needs both:
```text
fj-ex auth login # stored username/password for basic auth
fj auth login # stored API token for Authorization: token ...
```
This is required for automatic re-login. Downloaded logs and artifacts may contain secrets — handle accordingly.
## License
LGPL-3.0-or-later