Skip to main content
The recommended way to authenticate is simply:
This opens your browser for RunFlow login (OIDC with PKCE). No API key needed — you sign in with your regular RunFlow account, pick a tenant if you have more than one, and the CLI saves everything as a profile.
An API key is only needed for non-interactive environments (CI/CD, scripts, servers without a browser). See API key login below.

How It Works

  1. Browser opens on the RunFlow login page (the CLI listens on a local callback, ports 86308640).
  2. You sign in with your RunFlow account (email/password or SSO).
  3. Tenant selection — if your account has access to multiple tenants, the CLI shows a searchable list to pick the active one.
  4. Profile saved — access token, refresh token, tenant, and API URL are stored in ~/.runflowrc. The profile is named after the tenant unless you pass --profile.
Tokens are refreshed automatically — you won’t be asked to log in again until the refresh token expires or you run rf logout. Verify your session at any time:

Options

Switching Tenants

If your account has access to multiple tenants, switch between them anytime — no new login required:

Multiple Environments

Each profile remembers its own API URL and identity provider, so cloud and self-hosted installs live side by side:
When you pass --api, the CLI discovers the installation’s login provider from the server and remembers the URL in the profile, so later logins and refreshes reuse it automatically.
Running RunFlow in your own environment, or switching between several environments? See Self-Hosted & Multiple Environments.

API Key Login (CI and Automation)

For pipelines, scripts, and headless machines, authenticate with an API key instead of the browser:

Getting an API Key

  1. Go to the RunFlow Portal
  2. Navigate to SettingsAPI Keys
  3. Click Create New API Key
  4. Copy the key (starts with sk-...)

Example: GitHub Actions

Never hardcode API keys in scripts or commit them to version control. Use your CI provider’s secret storage.

Signing Out

rf logout clears the stored tokens but keeps the API URL, provider, and tenant, so signing back in is a single rf login with no flags:

Configuration File

Credentials are stored per profile in ~/.runflowrc (YAML):
Credentials are stored in plain text in ~/.runflowrc. Ensure proper file permissions:
Recommendations:
  • Never share your ~/.runflowrc file
  • Don’t commit .runflowrc to version control
  • Prefer browser login for humans; reserve API keys for automation
  • Use separate API keys for dev/staging/prod
  • Rotate keys regularly and revoke unused ones from the portal

Troubleshooting

Browser Doesn’t Open / Login Times Out

Solution:
  • Check that a browser is available on the machine — on headless servers, use rf login --api-key instead
  • Make sure nothing blocks localhost ports 86308640 (firewall, VPN)
  • Try again — the login link waits a limited time for the callback

No Tenant Found

Solution: Your user isn’t linked to any tenant yet. Ask your workspace admin for an invite, or sign up at the RunFlow Portal first.

Invalid API Key

Solution: Check your API key in the portal and try again.

Network Connection Error

Solution:
  • Check your internet connection
  • Verify the API URL is correct (--api for self-hosted)
  • Check if the API is accessible (firewall, VPN)

Permission Denied (Config File)

Solution:

Next Steps

Profiles

Manage multiple profiles

Self-Hosted

Point the CLI at your own installation

Create Agent

Create your first agent

Test

Test agents locally