Add fj runner token subcommand (Actions runner registration token) #193

Open
opened 2026-06-21 23:19:31 +00:00 by stephen · 0 comments
Owner

Summary

Add an fj subcommand to fetch a Forgejo Actions runner registration token, so registering a self-hosted runner does not require hand-rolling an API call.

Background

Verified this session that the current keychain-authenticated fj credentials can already retrieve registration tokens via the API (org token came back 40 chars, repo token 43 chars). Forgejo exposes these as GET (POST returns 405):

  • GET /orgs/{org}/actions/runners/registration-token
  • GET /repos/{owner}/{repo}/actions/runners/registration-token
  • (instance/admin scope: the admin equivalent)

So the subcommand is a thin, already-proven wrapper.

Proposed shape

fj runner token --org <org>
fj runner token --repo <owner>/<repo>
fj runner token            # instance/admin scope, if permitted
  • Prints the bare token to stdout (script-friendly), so register.sh can do fj runner token --org rasterstate.
  • Non-zero exit + stderr message on 403/404.
  • Respects the existing --repo/global host resolution conventions.

Notes

  • This unblocks scripted runner provisioning (Mac mini migration + the new Linux act_runner), removing a manual operator step.
  • Per repo convention, regenerate the fj CLI reference into fjord-docs (scripts/gen-cli-reference.py) once the command lands.
## Summary Add an `fj` subcommand to fetch a Forgejo Actions runner registration token, so registering a self-hosted runner does not require hand-rolling an API call. ## Background Verified this session that the current keychain-authenticated `fj` credentials can already retrieve registration tokens via the API (org token came back 40 chars, repo token 43 chars). Forgejo exposes these as **GET** (POST returns 405): - `GET /orgs/{org}/actions/runners/registration-token` - `GET /repos/{owner}/{repo}/actions/runners/registration-token` - (instance/admin scope: the admin equivalent) So the subcommand is a thin, already-proven wrapper. ## Proposed shape ``` fj runner token --org <org> fj runner token --repo <owner>/<repo> fj runner token # instance/admin scope, if permitted ``` - Prints the bare token to stdout (script-friendly), so `register.sh` can do `fj runner token --org rasterstate`. - Non-zero exit + stderr message on 403/404. - Respects the existing `--repo`/global host resolution conventions. ## Notes - This unblocks scripted runner provisioning (Mac mini migration + the new Linux act_runner), removing a manual operator step. - Per repo convention, regenerate the fj CLI reference into fjord-docs (scripts/gen-cli-reference.py) once the command lands.
stephen self-assigned this 2026-06-21 23:19:53 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
rasterstate/fj#193
No description provided.