Skip to content

CLI Usage

The fyrn CLI (@fyrn/cli) is the primary tool for creating, testing, deploying, and managing integration flows from your terminal. When invoked with no arguments, it launches an interactive AI-powered assistant.

  • Binary: fyrn
  • NPM package: @fyrn/cli
  • Default API URL: https://api.fyrn.ai
  • Node requirement: >= 22.0.0
Terminal window
npm install -g @fyrn/cli

Or without installing:

Terminal window
npx @fyrn/cli --help
Terminal window
fyrn login # opens Auth0 PKCE flow in a browser
fyrn auth status # show current identity
fyrn logout # clear credentials

Tokens are stored at ~/.fyrn/credentials.json (mode 0600). fyrn login and fyrn auth login are equivalent; same for logout.

Prefer the FYRN_API_KEY environment variable — the CLI reads it directly, no config file is written, and the key never touches the CI runner’s disk. Get the key from the dashboard under Settings → Agent Keys.

Terminal window
export FYRN_API_KEY=sk-your-agent-key
fyrn flow list

If you want a persistent key on a workstation (not recommended for CI), write it to ~/.fyrn/config.json via:

Terminal window
fyrn auth api-key --api-key sk-your-agent-key --api-url https://api.fyrn.ai

--api-url is optional; the default is https://api.fyrn.ai.

VariableRequiredDefaultDescription
FYRN_API_KEYCI onlyAgent API key. Takes precedence over ~/.fyrn/config.json.
FYRN_API_URLNohttps://api.fyrn.aiControl-plane base URL.
FYRN_AUTH0_DOMAINNofyrn.eu.auth0.comOverride Auth0 domain (local dev).
FYRN_AUTH0_CLI_CLIENT_IDNobuilt-inOverride Auth0 PKCE client ID (local dev).
FYRN_AUTH0_AUDIENCENohttps://api.fyrn.aiOverride Auth0 audience (local dev).
ANTHROPIC_API_KEYNoRequired for fyrn interactive mode (AI assistant).
BRAVE_SEARCH_API_KEYNoOptional web search in interactive mode.

The CLI also loads .env files — first the nearest .env walking up from cwd, then ~/.fyrn/.env as a global fallback. Real environment variables always win over .env values.

PathPurpose
~/.fyrn/config.jsonAPI key, API URL, Auth0 overrides, active account/environment
~/.fyrn/credentials.jsonOAuth tokens from fyrn login
~/.fyrn/.envGlobal env-var fallback
.env (project)Per-project env-var overrides
fyrn.config.jsonPer-project configuration
fyrn.config.local.jsonLocal overrides (gitignored)

Where a command takes --env, the value can be an environment name or slug; the CLI resolves it to a UUID before calling the API.


Project — fyrn init, fyrn pull, fyrn push, fyrn diff

Section titled “Project — fyrn init, fyrn pull, fyrn push, fyrn diff”

Initialize a fyrn project in the current directory. Creates fyrn.config.json, a flows/ directory, and adds fyrn.config.local.json to .gitignore.

Terminal window
fyrn init

Pull remote flow(s) to flows/. Pulls all flows if flow-name is omitted.

FlagDescription
--forceOverwrite local changes without warning
Terminal window
fyrn pull
fyrn pull my-flow
fyrn pull --force

Push local flow(s) to the control plane as drafts.

Terminal window
fyrn push
fyrn push my-flow

Show differences between local and remote flow YAML as a colored unified diff.

Terminal window
fyrn diff
fyrn diff my-flow

All flow subcommands accept --env <environment> to target a specific environment (defaults to current).

Terminal window
fyrn flow list
fyrn flow list --env staging

Show a flow’s details — ID, status, version, description, timestamps, webhook URL, and YAML config.

Terminal window
fyrn flow show abc123

Generate a flow from natural language (AI). Review and confirm the generated YAML.

FlagDescriptionDefault
--error-handling <level>conservative, standard, or aggressivestandard
Terminal window
fyrn flow create "Sync Shopify orders to NetSuite"
fyrn flow create "Forward webhook events to Slack" --error-handling conservative

Validate, compile, and activate a flow.

Terminal window
fyrn flow deploy abc123

Test a local YAML file against sample data without hitting the API.

FlagDescriptionRequired
--sample-data <file>Path to sample JSON data fileYes
Terminal window
fyrn flow test flows/my-flow.yaml --sample-data sample.json

Preview a deployed flow’s transform via the server.

FlagDescription
--payload <file>JSON payload file
--generateUse AI to generate a sample payload
Terminal window
fyrn flow preview abc123 --payload sample.json
fyrn flow preview abc123 --generate

Clone an existing flow to another environment.

FlagDescriptionRequired
--to <env>Target environmentYes
--env <env>Source environmentNo
Terminal window
fyrn flow clone abc123 --to staging
fyrn flow clone abc123 --to production --env development

Compare the YAML configs of two deployed flows.

Terminal window
fyrn flow diff abc123 def456

Soft-delete a flow.

Terminal window
fyrn flow delete abc123

List all connectors (catalog + instances).

Terminal window
fyrn connector list

List available connector types from the catalog.

