- Rust 80.8%
- Fluent 16.7%
- Just 1.2%
- Dockerfile 0.7%
- Nushell 0.4%
- Other 0.2%
|
|
||
|---|---|---|
| .forgejo/workflows | ||
| .idea | ||
| crates | ||
| oci-build | ||
| .dockerignore | ||
| .gitignore | ||
| Cargo.lock | ||
| Cargo.toml | ||
| CLAUDE.md | ||
| flake.lock | ||
| flake.nix | ||
| justfile | ||
| LICENSE-APACHE | ||
| LICENSE-MIT | ||
| README.md | ||
fj, a CLI client for Forgejo
Note
This is a hard fork of forgejo-cli, created and maintained by the Forgejo CLI contributors. All credit for the original tool belongs to them, and this fork inherits their dual Apache-2.0 / MIT licensing (see Licensing below).
The fork exists for one reason: this copy is developed using AI-assisted code, which the Forgejo governance does not accept (per the Forgejo AI Agreement). To respect that policy, AI-assisted work happens here rather than being submitted upstream. The fork is operated in the spirit of the Forgejo Code of Conduct, and changes are not contributed back unless they can be reauthored to comply with the upstream AI Agreement.
If you want the canonical, AI-free tool, use the upstream project at https://codeberg.org/forgejo-contrib/forgejo-cli.
fj is a CLI client for Forgejo, akin to gh, glab, or tea!
You can...
- Open, edit, comment on, close issues
- Create and merge pull requests
- Easily create AGit pull requests, no need to fork!
- Create, star, watch, and edit repositories
- Manage organizations and teams
- Publish new releases
all from the command line! Check out the wiki for more details and explanations.
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.
Installation
Pre-built binaries are available for x86_64 Windows and x86_64 Linux (GNU) on the
releases tab.
See the (forgejo-cli) wiki page on installation for more options.
Architecture
fj is a Cargo workspace (Cargo.toml) with three members. The split exists so the API and domain logic stay reusable
by a future Forgejo MCP server without dragging in the terminal CLI.
crates/fj-client(library): the connection and credential layer.keys.jsonstorage (KeyInfo/LoginInfo),forgejo_api::Forgejoclient construction, OAuth client-id lookup, and host / SSH / URL resolution.crates/fj-core(library): CLI-agnostic domain logic. Per-command operation modules that wrapforgejo-apicalls and return its structs (issues,prs,repo,org,release,user,actions,tag,wiki), the issue-template parser, and shared types such asRepoName.crates/fj(binary): everything CLI-specific. Theclapcommand tree,crosstermterminal handling,fluentlocalization, interactive prompts, and all table / markdown output rendering.
Reuse contract
fj-client and fj-core are CLI-free and intended for reuse: the planned Forgejo MCP server depends on them. To keep
them reusable, neither library may depend on clap, crossterm, or any fluent-* crate - the command tree,
terminal handling, localization, and all rendering stay in the fj binary. Verify with:
cargo tree -p fj-client -p fj-core -e normal | grep -E 'clap|crossterm|fluent'
which must return nothing.
comrak (CommonMark) is the one intentional exception, and it is deliberately not part of that grep. It is allowed
in fj-core because it powers the issue-template parser (crates/fj-core/src/template/yaml.rs), which reads and
rewrites a markdown AST via comrak::parse_document and comrak::format_commonmark. That is parsing, which an MCP
consumer needs, not rendering. Terminal / ANSI markdown rendering (the markdown() printer in crates/fj/src/main.rs)
lives only in the fj binary.
Using the crates from another project
Pull the libraries in as a git dependency, pinned to a release tag:
[dependencies]
fj-core = { git = "https://dev.a8n.run/pandoras-box/forgejo-cli.git", tag = "v0.6.0" }
fj-client = { git = "https://dev.a8n.run/pandoras-box/forgejo-cli.git", tag = "v0.6.0" }
fj-core depends on fj-client, so depending on fj-core alone pulls the client layer in transitively. If the crates
are published to the Forgejo Cargo package registry on
dev.a8n.run, a downstream project can configure that as a sparse
registry and depend on fj-core / fj-client by version
instead of by git tag.
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.