mcpField
F
forgejo-cli

forgejo-cli

github.com/magnus919Development15361 installsUpdated 1d ago
Repository

About forgejo-cli

A Python CLI for operating Forgejo installations, aimed at routine repository and collaboration tasks. It offers command groups for common workflows, a general API command for other endpoints, and previews for mutations.

Key features

  1. 01Manage issues, PRs, repositories, and related resources
  2. 02Call other endpoints through a general API command
  3. 03Paginate list and search requests
  4. 04Preview mutation plans with dry-run
  5. 05Emit one JSON result and separate diagnostics

Use cases

  1. 01List issues in a repository
  2. 02Preview creating a private repository
  3. 03Call a Forgejo API endpoint not covered by commands
  4. 04Inspect pagination responses and total counts

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/magnus919/agent-skills --skill forgejo-cli

After installing, type/forgejo-cliin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

README.md
V2-SPEC.md
evals/
evals.json
references/
api-usage.md
command-reference.md
endpoint-routing.md
troubleshooting.md
scripts/
forgejo-cli
tests/
test_cli.py

Details

From the project README

Forgejo CLI v2

Run python3 scripts/forgejo-cli. --agent (default) uses FORGEJO_AGENT_TOKEN; --user uses FORGEJO_USER_TOKEN; --server URL selects an installation. Set FORGEJO_SERVER in your shell if your wrapper supplies it, otherwise pass --server explicitly.

Safety

  • Mutations require --force/--yes/-y, or --dry-run.
  • --dry-run --json emits one plan with method, path, query, and body; it makes no network request.
  • --json writes exactly one JSON value to stdout; diagnostics go to stderr.
  • --page and --limit work for any list/search request. Add --include-response to receive the HTTP status plus link and x-total-count pagination headers.
  • --help does not read credentials or contact a server. Path segments are encoded.

Common workflows

python3 scripts/forgejo-cli issue list --owner acme --repo app --json
python3 scripts/forgejo-cli --dry-run --json repo create --name demo --private
python3 scripts/forgejo-cli --dry-run --json api --method POST \
  --path /api/v1/repos/acme/app/actions/variables --data '{"name":"KEY","value":"value"}'

First-class groups: issue, pr, repo, content, label, milestone, release, hook, and user. content expects base64 and update/delete require the current SHA. Use api for any other /api/v1/ endpoint; it supports JSON, raw files, multipart uploads/forms, and custom headers. Consult /api/swagger or /swagger.v1.json on the selected server. See command reference.

Choosing a command

Use a first-class command for its covered daily workflow. Use api when the operation is absent, requires version-specific fields, or needs a schema not represented by a simple flag. Before using api, read endpoint routing; read API usage for authentication, pagination, compatibility, and safe schema discovery. Read troubleshooting for 401/403/422 responses and transport failures.

Comments

Markdown supported