No description
- Go 99%
- Shell 0.7%
- Makefile 0.3%
ffj - A CLI for Forgejo and Codeberg
A Go CLI client for Forgejo and Codeberg, rewritten from the Rust forgejo-cli (fj) with improvements to debuggability, help text, configuration, and testability.
Features
- Comprehensive commands: Full coverage of Forgejo API with subcommands for repos, issues, PRs, releases, wiki, and more
- OAuth2 authentication: Secure browser-based login with PKCE flow
- Flexible configuration: TOML config file, environment variables, and command-line flags
- Debug modes:
--verboseand--debugflags for troubleshooting - Shell completion: Bash, Zsh, Fish, and PowerShell support
- Pure Go: No C dependencies, uses
go-gitfor Git operations
Installation
From source
git clone https://codeberg.org/mutablecc/ffj-cli.git
cd ffj-cli
make install
Using Go
go install codeberg.org/mutablecc/ffj-cli@latest
Quick Start
-
Login to your instance:
ffj auth login # or with explicit host ffj auth login https://codeberg.org -
View your profile:
ffj whoami -
List repositories:
ffj repo list owner/repo -
Create an issue:
ffj issue create owner/repo --title "Bug: something is broken"
Configuration
Configuration is loaded from (in order, later takes precedence):
- Config file:
~/.config/ffj/config.toml - Environment variables:
FJ_HOST,FJ_REMOTE, etc. - Command-line flags
Example ~/.config/ffj/config.toml:
[defaults]
host = "https://codeberg.org"
remote = "origin"
style = "auto"
[instances."codeberg.org"]
default-ssh = true
Authentication
- OAuth2 (recommended):
ffj auth login- opens browser for authentication - API token:
ffj auth add-key <host>- enter token manually
Auth data is stored in ~/.local/share/ffj/keys.json (mode 0600).
Commands
| Command | Description |
|---|---|
auth |
Login, logout, add-key, use-ssh, list |
whoami |
Show current authenticated user |
repo |
Create, view, clone, star, fork repositories |
issue |
Create, view, list, close, comment on issues |
pr |
Create, view, list, merge pull requests |
release |
Create, view, list, delete releases |
tag |
Create, list, delete tags |
org |
List, view, create organizations |
user |
Search, view user profiles |
wiki |
Browse wiki pages |
actions |
Open actions in browser |
config |
View, set, unset configuration |
completion |
Generate shell completions |
version |
Print version information |
Global Flags
| Flag | Short | Description |
|---|---|---|
--host |
-H |
Forgejo instance host |
--verbose |
-v |
Verbose output |
--debug |
Debug mode (HTTP requests, stack traces) | |
--config |
-c |
Config file path |
Debugging
Use --verbose (-v) for human-friendly debugging:
- Elapsed time per operation
- Which host/remote/repo was resolved
- Authentication method used
Use --debug for full details:
- Full HTTP requests/responses
- Stack traces on errors
License
MIT