Terminal window
fyrn connector catalog

List configured instances only.

Terminal window
fyrn connector instances

Test an instance’s connection.

Terminal window
fyrn connector test abc123

Build a private connector from an API spec URL or plain-English description.

FlagDescription
--name <slug>Connector name
--spec <file>Path to a local OpenAPI/Swagger spec file
Terminal window
fyrn connector build "https://docs.acme.com/api"
fyrn connector build "Acme CRM REST API with OAuth2" --name acme-crm
fyrn connector build --spec ./openapi.yaml --name acme-crm

Run OAuth2 connect flow for an instance. Opens a browser.

Terminal window
fyrn connector connect shopify-main

Show OAuth / connection status — token validity, expiration, and scopes.

Terminal window
fyrn connector status shopify-main

Inspect or refresh an OAuth access token.

Terminal window
fyrn connector token shopify-main

Stream live message logs via SSE. Press Ctrl+C to stop.

FlagDescription
--status <status>Filter by delivery status
Terminal window
fyrn logs tail abc123
fyrn logs tail abc123 --status failed

Historical search across message logs.

FlagDescriptionDefault
--status <status>Filter by delivery status
--since <duration>Messages since (e.g., 1h, 30m, 7d)
--until <duration>Messages until
--search <text>Search in payload content
--limit <n>Max results20

Duration strings use s/m/h/d suffixes. Non-matching values are treated as ISO date-time strings.

Terminal window
fyrn logs search abc123 --status failed --since 1h
fyrn logs search abc123 --search "order_id" --limit 50

Re-run a specific message through the flow.

Terminal window
fyrn logs replay msg-abc123

List scheduled flows with cron, next run, and enabled state.

Terminal window
fyrn schedules list

Manually trigger a schedule now.

Terminal window
fyrn schedules trigger my-flow

Custom code adapters run JavaScript in sandboxed V8 isolates for non-standard transformations.

Terminal window
fyrn adapters list

fyrn adapters generate “<description>”

Section titled “fyrn adapters generate “<description>””

Generate an adapter with AI.

FlagDescriptionDefault
--type <type>transform or authtransform
--sample <json>Sample input JSON
Terminal window
fyrn adapters generate "Convert XML order to JSON format"
fyrn adapters generate "Add HMAC signature header" --type auth

Test in a sandboxed V8 isolate.

FlagDescriptionRequired
--input <json>JSON input payloadYes
Terminal window
fyrn adapters test abc123 --input '{"order_id": "12345"}'

List pre-built adapter templates.

Terminal window
fyrn adapters templates

Lookup tables are account-scoped — shared across all environments in the account — so flow clone preserves their references without rewiring.

Terminal window
fyrn lookup list
FlagDescriptionDefault
-s, --search <q>Search entries by key or value
-l, --limit <n>Max entries to display20
Terminal window
fyrn lookup show abc123 --search "US" --limit 50
FlagDescription
-d, --description <text>Table description
Terminal window
fyrn lookup create country-codes --description "ISO country code mappings"
Terminal window
fyrn lookup delete abc123

Upsert a single entry.

Terminal window
fyrn lookup set abc123 US "United States"
Terminal window
fyrn lookup remove abc123 US

Bulk-import from CSV. Requires key and value columns.

Terminal window
fyrn lookup import abc123 country-codes.csv

Export entries as CSV to stdout.

Terminal window
fyrn lookup export abc123 > countries.csv

Export and import flow bundles as ZIP files for backup or cross-environment migration.

FlagDescription
-o, --output <file>Output file path (default: <flow-name>.zip)
Terminal window
fyrn bundle export my-flow --output /tmp/my-flow-bundle.zip
Terminal window
fyrn bundle import my-flow.zip

Run a flow over a large dataset with progress tracking and failure handling.

Submit a batch job.

FlagDescriptionDefault
--file <path>JSON array or CSV file of recordsRequired
--concurrency <n>Max concurrent records
--on-failure <mode>continue or stopcontinue
--max-failures <n>Stop after N failures
--retryRetry failed records automatically
Terminal window
fyrn batch submit abc123 --file orders.csv --concurrency 10
fyrn batch submit abc123 --file records.json --on-failure stop --max-failures 5

List batch jobs.

FlagDescription
--flow <flow-id>Filter by flow
Terminal window
fyrn batch list
fyrn batch list --flow abc123

Show job status and record-level stats.

Terminal window
fyrn batch show job-abc123

Cancel a running job.

Terminal window
fyrn batch cancel job-abc123

Retry failed records in a completed job at lower concurrency.

Terminal window
fyrn batch retry job-abc123

Export error details for failed records.

Terminal window
fyrn batch errors job-abc123

When fyrn detects an API schema change, it auto-generates a fix and creates a healing event for review.

FlagDescription
--status <status>Filter by status (pending, approved, rejected)
--flow <flow-id>Filter by flow
Terminal window
fyrn healing list --status pending

Show full details of a healing event — the detected change, proposed fix, and diff.

Terminal window
fyrn healing show heal-abc123

Approve a healing event and apply the proposed fix.

Terminal window
fyrn healing approve heal-abc123
Terminal window
fyrn healing reject heal-abc123

