CLI
The Flowda CLI is the command-line client for the /v1 developer API. Each command maps to one API operation, and the CLI covers all 20 developer-API operations: the capability calls behind Scrape, Templates, Search, and Map, the ten Watch job operations, the three public dictionaries, and the account self-check. It is built for terminals, scripts, CI, and AI agents that can run shell commands.
The CLI is deterministic. It sends the request you describe and reports the outcome. It does not plan, it does not retry a billed call, and it does not change your request silently.
What the CLI gives you
| Property | What it means in practice |
|---|---|
| One command per operation | Every /v1 operation has a command, and every command calls one operation. You can use the CLI to script exactly what the HTTP API documents. |
| Single static binary | It is compiled from Go 1.26 with CGO_ENABLED=0. The installed machine needs no Go, Node, or other runtime. The npm channel is the exception, because npm itself needs Node.js. |
| Pipe-safe output | stdout carries data only: page content, URL lists, JSON. Prompts, warnings, and the call summary go to stderr, so --json output can go straight into jq or a file. |
| Diagnosable failures | Failures from the API carry a request_id, and platform-side failures also carry upstream_request_id. Exit codes are stable, so scripts branch on the code rather than matching error text. |
| Billing safety | Billed calls are never retried automatically, because the contract has no idempotency key. Only zero-cost GET requests may be retried once, and only on a transport error. |
| No telemetry, no self-update | The binary sends no usage data and does not update itself. Upgrade with npm install -g flowda-cli@latest. |
| Embedded contract | The developer OpenAPI contract ships inside the binary, so flowda version reports both the CLI version and the contract version it was built against. |
Install
The CLI is published to npm and runs on Windows, macOS, and Linux. Install it globally with npm, or run it without installing through npx.
| Channel | Command | Requires | Use it when |
|---|---|---|---|
| npm | npm install -g flowda-cli@latest | Node.js 16 or newer | You use the CLI regularly. One package contains the binaries for all five supported platforms, and nothing is downloaded at install time. |
| npx | npx -y flowda-cli@latest version | Node.js 16 or newer | You want to try the CLI without installing it. |
Node.js is the only prerequisite. The flowda binary inside the package is self-contained and needs no Go, Python, or other runtime.
Supported platforms
The package ships binaries for windows/amd64, darwin/amd64, darwin/arm64, linux/amd64, and linux/arm64. windows/arm64 and musl/Alpine are not supported; the launcher exits with an explicit error instead of running the wrong binary.
Verify the install
flowda version --json
flowda doctor
version --json returns version, commit, build_date, go_version, spec_version, and spec_digest. doctor checks the API URL, whether the developer surface is enabled, the credential, and the scopes you name; any failing check exits non-zero. Before you log in, auth FAIL and exit code 1 are expected. surface OK means the network path works.
flowda doctor --need extract,search,map,watch
Upgrade and uninstall
The CLI does not update itself. Upgrade it with npm; your configuration, profiles, and cached template schemas are left in place.
npm install -g flowda-cli@latest
Uninstall it with npm. The binary is removed and your user configuration is kept.
npm uninstall -g flowda-cli
The configuration directory holds the API key and profiles. Delete it only when you also want the stored credentials gone: %APPDATA%\flowda on Windows, ~/Library/Application Support/flowda on macOS, and $XDG_CONFIG_HOME/flowda (default ~/.config/flowda) on Linux.
Authenticate
Create an API key in the Flowda console. A key has the shape flw_<env>_<key_id>_<secret> and carries per-capability scopes. The CLI saves a key to the active profile and validates it against GET /v1/account. It never creates or revokes keys; that happens only in the console.
flowda login # prompts for the key, without echoing it
flowda login --api-key flw_live_... # pass the key directly
echo "$FLOWDA_API_KEY" | flowda login --stdin
On success, login prints the authentication method, user ID, key ID, scopes, and daily quota. --no-save validates the key without writing it to the configuration.
Configuration file locations
| OS | Path |
|---|---|
| Windows | %APPDATA%\flowda\config.json |
| macOS | ~/Library/Application Support/flowda/config.json |
| Linux | $XDG_CONFIG_HOME/flowda/config.json, which defaults to ~/.config/flowda/config.json |
Directories are created with mode 0700 and the file with 0600, and writes are atomic. A corrupt file is treated as no configuration and reported on stderr; run flowda login again to overwrite it.
Profiles and precedence
Credentials resolve in this order: flag, environment variable, configuration file for the active profile, default. Use profiles to separate environments or keys.
flowda login --profile staging
flowda --profile staging status
flowda config use-profile staging
| Item | Flag | Environment variable | Configuration file |
|---|---|---|---|
| API key | -k, --api-key | FLOWDA_API_KEY | profile.api_key |
| Developer API URL | --api-url | FLOWDA_API_URL | profile.api_url |
| Profile | --profile | FLOWDA_PROFILE | default_profile |
| Client timeout | --http-timeout | FLOWDA_HTTP_TIMEOUT | profile.http_timeout |
| Color | --no-color | NO_COLOR, FLOWDA_NO_COLOR | none |
| Debug log | --verbose | FLOWDA_DEBUG=1 | none |
The default API URL is https://openapi.flowda.ai. Point --api-url or FLOWDA_API_URL at another deployment when you use a staging environment.
Quick start
Create the key first, then run the commands below.
- Log in and check the accountflowda loginflowda statusflowda whoami --json
- Run a capabilityflowda extract https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Cachingflowda extract https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Caching -f markdown,links --json -o page.jsonflowda search "espresso machine" --max-results 5flowda map https://www.example.com --limit 100 | head -20flowda templatesflowda templates get amazon_productflowda template amazon_product --param asin=B0CHHSFMRL
- Monitor a pageflowda watch create https://example.com/pricing \--every 1h --selector "main .price" --diff-mode text \--webhook-url https://api.mycorp.com/hooks/flowdaflowda watch list --status activeflowda watch run job_01J8Z...flowda watch checks job_01J8Z... --limit 5flowda watch check job_01J8Z... chk_01J8Z...flowda watch pause job_01J8Z...flowda watch resume job_01J8Z...flowda watch delete job_01J8Z... --yes
flowda templatefetches the template'sparams_schemafrom the freeGET /v1/templates/{id}endpoint and validates your parameters locally before sending the billed request. The schema is cached for 24 hours;--refresh-schemafetches it again. Invalid parameters exit 2 without an execution request.- A search that returns no results is a success, with exit code 0.
- In human mode,
flowda mapprints one URL per line, so it composes withhead,sort, andwc -l. - Template execution requires the
extractscope, because the upstream platform authorizes templates through that scope.
Commands, endpoints, and credits
| Command | Endpoint | Credits |
|---|---|---|
flowda extract <url> | POST /v1/extract | 1 on a cache hit, 3, or 5 |
flowda search <query> | POST /v1/search | Billed per result; fractional values are possible |
flowda map <url> | POST /v1/map | Integer; credits_used is absent when the call was not billed |
flowda template <template_id> | POST /v1/template | 5; 0 on failure; a successful call with an empty result still costs 5 |
flowda templates, flowda templates get <template_id> | GET /v1/templates, GET /v1/templates/{template_id} | 0 |
flowda watch <subcommand> | /v1/watch/jobs... | Manual check 1, 3, or 5 (0 on failure); the other subcommands are estimated at one unit of the server-side soft quota |
flowda whoami, flowda status, flowda doctor | GET /v1/account | 0 |
flowda regions, flowda countries, flowda languages | GET /v1/regions, GET /v1/search/countries, GET /v1/search/languages | 0, public |
flowda openapi | GET /v1/openapi.yaml, GET /v1/openapi.json | 0, public |
flowda docs | No request; prints or opens <api-url>/v1/docs | 0 |
Commands
Every capability has one command, and the full flag reference is linked from each section.
Extract a page
flowda extract <url> fetches one page and returns it as markdown, raw HTML, clean HTML, or its links. The options control what content is kept, how fresh the cached snapshot must be, and which egress region the request uses.
flowda extract https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Caching
flowda extract https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Caching -f markdown,links --json -o page.json
flowda extract https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Caching -f links | head -20
flowda extract https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Caching --header "Accept-Language: en-US" --country JP
Parameters
| Flag | Default | Meaning |
|---|---|---|
<url> / --url | required | Absolute http(s) page URL. Give it as the positional argument or with --url, not both. |
-f, --format | markdown | Output format: markdown, raw_html, clean_html, or links. Repeat the flag or separate values with commas. |
--only-main-content | true | Keep the main content and drop navigation and footers. Write --only-main-content=false to include them. |
--include-tag | unset | Keep only nodes that match these CSS selectors. Repeatable. |
--exclude-tag | unset | Remove nodes that match these CSS selectors. Repeatable; removing all content returns 16002. |
--max-age | 48h | Maximum age of a cached snapshot, at most 48 hours. 0 forces a fresh fetch. |
--wait-for | 0s | Extra wait after page load: at most 30s, and at most half of --timeout. |
--timeout | 60s | Per-fetch budget, from 1s to 120s. The client HTTP budget is the global --http-timeout. |
--header | unset | k:v request header forwarded to the target site. Repeatable. A custom header bypasses the cache and marks the URL for 48 hours. |
--country | US | Two-letter uppercase egress region from flowda regions. |
--advanced-mode | true | Let the fetch service escalate its engine when page signals call for it. Keep the default when the page needs rendering. |
Endpoint POST /v1/extract, scope extract. Credits 1 on a cache hit, 3, or 5. Full flags: extract reference.
Search the web
flowda search <query> searches web, news, shopping, or scholar sources and returns ranked results. --extract-content also extracts the content of every result in the same call.
flowda search "espresso machine" --max-results 5
flowda search "AI news" --source news --time-range week --country US --language en
flowda search "docs" --extract-content -f markdown --json -o results.json
flowda countries
flowda languages
Parameters
| Flag | Default | Meaning |
|---|---|---|
<query> / --query | required | Search query, 1–256 characters. Give it as the positional argument or with --query, not both. |
--max-results | 10 | Result limit from 1 to 100. This is an upper bound, not an exact count. |
--source | web | web, news, shopping, or scholar. |
--country | unset | Two-letter uppercase ISO code from flowda countries. Not available with --source scholar. |
--language | unset | Result language from flowda languages; case-sensitive. |
--time-range | unset | hour, day, week, month, or year. Not available with shopping or scholar. |
--extract-content | off | Also extract the content of every result. |
-f, --format | markdown | Extraction format: markdown, raw_html, clean_html, or links. Valid only with --extract-content. |
--only-main-content, --max-age, --include-tag, --exclude-tag, --wait-for, --timeout, --advanced-mode | as extract | Content and timing options for extraction, with the same defaults and limits as extract. Valid only with --extract-content; passing one without it is a local error, not a silent drop. |
Endpoint POST /v1/search, scope search. Credits billed per result; fractional values are possible. Full flags: search reference.
Map a site
flowda map <url> enumerates the reachable URLs of a site. Human mode prints one URL per line, so the output composes with head, sort, and wc -l.
flowda map https://www.example.com | head -50
flowda map https://www.example.com --limit 500 --domain-filter domain --sitemap only -o urls.txt
flowda map https://www.example.com --limit 1000 --json -o urls.json
Parameters
| Flag | Default | Meaning |
|---|---|---|
<url> / --url | required | Absolute http(s) site URL. Give it as the positional argument or with --url, not both. |
--limit | 5000 | Maximum number of URLs, from 1 to 100000. |
--domain-filter | all | domain keeps only same-site URLs; all includes external links. |
--sitemap | include | skip, include, or only. |
--country | US | Egress region from flowda regions. |
Endpoint POST /v1/map, scope map. Credits an integer; credits_used is absent when the call was not billed. Full flags: map reference.
Run a template
A template is a maintained extraction recipe for a supported site: flowda templates lists the catalogue and flowda template <template_id> runs one for 5 credits. The CLI validates your parameters against the template's schema before it sends the billed call.
flowda templates
flowda templates get amazon_product
flowda templates get amazon_product --schema
flowda template amazon_product --param asin=B0CHHSFMRL
flowda template walmart_search --params-file params.json
Before the execution request, the CLI fetches params_schema from the free GET /v1/templates/{template_id} endpoint and validates locally; invalid parameters exit 2 without sending a request. The schema is cached for 24 hours, and --refresh-schema fetches it again. On Windows, nested JSON on a PowerShell command line is easy to mangle: write the object to a file and use --params-file, or pipe it into --params -.
The --param asin= example uses a live Amazon product checked on 2026-11-16. An execution costs 5 credits even when the page or result is missing, so confirm the identifier is a current product before running it.
Parameters
| Flag | Default | Meaning |
|---|---|---|
<template_id> | required | Template ID such as amazon_product or walmart_search. |
--param | unset | One template parameter as k=v. Repeatable, and the value is typed from the template's params_schema. |
--params | unset | The whole params object as JSON. --params - reads it from stdin. Mutually exclusive with --param. |
--params-file | unset | Read the whole params object from a file. |
--refresh-schema | off | Ignore the schema cache and fetch params_schema again. |
--zipcode, --pages, --timeout | unset | Sugar for zipcode, pages, and timeout_ms. --timeout accepts a duration such as 60s. |
Endpoint POST /v1/template, scope extract. Credits 5; 0 on failure; a successful call with an empty result still costs 5. The catalogue and template details cost 0. Full flags: template reference and templates reference.
Monitor a page
A watch job fetches a page on a schedule and compares it with the previous snapshot. The CLI covers the whole lifecycle: create, list, get, update, run, checks, check, pause, resume, and delete.
flowda watch create https://example.com/pricing \
--every 1h --selector "main .price" --diff-mode text \
--webhook-url https://api.mycorp.com/hooks/flowda
flowda watch list --status active
flowda watch run job_01J8Z...
flowda watch checks job_01J8Z... --limit 5
flowda watch check job_01J8Z... chk_01J8Z...
flowda watch pause job_01J8Z...
flowda watch resume job_01J8Z...
flowda watch delete job_01J8Z... --yes
Subcommands
| Subcommand | Endpoint | What it does |
|---|---|---|
flowda watch create <url> | POST /v1/watch/jobs | Create a job with an interval or cron schedule. |
flowda watch list | GET /v1/watch/jobs | List jobs, optionally filtered by status or URL. |
flowda watch get <job_id> | GET /v1/watch/jobs/{id} | Show one job and its next run time. |
flowda watch update <job_id> | PATCH /v1/watch/jobs/{id} | Change the job; only the fields you name are sent. |
flowda watch delete <job_id> | DELETE /v1/watch/jobs/{id} | Delete the job with its check history and pending deliveries. |
flowda watch run <job_id> | POST /v1/watch/jobs/{id}/check | Run a synchronous manual check and print the diff. |
flowda watch checks <job_id> | GET /v1/watch/jobs/{id}/checks | List the check history. |
flowda watch check <job_id> <check_id> | GET /v1/watch/jobs/{id}/checks/{check_id} | Show one check, including the historical diff body. |
flowda watch pause <job_id> | POST /v1/watch/jobs/{id}/pause | Stop scheduling. Idempotent. |
flowda watch resume <job_id> | POST /v1/watch/jobs/{id}/resume | Resume scheduling and clear the errored state. Idempotent. |
Parameters
| Flag | Default | Meaning |
|---|---|---|
--every | unset | Check interval from 60s to 30d, for example 1h or 90m. Runs on the UTC timeline; --timezone does not affect it. Give exactly one of --every and --cron. |
--cron | unset | Standard five-field cron expression, interpreted in --timezone, including weekends. Give exactly one of --every and --cron. |
--timezone | UTC | IANA timezone for --cron. |
--selector / --selector-type | unset / css | Monitor only part of the page. Selector type is css or xpath. |
--diff-mode | unset (the service defaults to auto) | auto, text, or json; repeatable. auto cannot be combined with the others. |
--webhook-url | unset | Change callback URL: public HTTPS on port 80 or 443. Localhost and private networks are rejected at registration with 400/16006. |
--retention-days | 30 | Days to keep the check history, from 0 to 365. 0 keeps checks forever. |
--status | unset | watch list filter: active, paused, or errored, in lowercase. |
--limit | 50 | Page size for watch list and watch checks, from 1 to 200. |
--all | off | Follow next_cursor to the end. An empty page does not mean the list ended. |
watch runis a synchronous manual check that takes about 60 seconds. It costs 1, 3, or 5 credits, and 0 when it fails. It has no idempotency key, so after a timeout or a 504, list the checks withflowda watch checksbefore running it again.- Callbacks are HTTP webhooks delivered to your server, not a local listener. See Webhooks for signature verification and delivery retries. The CLI does not listen for callbacks; a
watch listencommand is planned. watch createreturns awebhook_secretthat starts withwhsec_only the first time a callback URL is registered to your account. Store it immediately; the CLI does not save it. Reusing a URL that was registered before never returns its secret again (even after the job was deleted),GETnever returns it, and there is no read-back or rotate endpoint — register a new callback URL and update the job to rotate. When no secret is returned,data.data.webhook_secret_noteexplains why.watch resumealso clears theerroredstatus and the consecutive-failure counter.- Job and check IDs are
job_orchk_followed by 22 base62 characters.
Endpoint /v1/watch/jobs for create, list, get, update, and delete, plus /v1/watch/jobs/{id}/check, /checks, /pause, and /resume, scope watch. Credits manual check 1, 3, or 5 (0 on failure); the other subcommands are estimated at one unit of the server-side soft quota. Full flags: watch reference.
Check the account
flowda whoami and flowda status read GET /v1/account and report your identity, scopes, and daily quota, while flowda doctor checks the network path, the developer surface, the credential, and the scopes you name. All three are free reads.
flowda status
flowda whoami --json
flowda doctor --need extract,search,map,watch
flowda status --json
Parameters
| Flag | Default | Meaning |
|---|---|---|
--need | unset | doctor only: comma-separated scopes that must be present, from extract, search, map, and watch. |
--json | off | Machine mode for whoami, status, and doctor: stdout carries JSON only. |
status shows the CLI version, where the credential came from, connectivity, the contract version, and the account's daily quota. whoami prints the identity, scopes, and daily_credit_quota. There is no usage or balance query in the CLI: GET /v1/account returns only the daily quota, and the per-call credit details are in the console. Before you log in, doctor reports auth FAIL and exits 1; that is expected.
Endpoint GET /v1/account, scope none (a valid credential is required). Credits 0. Full flags: whoami reference, status reference, doctor reference.
Look up dictionaries
The three public dictionaries name the values that the country and language flags accept, and they work without a login. They are not interchangeable: flowda regions is the egress-region list, while search uses flowda countries and flowda languages.
flowda regions
flowda countries
flowda languages
flowda regions --json
flowda countries --json
flowda languages --json
Parameters
| Target flag | Values from | Meaning |
|---|---|---|
--country on extract, map, and watch | flowda regions | Egress region, a two-letter uppercase code. |
--country on search | flowda countries | Search country, a two-letter uppercase code. |
--language on search | flowda languages | Result language, case-sensitive, for example en, zh-cn, or pt-br. |
Endpoint GET /v1/regions, GET /v1/search/countries, and GET /v1/search/languages, all public. Credits 0. Full flags: regions reference, countries reference, languages reference.
Configure the CLI
flowda config reads and writes the local configuration: the API URL, credentials, and the HTTP budget. Profiles separate environments or keys, and login --profile writes to the profile you name.
flowda config list
flowda config get api-url
flowda config path
flowda config set api-url https://openapi.flowda.ai
flowda config set http-timeout 120s
flowda config unset api-key
flowda login --profile staging
flowda --profile staging status
flowda config use-profile staging
The CLI never asks for a password: a profile stores the API key, or a session token, in the configuration file. Credentials resolve in the order flag, environment variable, configuration file for the active profile, default.
Parameters
| Command or key | Meaning |
|---|---|
flowda config list | List all profiles. |
flowda config get <key> | Read one value. Readable keys: api-url, api-key, token, http-timeout, profile, default-profile, and config-path. api-key and token print a masked value. |
flowda config set <key> <value> | Change a value. Writable keys: api-url, api-key, token, and http-timeout. |
flowda config unset <key> | Remove a value. Removable keys: api-url, api-key, token, and http-timeout. |
flowda config path | Print the path of the configuration file. |
flowda config use-profile <name> | Switch the default profile. |
Endpoint none; the commands read and write the local configuration file. Credits 0. Full flags: config reference.
Global options
These flags are available on every command. Per-command flags are in the CLI command reference.
| Option | Default or environment | Meaning |
|---|---|---|
-k, --api-key <key> | FLOWDA_API_KEY, or the profile | API key for this call. The value is never written to disk. |
--token <jwt> | FLOWDA_SESSION_TOKEN, or the profile | Session JWT sent as a Bearer token. Use an API key for scripts and agents. |
--api-url <url> | https://openapi.flowda.ai, FLOWDA_API_URL, or the profile | Developer API base URL. |
--profile <name> | FLOWDA_PROFILE, or default | Configuration profile. |
--http-timeout <dur> | The operation budget plus 30 seconds (never below 5 seconds), FLOWDA_HTTP_TIMEOUT, or the profile | Total client-side budget for one request. |
--json | off | Machine mode: stdout carries JSON only. |
--envelope | off | Print the full {code,message,request_id,data} envelope. Implies --json. |
--pretty | on in a terminal, off in a pipe | Indent JSON. |
-o, --output <path> | off | Write the result to a file instead of stdout. |
--quiet | off | Suppress prompts and the call summary. |
--verbose | FLOWDA_DEBUG=1 | Print request and response summaries to stderr, including request_id and duration. |
--no-color | NO_COLOR or FLOWDA_NO_COLOR | Disable ANSI color. |
--no-validate | off | Skip local request validation and send the request as given. |
-y, --yes | off | Skip the confirmation for a destructive operation. Required when not on a TTY. |
-h, --help | Print help. | |
-V, --version | Print the version. |
Output and piping
- stdout carries data only. Page content, URL lists, and JSON go to stdout. Prompts, warnings, and the
credits_usedandrequest_idsummary go to stderr, so parse stdout only. - A single artifact is written as raw text: one format of markdown or HTML,
linkswith one URL per line, andmapin human mode with one URL per line. - When you ask
extractfor more than one format, it prints JSON even without--json, because there is no single text representation. - Structured results are JSON. With
--json, the CLI prints the envelope'sdataobject unchanged: it is not flattened and its field names are not rewritten. With--envelope, it prints{code,message,request_id,data}. -o, --outputwrites the result to a file. Nothing is repeated on stdout;wrote <path>goes to stderr. A.jsonsuffix, or--json, writes JSON.--prettyaffects JSON only. In a terminal, JSON is indented by default; in a pipe, it is compact unless you pass--pretty.- Credit amounts are printed as reported. Search can report fractional credits; the CLI does not round them or convert them to money.
- HTTP 200 is not success. A capability call can return HTTP 200 with
code: 0anddata.success: false; the CLI treats that as a failure with exit code 10. See Response format. - Color is used only in a terminal, and only when you have not passed
--no-color.
With --json, a failure writes nothing to stdout. The machine-readable failure body is a single line on stderr:
{"ok":false,"exit_code":10,"error_type":"target_unreachable","platform_code":"TARGET_DNS_ERROR",
"request_id":"req_…","upstream_request_id":"core-…","hint":"…"}
Exit codes
| Exit code | Meaning | Typical error codes | What to do |
|---|---|---|---|
| 0 | Success, including an empty search or an empty template result | none | Continue. |
| 1 | Internal or unknown failure | 10000, 14000, a rendering error | Retry later; contact us if it persists. |
| 2 | Usage or local validation failure | an unknown flag, an out-of-range value, invalid template parameters | Fix the command. Local validation failures send no request. |
| 3 | No credential configured | 12001 | Run flowda login or set FLOWDA_API_KEY. |
| 4 | Invalid or expired credential | 12002, 12014 | Check the key in the console, or save it again with flowda login. |
| 5 | Permission denied | 12003, 12015 | Add the scope named in data.required_scope. Templates need extract. |
| 6 | Rate limited | 13000, 16003 | Back off using Retry-After. The default limit is 5 requests per second per key. |
| 7 | Quota or credits exhausted | 13002, 16004 | Wait for the next UTC day, or ask for a higher quota. |
| 8 | Resource not found | 11004, including a disabled /v1 surface | Check the path. If every route returns 404, check --api-url and whether the surface is enabled. |
| 9 | Request rejected | 11000, 16002, 16006 | Fix the request as described in details. |
| 10 | Upstream or fetch failure | 16xxx codes not mapped to another exit code, or data.success: false | The fetch failed but was usually still billed. Check the outcome before retrying. |
| 11 | State conflict | 16008 | Adjust the job state, for example after a manual check while the job is paused. flowda watch get shows the state. |
| 12 | Local network error, timeout, or cancellation | none; outcome_unknown when the request may already have been sent | Verify whether the call ran before sending it again. |
Branch on the exit code in scripts instead of matching error text. The ranges are stable: 0 success, 1 internal or unknown, 2 usage and local validation, 3 to 5 authentication and authorization, 6 to 7 rate limits and quota, 8 to 9 target and request, 10 to 11 upstream and state, 12 network and timeout. The full error-code table is in Error codes.
Scripts and AI agents
Every command works without a TTY, so the same invocation runs in a shell, in CI, and inside an agent that can execute commands. Put the credential in the environment and let the exit code drive the control flow.
export FLOWDA_API_KEY=flw_live_...
export FLOWDA_API_URL=https://openapi.flowda.ai
flowda whoami --json
flowda extract https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Caching -f markdown -o caching.md
flowda search "wireless headphones" --source news --max-results 20 --json -o news.json
- Machine mode.
--jsonprints data on stdout. A failure prints a single-line JSON object on stderr withexit_code,error_type, andrequest_id. - Confirmation. Only destructive operations ask for confirmation, and without a TTY the CLI refuses to guess. Pass
-y, --yes, for exampleflowda watch delete job_... --yes. - Billing. Capability calls and Watch writes are never retried automatically, because the contract has no idempotency key. If a call times out or you cancel it, do not send it again blindly. Check the outcome first:
flowda watch checksfor a manual check, the console call log for a capability call. Report therequest_id. - Local validation. The CLI checks URL schemes, enum values, numeric ranges, mutually exclusive flags,
--wait-foragainst--timeout, and template parameters before sending, so an obvious mistake does not spend credits.--no-validateturns that off and sends the request as given. Local validation is not a substitute for server checks such as scopes. - Credential environment variables.
FLOWDA_API_KEYandFLOWDA_API_URLare enough for a fresh runner.--api-keyoverrides the environment for one call and is never written to disk. - Windows quoting. Nested JSON on a PowerShell command line is easy to mangle. Use
--params-fileor pipe the JSON into--params -. - Agent hints.
flowda --helpand the CLI command reference describe the command tree for an agent. Aflowda initcommand that installs the CLI usage as an Agent Skill is planned, not shipped.
Troubleshooting
Run flowda doctor first: it separates a network problem from a credential problem. Then check this table.
| Symptom | Cause and fix |
|---|---|
flowda is not recognized after npm install -g | npm's global bin directory is not on PATH. Run npm prefix -g and add its bin directory (on Windows, the prefix itself) to PATH, then open a new terminal. |
| npm reports that the platform is not supported | The package has no binary for windows/arm64 or musl/Alpine. Use a supported platform. |
401 with 12014, exit code 4 | The key is invalid, revoked, or expired. Check it in the console, or save it again with flowda login. |
403 with 12015, exit code 5 | The key lacks a scope. data.required_scope names the missing scope. Templates need extract. |
429 with 13000, exit code 6 | Rate limited. Back off using Retry-After; the default limit is 5 requests per second per key. |
402 with 13002, exit code 7 | The daily quota is used up. It resets on the next UTC day, or ask us for a higher quota. |
404 with 11004, exit code 8 | The target does not exist, or the /v1 surface is not enabled. Check --api-url. |
| The fetch failed but HTTP was 200 | Look at the code inside data.success: false, for example TARGET_DNS_ERROR. The call was usually still billed. |
| The client times out, exit code 12 | Fetch budgets reach 130 seconds on the server, and the CLI adds 30 seconds. Raise the read timeout on an enterprise proxy or nginx. |
16009 | A platform credential on our side is broken. Retrying does not help. Contact us. |
flowda doctor reports surface FAIL | The /v1 developer surface is not enabled, or --api-url is wrong. A 404 with 11004 on every route confirms it. |
flowda doctor reports auth FAIL before login | Expected before you log in. Run flowda login or set FLOWDA_API_KEY, then run it again. |
config.json is corrupt | The CLI treats it as no configuration and says so on stderr. Run flowda login to overwrite it. |
| A proxy or TLS inspection breaks requests | Set HTTPS_PROXY. A proxy that terminates TLS needs its root certificate installed. The CLI has no --insecure bypass. |
| Tables or non-ASCII text are garbled in a terminal | Use UTF-8 in Windows Terminal, for example with chcp 65001. --no-color also removes ANSI codes. |
Next steps
Every command and flag, with its /v1 endpoint and credit cost.
The raw HTTP contract the CLI calls.
Run the same operations from an MCP client without installing anything.
Teach a coding agent when and how to call the tools.
The full error-code table behind the exit codes.
Verify and handle Watch change events.