PromptFloe CLI
promptfloe brings the verified-generation agent to your terminal: a local coding agent that reads and edits your repo under a strict permission gate, plus a control-plane client for your cloud apps, durable schedules, and multi-agent workflows.
$ npm i -g @promptfloe/cli+ @promptfloe/cli@0.1.4$ promptfloe --version0.1.4$ promptfloe agent "where is rate limiting handled?"· Grep "rateLimit" → 3 matches· Read src/middleware/rateLimit.tsA sliding-window limiter lives in src/middleware/rateLimit.ts,applied to /api/* at src/server.ts:42.Plan mode - read-only, no files changed.$ promptfloe chatPromptFloe chat - type a prompt, or /help for commands.sonnet · 0 turns · 0 tok› /helpCommands:/model /output-style /loop /cost /review /commit /clear /exitsonnet · 0 turns · 0 tok› ▋
promptfloe CLI: an in-repo agent (plan mode is read-only) and an interactive chat with a live statusline.#Install
@promptfloe/cli is published on the public npm registry. Requires Node.js 20+. The binary is promptfloe (pure ESM).
Global install
npm i -g @promptfloe/cli
# or: pnpm add -g @promptfloe/cli
promptfloe --versionBuild from source (contributors)
git clone <repo> promptfloe-cli && cd promptfloe-cli
pnpm install
pnpm build
# expose the built binary globally as `promptfloe`
cd packages/cli && npm link # or: pnpm link --global
promptfloe --version
promptfloe --helpPrefer not to link? Run the built entry directly: node packages/cli/dist/index.js --help.
#Sign in
Setup is one command - promptfloe login. Your PromptFloe account is the only credential you manage; cloud commands run on our infrastructure and code intelligence needs nothing at all.
Sign in with your PromptFloe account
login uses the OAuth 2.0 device flow (RFC 8628) - no password or provider key is typed into the terminal:
promptfloe login
# → Open https://promptfloe.com/device and enter code: WXYZ-1234
# → Waiting for approval…The token is written to your OS keychain (Windows Credential Manager, macOS Keychain, or libsecret on Linux), falling back to a 0600 file at ~/.promptfloe/credentials.json. Check state with promptfloe whoami; sign out with promptfloe logout.
Advanced - bring your own model key (temporary)
While brokered local inference is being finished, the in-repo agent needs a provider key. This is an advanced / self-hosted path, not the long-term setup:
export ANTHROPIC_API_KEY=sk-ant-... # claude models (default)
# export OPENAI_API_KEY=sk-... # for --model gpt-*
# export GEMINI_API_KEY=... # for --model gemini-*#The local coding agent
agent works a change in the current repo. It runs in one of three autonomy modes - the safest, plan (read-only), is the default. Every file path it touches is resolved and asserted inside your repo root before any read or write.
| Field | Type | Description |
|---|---|---|
| plan | default | Read-only. The agent proposes; it never writes or runs shell. |
| --write | confirm | Each write / shell command is surfaced for your approval. |
| --auto | unattended | Writes apply without prompting. Scope with --allow-tools <csv>. |
| --dry-run | propose | Emit proposed edits for review without applying (implies auto). |
# Plan a change (read-only, safe)
promptfloe agent "add rate limiting to the /login route"
# Confirm each edit
promptfloe agent "extract the auth guard into a hook" --write
# Unattended, but only the Edit + Write tools are cleared
promptfloe agent "rename getUser to fetchUser everywhere" --auto --allow-tools Edit,Write
# Edit, then run the repo's verify and loop until green (max 5 attempts)
promptfloe agent "fix the failing billing tests" --auto --verify --max-iterations 5
# Pick a model / add a cross-provider fallback for pre-stream failures
promptfloe agent "refactor the parser" --model sonnet --fallback-model gpt-4o
# Headless (print mode) - for scripts / CI
promptfloe agent "summarize what changed in src/" -p --output-format json#Interactive chat (REPL)
promptfloe chat starts a multi-turn REPL. Prose lines are agent turns (read-only by default); lines starting with / are slash commands. A statusline shows model · turns · tokens above each prompt (hide it with PROMPTFLOE_STATUSLINE=0).
Built-in slash commands
| Field | Type | Description |
|---|---|---|
| /help | /? | List all available commands. |
| /model | [name] | Show or switch the active model. |
| /output-style | /style | Response voice: concise · explanatory · code-only · default. |
| /loop | [N] <prompt> | Re-run a prompt as N back-to-back turns (Ctrl-C stops early). |
| /cost | Token usage accumulated this session. | |
| /context | Model, cwd, loaded rules/skills, subagents, MCP counts. | |
| /review | AI-review your uncommitted git diff. | |
| /commit | Draft a Conventional Commits message for staged changes and commit. | |
| /clear | Start a fresh conversation. | |
| /exit | /q | Leave the REPL. |
You can add your own: drop a markdown file at .promptfloe/commands/<name>.md (its body is a prompt template with $ARGUMENTS / $1…$9), or ship a plugin under .promptfloe/plugins/<name>/ for namespaced <name>:<cmd> commands and lifecycle hooks.
#Cloud apps
Generate and manage full apps on PromptFloe's infrastructure from the terminal - the same control plane the web studio uses:
promptfloe build "a CRM pricing page, three tiers, dark violet theme"
promptfloe apps # list your generated cloud apps
promptfloe pull <appId> --dir ./crm # download the files locally
promptfloe iterate <appId> "add an annual toggle" --tier pro --pull
promptfloe logs <appId> # latest-deployment logs
promptfloe ship --target vercel --dir ./crm --name my-crm
promptfloe down <appId> # take a deployment offline#Durable schedules (cron)
schedule registers a cloud routine that runs a prompt on a cron cadence on our infrastructure - it survives your machine being off, with run history and server-side scheduling. It's built on the same durable job engine (BullMQ + Postgres) as the studio's Loops.
promptfloe schedule create "@daily" "generate a fresh sales dashboard from yesterday's data"
promptfloe schedule create "0 9 * * 1" "summarize open issues" --llm --tier pro
promptfloe schedule list
promptfloe schedule rm <id>
# --local instead PRINTS an OS-cron line for you to install (never touches the network)
promptfloe schedule create "@daily" "nightly cleanup" --local#Multi-agent workflows
workflow runs a JavaScript script that orchestrates many agent turns deterministically. The structure - what fans out, what verifies, what loops - is ordinary JS, so runs are reproducible and each step is independently checkable. Each ctx.agent(prompt) is one headless turn.
promptfloe workflow list
promptfloe workflow run review --args '{"target":"src/"}'
promptfloe workflow run ./scripts/migrate.mjsAuthor one at .promptfloe/workflows/<name>.mjs exporting run(ctx):
export async function run(ctx) {
const dims = ["correctness bugs", "security issues", "performance"];
// Each dimension reviews, then its findings verify - no barrier between them.
const findings = await ctx.pipeline(
dims,
(dim) => ctx.agent(`Review ${ctx.args?.target ?? "src/"} for ${dim}. ` +
`Return JSON {"findings":[{"title":"..."}]}`, { schema: {} }),
async (review) => ctx.parallel(
(review?.findings ?? []).map((f) => async () => {
const v = await ctx.agent(`Is "${f.title}" a real issue? JSON {"real":true|false}`, { schema: {} });
return v?.real ? f : null;
}),
),
);
return { confirmed: findings.flat().filter(Boolean) };
}The runtime gives your script agent() (one turn → text, or JSON with schema), parallel(thunks) (concurrent barrier), pipeline(items, ...stages) (each item through every stage, no barrier), log(), and args. Fan-out is bounded by a concurrency cap.
#Code intelligence
The CLI keeps a fast, tree-sitter structural index of your repo so the agent - and you - can resolve symbols instantly. It's cached to disk and rebuilt incrementally (only changed files reparse).
promptfloe index # build/refresh .promptfloe/index/index.json
promptfloe index --rebuild # force a full rebuild
promptfloe symbols "handleAuth" # fuzzy, ranked symbol search
promptfloe outline src/app.ts # a file's ordered symbol tree#Configuration & environment
The CLI reads configuration from environment variables. The most common:
| Field | Type | Description |
|---|---|---|
| PROMPTFLOE_MODEL | string | Default model alias for agent + chat (chat default: sonnet). |
| ANTHROPIC_API_KEY | advanced | Temporary BYO-key path for the local agent until brokered inference ships. Or OPENAI_API_KEY / GEMINI_API_KEY. |
| PROMPTFLOE_API_URL | url | Control-plane base URL. Default https://api.promptfloe.com. |
| PROMPTFLOE_ENGINE | sdk? | Set to "sdk" to use the Claude Agent SDK engine; unset = native engine (default). |
| PROMPTFLOE_CONTEXT_BUDGET | int | Token budget that triggers pre-flight context compaction. |
| PROMPTFLOE_CLOUD_SESSIONS | bool | When truthy + logged in, sync sessions to the cloud so they resume across machines. |
| PROMPTFLOE_STATUSLINE | bool | Set 0/false/off to hide the REPL statusline. |
| NO_COLOR | flag | Standard no-color convention (also --no-color). |
| PROMPTFLOE_VPC | flag | Enable fail-closed VPC egress mode with an allowlist + pre-redaction. |
Global flags work on any command: --json (machine-readable output), --quiet, --no-color, --version. On-disk state lives under ~/.promptfloe/ (credentials, config) and .promptfloe/ in each repo (sessions, structural index) - both gitignored.
#Safety & guardrails
The agent is built to be trusted with your repo. The guardrails below are enforced by the native engine (the default):
- Path jail. Every file the agent reads or writes is resolved (symlinks included) and asserted inside your repo root before the filesystem is touched - no
../escapes, no absolute-path smuggling. - Permission gate. One policy decides every tool call: reads are always allowed; writes and shell are denied in plan, prompted in confirm, and in auto allowed only if on your
--allow-toolslist. - Secret protection. Sensitive paths (
.env,.ssh,.aws,*.pem,.git-credentials…) are refused for read and write in every mode. Outbound model traffic is scrubbed for API-key / token / JWT / connection-string shapes before it leaves your machine. - Shell denylist. The Bash tool refuses catastrophic commands (
rm -rf //~/$HOME, force-push, fork bombs,curl … | sh) and kills the whole process tree on timeout. - Undo & checkpoints. Write-runs are checkpointed;
promptfloe checkpointslists them andpromptfloe undoreverts a run's changes.
#Build & test from source
The CLI is a pnpm + Turborepo monorepo. To run it from a clone:
git clone <repo> promptfloe-cli && cd promptfloe-cli
pnpm install
pnpm build # topological: lexicon, kavach, … then cli
pnpm typecheck
pnpm test # vitest unit tests (co-located *.test.ts)
# run the built binary
node packages/cli/dist/index.js --help
node packages/cli/dist/index.js agent "explain src/index.ts" -pEnd-to-end tests run against the built binary in an isolated home directory (so they never touch your real ~/.promptfloe):
pnpm build && pnpm --filter @promptfloe/cli test:e2e#Frequently asked questions
Is the PromptFloe CLI published on npm?
Yes. @promptfloe/cli is published on the public npm registry (registry.npmjs.org/@promptfloe/cli). Install it globally with npm i -g @promptfloe/cli - no build-from-source step required.
How do I install the PromptFloe CLI?
Run npm i -g @promptfloe/cli (or pnpm add -g @promptfloe/cli) with Node.js 20 or newer, then sign in with promptfloe login using your PromptFloe account.
What does the PromptFloe CLI do?
It brings the PromptFloe agent to your terminal: a local coding agent (promptfloe agent, promptfloe chat) that reads and edits your repo under a permission gate, plus cloud commands (build, apps, schedule, workflow) that run full-stack app generation, durable cron schedules, and multi-agent workflows on PromptFloe’s infrastructure.
Is the PromptFloe CLI free to use?
The CLI itself is free to install. Cloud commands (build, apps, schedule) are metered to your PromptFloe plan; the local agent works with your own model key today while PromptFloe-brokered local inference is in progress.
#Where to go next
The studio side of schedules - chain steps into self-running routines.
Use PromptFloe as a tool inside Claude Desktop, Claude Code, or any MCP client.
The full slash + augmenter surface in the studio.
Prompt → live app in the browser in 5 minutes.