Alias: fyrn gov.

Terminal window
fyrn governance list
Terminal window
fyrn governance show policy-abc123

Check a flow (or all flows) against all policies.

FlagDescription
--allCheck all flows
Terminal window
fyrn governance check abc123
fyrn gov check --all

Manage agent API keys and monitor agent activity.

Terminal window
fyrn agents keys list
FlagDescription
--name <name>Key name
--tier <tier>standard or premium (rate-limit tier)
--rate-limit <rpm>Requests per minute
--daily-quota <n>Daily request quota
--sandboxSandbox mode — blocks deploy_flow
--approvalRequire approval for destructive actions
Terminal window
fyrn agents keys create --name "CI bot" --tier standard --rate-limit 60
fyrn agents keys create --name "Dev agent" --sandbox --approval --daily-quota 1000
Terminal window
fyrn agents keys update ak-abc123 --tier premium

Revoke a key. Immediate and irreversible.

Terminal window
fyrn agents keys revoke ak-abc123

Show agent tool-call audit log.

FlagDescription
--key <id>Filter by key
--tool <name>Filter by tool
--status <status>Filter by status (e.g., failed)
--limit <n>Max results
Terminal window
fyrn agents activity --key ak-abc123 --limit 50
fyrn agents activity --tool flow.create --status failed

Manage APIs published through fyrn.

Terminal window
fyrn apis list

Show rendered API docs.

Terminal window
fyrn apis docs orders-api

Fetch the OpenAPI spec.

FlagDescriptionDefault
-f, --format <format>json or yamlyaml
-o, --output <file>Write to file instead of stdout
Terminal window
fyrn apis spec orders-api -f json -o openapi.json

Update a published API endpoint.

Terminal window
fyrn apis update orders-api

Delete a published API endpoint.

Terminal window
fyrn apis delete orders-api

List published services (groupings of API actions).

Terminal window
fyrn apis services list

Show a service with its actions.

Terminal window
fyrn apis services show orders-service

Show rendered service docs.

Terminal window
fyrn apis services docs orders-service

Terminal window
fyrn env list
Terminal window
fyrn env switch staging
Terminal window
fyrn env current
FlagDescription
--color <hex>Dashboard color
--productionMark as a production environment
Terminal window
fyrn env create qa --color "#f59e0b"
fyrn env create prod --production

For users with access to multiple accounts.

Terminal window
fyrn accounts list
Terminal window
fyrn accounts switch acme-corp
Terminal window
fyrn accounts current

Show plan, seats, and current billing period.

Terminal window
fyrn billing status
FlagDescription
--annualSwitch to annual billing
Terminal window
fyrn billing upgrade pro
fyrn billing upgrade enterprise --annual

Open the Stripe billing portal.

Terminal window
fyrn billing portal

Usage metrics (messages, AI calls, etc.).

Terminal window
fyrn usage

Show plan limits.

Terminal window
fyrn plan

Running fyrn with no arguments starts a conversational assistant backed by Claude. It can execute any CLI command on your behalf with your permission and uses the same authentication context as the CLI.

Terminal window
fyrn

Requires ANTHROPIC_API_KEY. History persists in ~/.fyrn/history (max 500 lines).


The simplest CI setup is: generate an agent key, set FYRN_API_KEY, run CLI commands. No fyrn auth api-key step is needed — the env var is read directly.

.github/workflows/deploy.yml
name: Deploy flows
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '22'
- name: Deploy via fyrn CLI
env:
FYRN_API_KEY: ${{ secrets.FYRN_API_KEY }}
run: |
npx -y @fyrn/cli push
npx -y @fyrn/cli flow deploy my-flow
.gitlab-ci.yml
deploy_flows:
image: node:22
variables:
FYRN_API_KEY: $FYRN_API_KEY
script:
- npx -y @fyrn/cli push
- npx -y @fyrn/cli flow deploy my-flow
TierGood for
1 (Use)Read-only CI jobs (lint / validation)
2 (Build)Deploy pipelines that push & deploy flows
3 (Manage)Ops runbooks that pause/resume flows, retry messages

Create CI keys with --sandbox to block deploy_flow in the pipeline if you only want validation.


Terminal window
fyrn flow create "Sync orders from Shopify to my ERP system"
# Review the generated YAML, confirm
fyrn flow deploy <flow-id>
Terminal window
fyrn pull my-flow
# Edit flows/my-flow.yaml in your editor
fyrn diff my-flow # review changes
fyrn push my-flow # upload as draft
fyrn flow deploy <flow-id> # activate
Terminal window
fyrn flow test flows/my-flow.yaml --sample-data test-data.json
Terminal window
fyrn flow list # see all flows and status
fyrn flow show <flow-id> # flow details
fyrn logs tail <flow-id> # live log stream
fyrn logs search <flow-id> --status failed # find failures
fyrn logs replay <message-id> # replay a failed message
Terminal window
fyrn batch submit <flow-id> --file orders.csv --concurrency 10
fyrn batch show <job-id>
fyrn batch errors <job-id> # inspect failures
fyrn batch retry <job-id> # retry failed records