1
0
Fork
You've already forked ffj-cli
0
No description
  • Go 99%
  • Shell 0.7%
  • Makefile 0.3%
Peter W 0835542c39
Some checks failed
CI / Test (push) Has been cancelled
CI / Lint (push) Has been cancelled
enhancement: Add -d shorthand for --debug and simplify command examples
- Add -d as shorthand for --debug flag
- Simplify examples in issue, release, tag, wiki, actions command help
Fixes ding-d8e43775, ding-f54c585e
2026年04月16日 01:33:17 -04:00
.dingles enhancement: Add -d shorthand for --debug and simplify command examples 2026年04月16日 01:33:17 -04:00
.github/workflows fix: update CI workflow 2026年04月15日 03:13:03 -04:00
cmd enhancement: Add -d shorthand for --debug and simplify command examples 2026年04月16日 01:33:17 -04:00
internal fix: host normalization in auth storage 2026年04月16日 01:05:10 -04:00
pkg/render Fix: slice bounds panic in AnsiPrinter.splitAt 2026年04月15日 02:55:05 -04:00
testmockserver Add test infrastructure: unit tests, mock server, integration tests 2026年04月15日 02:28:14 -04:00
tests fix: host normalization in auth storage 2026年04月16日 01:05:10 -04:00
.gitignore feat: Phase 1 foundation - config, auth, render systems 2026年04月14日 04:56:43 -04:00
.goreleaser.toml feat: complete ffj CLI implementation 2026年04月14日 23:20:39 -04:00
AGENTS.md Use dingles 2026年04月14日 02:23:11 -04:00
go.mod Add test infrastructure: unit tests, mock server, integration tests 2026年04月15日 02:28:14 -04:00
go.sum Add test infrastructure: unit tests, mock server, integration tests 2026年04月15日 02:28:14 -04:00
Makefile feat: foundation - Go module, cobra root, global flags, verbose/debug mode 2026年04月14日 03:34:42 -04:00
PLAN.md feat: foundation - Go module, cobra root, global flags, verbose/debug mode 2026年04月14日 03:34:42 -04:00
README.md feat: complete ffj CLI implementation 2026年04月14日 23:20:39 -04:00

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: --verbose and --debug flags for troubleshooting
  • Shell completion: Bash, Zsh, Fish, and PowerShell support
  • Pure Go: No C dependencies, uses go-git for 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

  1. Login to your instance:

    ffj auth login
    # or with explicit host
    ffj auth login https://codeberg.org
    
  2. View your profile:

    ffj whoami
    
  3. List repositories:

    ffj repo list owner/repo
    
  4. Create an issue:

    ffj issue create owner/repo --title "Bug: something is broken"
    

Configuration

Configuration is loaded from (in order, later takes precedence):

  1. Config file: ~/.config/ffj/config.toml
  2. Environment variables: FJ_HOST, FJ_REMOTE, etc.
  3. 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