fj auth
Manage authentication against Forgejo hosts
fj auth [OPTIONS] <COMMAND>Every command also accepts the global flags:
--host,--debug,--no-pager,--json-fields.
fj auth login
Authenticate with a Forgejo host. Stores the token in your OS keychain
fj auth login [OPTIONS]Options
--token <TOKEN>— Pass the token as a flag instead of through stdin / interactive prompt [env: FJ_TOKEN]--with-token— Read the token from stdin (useful for pipingcat token.txt | fj auth login --with-token)--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--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)
fj auth logout
Forget the token for a host
fj auth logout [OPTIONS]fj auth list
List configured hosts
fj auth list [OPTIONS]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
fj auth token
Print the stored token for a host (for scripting)
fj auth token [OPTIONS]Options
--force— Print the token even if stdout is a terminal (default refuses to, to avoid accidental shoulder-surfing in shell history)
fj auth refresh
Re-verify the stored token. Replaces it if a new one is given
fj auth refresh [OPTIONS]Options
--token <TOKEN>— Replace the stored token. If omitted, fj just re-verifies the existing one--with-token— Read replacement token from stdin
fj auth setup-git
Install a git credential helper that uses fj’s stored token
fj auth setup-git [OPTIONS]Options
--dry-run— Print the recommended git config commands without applying them
Contributors
- Stephen Way