Interactive command. Authenticates the Fjall CLI and stores credentials in
~/.fjall/auth.json (or $FJALL_CONFIG_DIR/auth.json).Login is optional for local-only work such as scaffolding and editing infrastructure files. It is required for any command that talks to Fjall’s cloud services or to AWS.
Usage
fjall login authenticates the CLI against your Fjall account and stores the credential locally. There are two paths:
- Device-code (the default): a browser window confirms the login.
- API key: paste a key from the dashboard, or pass
--api-key.
~/.aws/config or ~/.aws/credentials, and aws sso login is never part of the flow.
Options
Authentication flow
Interactive login
E at this step. The CLI also falls back to API-key entry on its own if the device-code flow errors.
There is no method picker. Interactive login always starts with the device-code flow, and API-key entry is the fallback.
When a valid credential is already saved, the command asks first (a Yes/No selector defaulting to No):
--force.
Device-code login without the UI
Add--non-interactive to run the same flow as plain text, which is what CI logs and agent transcripts show:
--device on its own changes nothing. It routes to the same interactive screen, which already starts with the device-code flow. The flag matters in non-interactive and agent shells, where it selects the browser path over the API-key path.
Choosing an organisation
One credential file holds one API key, so the CLI is signed in to exactly one organisation at a time. Pass--org to pick which one the device flow signs you in to:
--orgrequires--device. With the API-key path it is refused, because a key authenticates its own organisation.--orgforces the non-interactive path. The interactive screen has no organisation input, so routing there would drop the flag.
API-key login
Skip the browser entirely by passing a key:fj_. Anything else is rejected before the network call with Invalid API key format. Must start with 'fj_'.
Agent mode
How it works
- Loads any credential at
~/.fjall/auth.jsonand revalidates it against the Fjall API. - Requests a device code, or validates the supplied API key.
- Opens your browser and polls until you approve, up to the 15-minute device-code expiry.
- Saves the credential with
0600permissions inside a0700directory. - Discovers and records your organisation identity.
Credential storage
Fjall writes the credential to its state root:FJALL_CONFIG_DIR to relocate that root. It moves the whole root, credentials plus the connection, org-config and app-id caches, drift journals and CLI logs, so two organisations never share a coherent-looking mix of state.
The credential:
- Stays on your machine, never synced.
- Authenticates API requests and mints the AWS credentials used to deploy.
- Carries restrictive file permissions (
0600). - Can be removed at any time.
CI/CD integration
Device-code login needs a human at a browser and does not work unattended. Use a CI deploy token instead. Mint one in the web app under Settings → CI/CD Tokens, then see CI/CD Integration. Environment variable (recommended)FJALL_API_KEY before any stored credential, so no fjall login call is required.
Non-interactive login
--api-key or --device. The command errors otherwise. --device still needs a human to open the printed URL and approve within 15 minutes, so unattended pipelines should use --api-key or FJALL_API_KEY.
fjall login --api-key accepts legacy fj_ user keys only. It stores the
key as your credential. Scoped tokens (fjall_dk_ deploy tokens,
fjall_ak_ agent tokens) are not stored by fjall login. Pass them via
FJALL_API_KEY instead, which every command reads directly. For pipelines
prefer a deploy token. For AI agents acting as you, use an agent token from
fjall token create.Security
- Keep the
~/.fjall/directory private. - Generate a separate API key for each environment.
- Rotate keys on a regular schedule.
Removing credentials
Troubleshooting
Authentication failed
Common errors
Not authenticated
If commands report you are not authenticated:- Run
fjall loginagain. - Confirm
~/.fjall/auth.jsonexists. - Verify the file is readable by your user (
0600). - Check whether
FJALL_CONFIG_DIRis set in your shell, which moves the credential elsewhere.
Shared machines
Each OS user has separate credentials under their own home directory, so there are no conflicts between users.Next Steps
Connect AWS
Link an AWS account before deploying.
Create an application
Scaffold an application and its infrastructure.
Deploy
Push your application to AWS.
Agent mode
Run the CLI as a coding agent with structured output.