mcpField
F
forgejo-cli-ops

forgejo-cli-ops

github.com/daisuke897Development048 installsUpdated 1w ago
Repository

About forgejo-cli-ops

forgejo-cli-ops is a skill for authenticating to Forgejo and using the `fj` CLI for common repository, issue, and pull request operations. It also covers host selection and login troubleshooting.

Key features

  1. 01Forgejo authentication and access checks
  2. 02Host selection with `-H` or `FJ_HOST`
  3. 03Common repository, issue, and PR commands
  4. 04Login and host mismatch troubleshooting
  5. 05Optional token storage with `secret-tool`

Use cases

  1. 01Setting up `fj` access to a Forgejo host
  2. 02Checking the active account and authentication
  3. 03Running issue, PR, or repository commands
  4. 04Diagnosing login failures caused by host selection

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/daisuke897/dotfiles --skill forgejo-cli-ops

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

Details

From the project README

Scope

  • Authenticate to a Forgejo host and verify access.
  • Run common issue/PR/repo commands with the correct host.
  • Troubleshoot host and login mismatches.

Prerequisites

  • A Forgejo Personal Access Token (PAT) created in the Forgejo web UI.
  • fj installed and available in PATH.
  • Optional: secret-tool (GNOME Keyring) for secure token storage.

Host usage (important)

-H/--host is a global option and must be placed before subcommands.

fj -H <FORGEJO_HOST> repo view <owner>/<repo>

To avoid repeating the host, set FJ_HOST:

export FJ_HOST=<FORGEJO_HOST>

Authentication (secret-tool example)

Store your token (one-time) and register with fj:

echo -n "<PAT_VALUE>" | secret-tool store --label="Forgejo PAT" service forgejo user <username>@<FORGEJO_HOST>
echo -n "$(secret-tool lookup service forgejo user <username>@<FORGEJO_HOST>)" | fj -H <FORGEJO_HOST> auth add-key <username>

Verify:

fj -H <FORGEJO_HOST> auth list
fj -H <FORGEJO_HOST> whoami

Cleanup

fj auth logout <FORGEJO_HOST>
secret-tool clear service forgejo user <username>@<FORGEJO_HOST>

Troubleshooting

  • Error: not logged in often means the host defaulted to github.com; add -H or set FJ_HOST.
  • If secret-tool lookup returns nothing, unlock your keyring or confirm the stored user/host key.

Comments

Markdown supported