Rust-based CLI application for comprehensive Forgejo server management via API
- Rust 100%
- Created .gitignore to exclude build artifacts - Removed target/ directory from git tracking - Prevents binary files and build cache from being committed |
||
|---|---|---|
| src | ||
| .gitignore | ||
| AGENTS.md | ||
| Cargo.lock | ||
| Cargo.toml | ||
| README.md | ||
| SKILLS.md | ||
fCodify - Forgejo Repository Management CLI
A comprehensive Rust-based command-line interface for managing Forgejo servers via the Forgejo API. This tool provides complete control over repositories, organizations, users, issues, pull requests, and releases.
Features
- Configuration Management: Multiple configuration sources (CLI args, environment variables, TOML files)
- Multi-Server Support: Manage multiple Forgejo servers with easy switching
- Comprehensive API Coverage: Full support for repos, orgs, users, issues, PRs, and releases
- Shell Completions: Generate completion scripts for bash, zsh, fish, and more
- Async Operations: Fast, non-blocking API calls using tokio
- Flexible Config Locations:
- User config:
~/.config/fCodify/config.toml - Global config:
/etc/fCodify/config.toml
- User config:
Installation
From Source
git clone ssh://forgejo@forgejo-ssh.jiggl.in:3022/opencode/fcodify-forgejo-long.git
cd fcodify-forgejo-long
cargo build --release
sudo cp target/release/fcodify /usr/local/bin/
Dependencies
- Rust 1.70+
- Cargo
Configuration
fCodify supports three configuration methods (in priority order):
- CLI Arguments (highest priority)
- Environment Variables
- TOML Configuration Files (lowest priority)
Quick Start
Create a configuration file:
fCodify config create
This creates ~/.config/fCodify/config.toml with placeholder values.
Configuration File Format
default_server = "my-forgejo"
[servers.my-forgejo]
url = "https://forgejo.example.com"
token = "your-access-token"
default_org = "my-org"
default_repo = "my-repo"
Environment Variables
export FORGEJO_URL="https://forgejo.example.com"
export FORGEJO_TOKEN="your-access-token"
export FORGEJO_ORG="my-org"
export FORGEJO_REPO="my-repo"
Usage
Configuration Commands
# Create a new config file
fCodify config create
# Show current config file path
fCodify config path
# Display config contents
fCodify config show
# Edit config file (uses $EDITOR, or falls back to nvim/vim/vi/nano)
fCodify config modify
# Edit global config (requires root)
sudo fCodify config modify --global
Server Management
# Add a new server
fCodify server add --name my-server --url https://forgejo.example.com --token TOKEN
# Show server details
fCodify server show
# Check server status and token validity
fCodify server status
# Set default server
fCodify server default --server my-server
Repository Operations
# List repositories in an organization
fCodify repo list --org my-org
# Create a new repository
fCodify repo create --name new-repo --org my-org
# Delete a repository
fCodify repo delete --name old-repo --org my-org
# List commits
fCodify repo commits list --org my-org --repo my-repo
Organization Management
# List organizations
fCodify org list
# List with details
fCodify org list-all
# Create an organization
fCodify org create --name new-org
# Delete an organization (and all its repos)
fCodify org delete --name old-org
Issue Management
# List issues in a repository
fCodify issue list --org my-org --repo my-repo
# Create an issue
fCodify issue create --org my-org --repo my-repo --title "Bug report" --comment "Description"
# Add a comment to an issue
fCodify issue comment --org my-org --repo my-repo --issue-number 42 --comment "Additional info"
# Close an issue
fCodify issue close --org my-org --repo my-repo --issue-number 42
Pull Request Operations
# Create a pull request
fCodify pr create --org my-org --repo my-repo --from-target feature-branch --to-target main --pr-title "New feature"
# List pull requests
fCodify pr list --org my-org --repo my-repo
# Merge a pull request
fCodify pr merge --pr-id 123
Release Management
# Create a release
fCodify releases create --org my-org --repo my-repo --tag v1.0.0 --title "Version 1.0.0"
# List releases
fCodify releases list --org my-org --repo my-repo
# Download a release
fCodify releases download --org my-org --repo my-repo --tag v1.0.0 --out-dir ./downloads
Shell Completions
Generate completion scripts for your shell:
# Bash
fCodify completion bash > /etc/bash_completion.d/fcodify
# Zsh
fCodify completion zsh > ~/.zsh/completion/_fcodify
# Fish
fCodify completion fish > ~/.config/fish/completions/fcodify.fish
# PowerShell
fCodify completion powershell > fcodify.ps1
Command Structure
All commands follow a hierarchical structure:
fCodify
├── config (create|path|show|modify)
├── server (add|show|status|default)
├── repo (list|create|delete|commits)
├── modify
│ ├── file (upload|edit|delete|name|create)
│ └── repo (delete|name|move)
├── org (list|list-all|create|delete)
├── user (list|create|modify)
├── issue (list|create|comment|modify|close)
├── pr (create|close|modify|list|show|merge)
├── releases (create|delete|list|show|download)
└── completion <shell>
Getting Help
Every command and subcommand has built-in help:
fCodify --help
fCodify config --help
fCodify repo commits --help
# etc.
API Documentation
This tool uses the Forgejo API v1. For API details, see: https://forgejo.jiggl.in/api/swagger
Development
Building
cargo build
Running Tests
cargo test
Project Structure
src/
├── main.rs # CLI entry point and command routing
├── config.rs # Configuration management
├── api.rs # Forgejo API client
└── commands.rs # Command implementations
License
MIT
Contributing
Contributions are welcome! Please submit pull requests to the main repository.
Support
For issues, please open an issue in the Forgejo repository.