How it works
A complete walkthrough: design a flow, test it in the browser, download a Go project, run it (interactively or headless), and ship a distributable CLI. For field-by-field detail, see the Block reference and Templates & expressions.
1. Build a flow
- Interactive —
text_input,select,multi_select,confirm,passwordgather input. - Action —
http_request,set_variable,conditioncompute and branch. - Output —
output_text,output_table,output_jsonprint results.
condition routes to the branch target you set in its config; once you branch, execution stops there unless that step branches again.2. Test in the browser
HTTP blocks call real APIs via fetch(), so APIs that send no CORS headers cannot be reached from the browser. The compiled Go binary has no such limitation. When a request is blocked, the terminal tells you.
3. Download the Go project
my-flow/ ├── main.go // embeds workflow.json ├── internal/ // the runtime (executor, template, blocks, UI) ├── workflow.json ├── go.mod / go.sum ├── Makefile ├── .goreleaser.yml └── .github/workflows/release.yml
4. Run
unzip my-flow.zip && cd my-flow make build ./my-flow # interactive (TTY)
Flags
| -i, --input id=value | Pre-fill a prompt (repeatable). Lets you run headless. |
| --dump-steps path | Write the final context.steps as JSON — handy for debugging. |
| -v, --version | Print name and version. |
| -h, --help | Show usage. |
Headless / CI — supply every prompt via --input:
./my-flow --input user=ada --input env=prod
Input value formats
text_input/password— the literal string.confirm—true,1,y, oryes(case-insensitive) for true; anything else is false.multi_select— comma-separated values, e.g.--input addons=auth,logs.
Secrets: prefer an env var over --input
--input values are visible in ps and shell history. For a password step, export CLIFLOW_INPUT_<step_id> instead. It answers the prompt and is never echoed. Precedence: --input > CLIFLOW_INPUT_*> interactive prompt. An empty env var supplies an empty value (the prompt is skipped). The <step_id> suffix must match the id exactly, including case.
export CLIFLOW_INPUT_api_key=sk_... ./my-flow # the api_key step is answered from the env
Private / internal APIs
The binary blocks requests to loopback, private, and link-local addresses (an SSRF guard). To call an internal host, set CLIFLOW_ALLOW_PRIVATE_HTTP=1.
5. Distribute
git tag v1.0.0 git push --tagsThe included GitHub Action builds all 6 targets (macOS/Linux/Windows × amd64/arm64) and publishes a Release. For Homebrew, point a tap formula at the Release archives.
6. Reference
- Block reference — required config and output shape for all 11 blocks.
- Templates & expressions — syntax, the context, path navigation, and the condition grammar.