Forgejo CLI tool — interact with Forgejo from Claude Code via bash
- Rust 100%
|
|
||
|---|---|---|
| src | ||
| Cargo.lock | ||
| Cargo.toml | ||
| README.md | ||
forgejo_claude
A CLI tool for interacting with a Forgejo instance. Built in Rust using the forgejo-api crate.
Installation
The crate is published to the Forgejo package registry at https://forgejo.victorsavu.eu/api/packages/victor/cargo/.
To install, add the registry to ~/.cargo/config.toml:
[registries.forgejo]
index = "sparse+https://forgejo.victorsavu.eu/api/packages/victor/cargo/"
Then install with:
cargo install forgejo_claude --registry forgejo
Configuration
Run the login command once to save your credentials. It only prompts for values that are not already set:
forgejo_claude login
Credentials are stored in ~/.config/forgejo_claude/config.toml:
forgejo_url = "https://your.forgejo.instance"
forgejo_token = "your_api_token"
owner = "your_username"
Generate an API token at https://your.forgejo.instance/user/settings/applications. The token needs the write:issue and write:repository scopes.
Usage
Issues
# List issues (state: open / closed / all, default: open)
forgejo_claude list-issues <repo> [state]
# Create an issue
forgejo_claude create-issue <repo> <title> <body>
# Edit an issue (all flags optional)
forgejo_claude edit-issue <repo> <number> [--title <title>] [--body <body>] [--state open|closed]
# Add a comment
forgejo_claude add-comment <repo> <number> <body>
Repositories
# Create a repository under the configured owner
forgejo_claude create-repo <name> <description> [--private]
Development
Building
cargo build --release
# binary at: target/release/forgejo_claude
Linting
Always run Clippy before committing:
cargo clippy
Publishing
The crate is published to the Forgejo registry:
cargo publish --registry forgejo