CLI
The saasflow command-line client — OAuth or API key, profiles, JSON or table output.
saasflow is the official command-line client for the SaaSFlow public API. Same auth
modes as the API, same endpoints, with a few extras (search, batched data slices, profile
management).
Install
npm install -g saasflow
# yarn:
yarn global add saasflowVerify:
saasflow --versionAuthenticate
The default saasflow login opens your browser, walks you through OAuth (PKCE) at
app.saasflow.com, then stores the issued token in ~/.saasflow/config.json.
saasflow loginAfter login, the CLI prompts you to pick a default company.
Non-interactive (API key)
saasflow login --api-key sf_...
# or read from stdin
echo "$SAASFLOW_KEY" | saasflow login --api-key -Use this in CI. Create the key at Settings → Company settings → API keys (details).
Logout
saasflow logoutWipes the active profile's credentials.
Profiles
Switch between accounts or environments without re-authenticating:
saasflow login --profile work
saasflow login --profile staging --base-url https://staging-api.saasflow.com
# Use them
saasflow --profile work customers list
saasflow --profile staging companiesThe default profile is named default.
Global options
| Flag | Purpose |
|---|---|
-p, --profile <name> | Profile to use. Default: default. |
--base-url <url> | Override the API base URL. |
--api-key <key> | One-off API key for this call (or - for stdin). |
--company <id> | Override the default company for this call. |
-f, --format <auto|json|table> | Output format. Default auto. |
--json | Shortcut for --format json. |
--table | Shortcut for --format table. |
--columns <list> | Comma-separated columns for table mode. |
Built-in commands
saasflow login # Browser OAuth or --api-key
saasflow logout # Clear credentials
saasflow whoami # Show current profile and active company
saasflow search <query> # Free-text search across customers/vendors/accounts/transactions
saasflow data <slice> # Run a data slice (MRR, cash flow, P&L, ...)
saasflow companies use [id] # Pick or change the default companyAuto-generated commands
The CLI generates one command per OpenAPI operation, so anything the
API exposes is reachable. The pattern is
saasflow <resource> <verb>:
saasflow companies list
saasflow companies get
saasflow customers list --limit 100
saasflow customers get --customer-id cust_...
saasflow accounts list
saasflow transactions list --account-id acc_... --limit 50
saasflow subscriptions events
saasflow products listFor the full list, run saasflow --help or saasflow <resource> --help.
Example
# Top 10 customers by MRR
saasflow data customerMrr --to today --json | jq '.[] | select(.mrr > 0)' | head -20
# Pipe an MRR snapshot into a CSV
saasflow data mrrData --from 2026-01-01 --to 2026-06-30 --json \
| jq -r '.[] | [.date, .mrr] | @csv'
# Search for a customer and inspect their subscriptions
CUST=$(saasflow search "acme corp" --json | jq -r '.customers[0].id')
saasflow subscriptions events --customer-id "$CUST"