fj auth
Manage authentication against Forgejo hosts
fj auth [OPTIONS] <COMMAND>Every command also accepts the global flags:
--host,--debug,--no-pager,--json-fields.
Options
--account <ACCOUNT>— Use an environment PAT for this account for this invocation only [env: FJ_ACCOUNT]--color <COLOR>— When to use ANSI color in output [default: auto][possible values: auto, always, never]
fj auth login
Authenticate with a Forgejo host. Stores the token in your OS keychain, or a 0600 file fallback
fj auth login [OPTIONS]Options
--account <ACCOUNT>— Use an environment PAT for this account for this invocation only [env: FJ_ACCOUNT]--token <TOKEN>— Pass the token as a flag instead of through stdin / interactive prompt--with-token— Read the token from stdin (useful for pipingcat token.txt | fj auth login --with-token)--color <COLOR>— When to use ANSI color in output [default: auto][possible values: auto, always, never]--git-protocol <GIT_PROTOCOL>— Git protocol to use when cloning from this host [default: https][possible values: https, ssh]--fjord— Sign in with Fjord Account credentials (email + password + optional TOTP) rather than a Forgejo personal access token. The resulting session bearer is used to talk to every Forgejo instance owned by this account, via the fjord-platform gateway. Usefj instancesafter signing in to list and pick an instance--manual— Manual / no-browser sign-in for a Fjord Account on an SSO/OIDC deployment: instead of capturing the redirect on a local loopback listener (which only works when your browser is on the SAME machine asfj), print the sign-in URL, let you sign in on ANY device, and paste the redirected URL (or the bare code) back. Use this whenfjruns on a remote server or your browser is on a separate device (e.g. an iPad). Fjord mode only [aliases: –no-browser]--device— Durable cross-device sign-in for a Fjord Account on an SSO/OIDC deployment via the OAuth 2.0 Device Authorization Grant (RFC 8628).fjshows a short code and a link (plus a scannable QR code); you open it on ANY device (phone, iPad, another laptop), approve, andfjpicks up the session automatically (no loopback, no copy-paste). This is the durable replacement for--manualwhen your browser is on a different device thanfj, and it’s auto-selected on a headless / SSH session. Fjord mode only--platform-url <URL>— fjord-platform deployment URL to sign in against. Defaults to the production deployment. Use this for local dev (http://localhost:5180) or to point at a staging environment
fj auth status
Show which hosts you’re signed in to
fj auth status [OPTIONS]Options
--show-token— Show the token (still doesn’t read it from disk; pulled from keychain)--account <ACCOUNT>— Use an environment PAT for this account for this invocation only [env: FJ_ACCOUNT]--color <COLOR>— When to use ANSI color in output [default: auto][possible values: auto, always, never]
fj auth logout
Forget the token for a host
fj auth logout [OPTIONS]Options
--account <ACCOUNT>— Use an environment PAT for this account for this invocation only [env: FJ_ACCOUNT]--color <COLOR>— When to use ANSI color in output [default: auto][possible values: auto, always, never]
fj auth list
List configured hosts
fj auth list [OPTIONS]Options
--account <ACCOUNT>— Use an environment PAT for this account for this invocation only [env: FJ_ACCOUNT]--color <COLOR>— When to use ANSI color in output [default: auto][possible values: auto, always, never]
fj auth switch
Set the default host for commands that omit --host
fj auth switch [OPTIONS] <HOST>Arguments
<HOST>— Hostname to make the new default
Options
--account <ACCOUNT>— Use an environment PAT for this account for this invocation only [env: FJ_ACCOUNT]--color <COLOR>— When to use ANSI color in output [default: auto][possible values: auto, always, never]
fj auth token
Print the stored token for a host (for scripting)
fj auth token [OPTIONS]Options
--account <ACCOUNT>— Use an environment PAT for this account for this invocation only [env: FJ_ACCOUNT]--force— Print the token even if stdout is a terminal (default refuses to, to avoid accidental shoulder-surfing in shell history)--color <COLOR>— When to use ANSI color in output [default: auto][possible values: auto, always, never]
fj auth refresh
Re-verify the stored token. Replaces it if a new one is given
fj auth refresh [OPTIONS]Options
--account <ACCOUNT>— Use an environment PAT for this account for this invocation only [env: FJ_ACCOUNT]--token <TOKEN>— Replace the stored token. If omitted, fj just re-verifies the existing one--with-token— Read replacement token from stdin--color <COLOR>— When to use ANSI color in output [default: auto][possible values: auto, always, never]
fj auth session
Import a Forgejo web session cookie for cookie-gated Actions web routes such as watch (a PAT is rejected by web routes; see fj#103)
fj auth session [OPTIONS]Options
--account <ACCOUNT>— Use an environment PAT for this account for this invocation only [env: FJ_ACCOUNT]--cookie <COOKIE>— Thei_like_giteasession cookie value, copied from a signed-in browser. Prefer--with-cookie(stdin) to keep it out of shell history--with-cookie— Read the cookie value from stdin--clear— Forget the stored session for the host instead of importing one--color <COLOR>— When to use ANSI color in output [default: auto][possible values: auto, always, never]
fj auth setup-git
Install a git credential helper that uses fj’s stored token
fj auth setup-git [OPTIONS]Options
--account <ACCOUNT>— Use an environment PAT for this account for this invocation only [env: FJ_ACCOUNT]--dry-run— Print the recommended git config commands without applying them--color <COLOR>— When to use ANSI color in output [default: auto][possible values: auto, always, never]
fj auth group
Organize hosts into named groups (a label only; auth is unaffected)
fj auth group [OPTIONS] <COMMAND>Options
--account <ACCOUNT>— Use an environment PAT for this account for this invocation only [env: FJ_ACCOUNT]--color <COLOR>— When to use ANSI color in output [default: auto][possible values: auto, always, never]
fj auth group list
List groups and the hosts assigned to each
fj auth group list [OPTIONS]Options
--json— Emit JSON instead of a table--account <ACCOUNT>— Use an environment PAT for this account for this invocation only [env: FJ_ACCOUNT]--color <COLOR>— When to use ANSI color in output [default: auto][possible values: auto, always, never]
fj auth group create
Create an empty group
fj auth group create [OPTIONS] <NAME>Arguments
<NAME>— Group name
Options
--account <ACCOUNT>— Use an environment PAT for this account for this invocation only [env: FJ_ACCOUNT]--color <COLOR>— When to use ANSI color in output [default: auto][possible values: auto, always, never]
fj auth group rename
Rename a group, keeping its hosts
fj auth group rename [OPTIONS] <NAME> <NEW_NAME>Arguments
<NAME>— Current group name<NEW_NAME>— New group name
Options
--account <ACCOUNT>— Use an environment PAT for this account for this invocation only [env: FJ_ACCOUNT]--color <COLOR>— When to use ANSI color in output [default: auto][possible values: auto, always, never]
fj auth group delete
Delete a group. Its hosts become ungrouped and are otherwise unchanged
fj auth group delete [OPTIONS] <NAME>Arguments
<NAME>— Group name
Options
-y, --yes— Skip the confirmation prompt--account <ACCOUNT>— Use an environment PAT for this account for this invocation only [env: FJ_ACCOUNT]--color <COLOR>— When to use ANSI color in output [default: auto][possible values: auto, always, never]
fj auth group assign
Put a host in a group. A host is in at most one group, so this replaces any group it was in before
fj auth group assign [OPTIONS] <GROUP>Arguments
<GROUP>— Group to put the host in
Options
--account <ACCOUNT>— Use an environment PAT for this account for this invocation only [env: FJ_ACCOUNT]--color <COLOR>— When to use ANSI color in output [default: auto][possible values: auto, always, never]
fj auth group unassign
Take a host out of its group
fj auth group unassign [OPTIONS]Options
--account <ACCOUNT>— Use an environment PAT for this account for this invocation only [env: FJ_ACCOUNT]--color <COLOR>— When to use ANSI color in output [default: auto][possible values: auto, always, never]
fj auth proxy
Store credentials for a reverse proxy that guards the forge with HTTP Basic authentication. Separate from the forge token
fj auth proxy [OPTIONS]- Stephen Way