fw has two authentication paths. They do not share a credential lifetime.
- Interactive —
fw loginruns an OAuth device flow and stores a named profile. - CI —
FW_ORG_API_KEYsupplies an org-scoped API key. When that variable is set,fwskips profiles entirely.
Interactive login
fw starts a device-flow session against the Fireweave cloud, opens your browser to a verification URL with the user code embedded, and waits for approval (default 300 seconds).
On success it writes a named profile under ~/.fireweave/profiles/ and stores the token in the system keyring when one is available. The first profile you create becomes the active profile. Later logins do not auto-switch.
A no-flag fw login follows the binary’s stamped channel: a stable build targets production; a staging build targets staging.
--cloud, --staging, and --url are mutually exclusive.
After login, if this folder is not bound to a project, fw tells you to run fw init. If it is already bound, run fw status.
Profiles
A profile is a person’s OAuth session: access token, refresh token, alias, and expiry.fw renews the access token silently while the refresh token is valid.
Resolution order for an interactive command (when
FW_ORG_API_KEY is not set):
--profile <alias>- Repo pin in
.fireweave/local.json - Repo binding / org match against
.fireweave/project.json - Global
activeProfile - The only stored profile, if there is exactly one
--profile always wins, including over FW_ORG_API_KEY. That lets you debug a CI failure locally without the ambient key hijacking your session.
Bind a repo
fw init scaffolds .fireweave/, lets you pick or create a profile, and writes the committed binding (org, project, server URL) to .fireweave/project.json. Your personal profile alias goes only to the gitignored .fireweave/local.json.
fw select-project --project-id <id> skips the picker. Create the project in the Fireweave app first if the list is empty.
CI credentials
On a machine with no human, setFW_ORG_API_KEY to an org API key.
fw uses it as the bearer token and does not read ~/.fireweave/, local.json, or activeProfile.
The key must start with fw_org_. A value that does not match that prefix is refused — fw will not fall back to a leftover developer profile. A CI job that silently authenticates as a person is worse than one that fails.
The key says who you are, not where to send it. The repo must already have .fireweave/project.json with a server.url (written by fw init). Without that URL, fw refuses the key.
If the pointer names an orgId, fw checks it against the org the server attributes to the key. A mismatch fails closed (exit 4 on fw sync) and writes nothing to .fireweave/.cache/.
fw doctor prints the credential actually in use. In CI it reports org API key rather than “no profile”, so a working fw sync and a missing login are not the same symptom.
Scopes
Org API keys are minted with an explicit scope. The two valid values are a closed set:
Scope is enforced on the server. A leaked
org:ci-read key cannot write just because a client asked.
Provision a second key, update the CI secret, then revoke the first. Revocation takes effect on the next request. Keys do not expire.
Create a key
Create the key from a signed-in Fireweave session. The raw value is shown once.- Sign in to the Fireweave app for your organisation.
- Mint a key with a name and a required
scope(org:ci-readfor CI,org:managementfor Terraform / HTTP management). - Store the returned
key(fw_org_…) in your secret manager.
FIREWEAVE_API_KEY variable the Terraform provider reads. The CLI reads FW_ORG_API_KEY, not FIREWEAVE_API_KEY and not FW_PROJECT_API_KEY.
Org API key management may be disabled for an organisation. In that case the mint endpoint returns 404.
Which credential to use
These secrets are not interchangeable. An org key does not evaluate control points. A project key does not authenticate
fw.
Next
Commands
fw sync, fw init, fw doctor, and the rest of the surface.HTTP API
Management-plane routes that accept the same org key.

