No description
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
techwritescode b670adc066
All checks were successful
Go build / build (fj, darwin) (push) Successful in 40s
Go build / build (fj, linux) (push) Successful in 41s
Go build / build (fj.exe, windows) (push) Successful in 41s
Release binaries / upload (fj-darwin-amd64, darwin) (release) Successful in 37s
Release binaries / upload (fj-linux-amd64, linux) (release) Successful in 32s
Release binaries / upload (fj-windows-amd64.exe, windows) (release) Successful in 33s
feat: add actions command, plus a local repo sync workaround
`fj actions` covers Forgejo's repo-scoped Actions API: run
list/view/jobs/logs/cancel/delete/browse, artifact list/download/delete,
and dispatch. Scoped fresh against the live swagger spec (the old Rust
CLI never had this). Notable, confirmed live:
- a run's index_in_repo ("#14" in the web UI) is a different number
  from its id (what run_id/job_id/artifact_id path params actually
  want) -- every listing now prints both, id leading
- tailing a running job's log is a plain HTTP Range request (no
  websocket/SSE endpoint); `run logs --follow` polls with an
  increasing offset and treats 416 as "nothing new yet"
- dispatch always requests return_run_info so the created run's id
  comes back immediately instead of a bare 204

Also adds `fj repo sync [REMOTE]`, a plain `git pull` retried once
unconditionally on failure, working around a git.techwritescode.dev
quirk where re-authenticating over git's HTTPS transport fails the
first request and only succeeds on an immediate retry. This is
deliberately not `gh repo sync`'s fork-vs-parent semantics (Forgejo has
a real API for that, sync_fork, left for a future command) -- this one
is purely local-git, since the reauth bug it targets is specific to
git's own HTTPS auth exchange, not the token-authed Forgejo API fj
otherwise talks to.

CLAUDE.md gains roadmap write-ups for `release` (previously undocumented
despite already being implemented) and `actions`.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
2026-09-08 17:40:03 -05:00
.forgejo ci: attach cross-compiled binaries to published releases 2026-09-02 12:07:16 -05:00
cmd/fj chore: rename module path to techwritescode/forgejo-cli 2026-08-01 17:12:00 -05:00
internal feat: add actions command, plus a local repo sync workaround 2026-09-08 17:40:03 -05:00
.gitignore chore: remove Rust implementation, consolidate to MIT license 2026-08-01 15:10:31 -05:00
CLAUDE.md feat: add actions command, plus a local repo sync workaround 2026-09-08 17:40:03 -05:00
go.mod chore: rename module path to techwritescode/forgejo-cli 2026-08-01 17:12:00 -05:00
go.sum feat: add Go rewrite (milestone 1: auth, config, whoami) 2026-08-01 15:10:03 -05:00
LICENSE chore: remove Rust implementation, consolidate to MIT license 2026-08-01 15:10:31 -05:00
README.md feat: add OAuth login 2026-08-01 15:26:44 -05:00

fj, a CLI client for Forgejo

... akin to gh, glab, or tea!

fj doesn't try to replace your usage of git, it's meant to work alongside it. It handles all the Forgejo-specific things that git doesn't.

This is a personal fork, being rewritten from Rust to Go. Development is happening incrementally; commands are added as they're rebuilt.

Currently supported

  • fj auth {login,add-token,logout,list} — OAuth or token-based login
  • fj config {set-base-host,show} — manage the default host
  • fj whoami — show the authenticated user
  • fj version

Repo, issue, and pull request commands (repo, issue, pr) are being ported next.

Installation

Requires a Go toolchain. From the repo root:

go install ./cmd/fj

Configuration

fj resolves which host to talk to in this order: an explicit --host flag, the current git repo's remote, then a persisted default host. Set the default with:

fj config set-base-host git.techwritescode.dev

Log in with a personal access token:

fj auth add-token

Or via OAuth in your browser, if the host has a registered OAuth application fj knows about:

fj auth login

For a self-hosted instance without a built-in client ID (like git.techwritescode.dev), register an application under Settings → Applications with redirect URI http://127.0.0.1:26218/, then either add a <config dir>/forgejo-cli/client_ids file (host client_id per line, # for comments) or pass it directly:

fj auth login --client-id <id>

Licensing

This project is licensed under the MIT License.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you shall be licensed as above, without any additional terms or conditions.