Fawran
CLI

Authentication

How the CLI authenticates with Fawran

CLI Authentication

The Fawran CLI uses a secure, browser-based authentication flow to link your terminal session with your Fawran account.

How it works

  1. Initiate: When you run npx @copto/fawran-cli connect, the CLI generates a unique session token.
  2. Browser Flow: A browser window opens automatically, asking you to sign in to your Fawran dashboard.
  3. Approval: Once signed in, you'll see a request to authorize the CLI.
  4. Completion: After approval, the CLI receives two environment-scoped keys — one sandbox (fawran_sk_test_…) and one live (fawran_sk_live_…) — and stores them locally. Commands pick the key that matches --mode.

Credentials Storage

The CLI stores credentials in ~/.fawran/config.json:

{
  "keys": {
    "sandbox": "fawran_sk_test_…",
    "live": "fawran_sk_live_…"
  },
  "organizationId": "org_…"
}

You can also create keys in the dashboard under Settings → API keys, choosing the environment for each.

Environment Variables

For CI/CD, where browser-based auth isn't possible, pass the key through the environment. A scoped key selects the mode on its own; set FAWRAN_MODE as well if your key is a legacy fawran_sk_… key.

export FAWRAN_SECRET_KEY=fawran_sk_test_...
npx @copto/fawran-cli sync --yes --json

# legacy key
export FAWRAN_SECRET_KEY=fawran_sk_...
export FAWRAN_MODE=sandbox
npx @copto/fawran-cli sync --yes --json
VariablePurpose
FAWRAN_SECRET_KEYAPI key (--key overrides it)
FAWRAN_MODEsandbox or live (--mode overrides it)
FAWRAN_API_URLOverride the API host for the selected mode (self-hosted / local)

On this page

Ask about fawran

Ready

Start a new chat below.