Skip to main content

CLI commands

Install the CLI:

pip install 10xscale-agentflow-cli

Verify:

agentflow version

agentflow init

Scaffold a new project with agentflow.json and a starter graph module. By default the command is interactive: prompts choose the setup type (minimal Quick Start scaffold or the fuller Production scaffold), whether to wire auth, and whether to add a rate-limit block. Every answer also has a flag, so the same scaffold can be reproduced non-interactively in CI or by a coding agent.

agentflow init [OPTIONS]
OptionDefaultDescription
--path, -p.Directory to initialize files in
--force, -ffalseOverwrite existing files
--namepromptAgent name; required only when a default cannot be inferred
--templatepromptquick-start or production
--authpromptProduction authentication: none, jwt, or custom
--rate-limitpromptRate limiting: none, memory, or redis
--yes, -yfalseAccept the recommended defaults instead of prompting
--non-interactivefalseFail instead of prompting; for CI and coding agents
--dry-runfalsePreview the scaffold without writing files
--verbose, -vfalseEnable verbose logging
--quiet, -qfalseSuppress output except errors

Quick Start creates:

agentflow.json
.env.example
graph/
__init__.py
agent.py

Production creates:

agentflow.json
.env.example
.pre-commit-config.yaml
.python-version
pyproject.toml
graph/
__init__.py
agent.py
state.py
thread_name_generator.py
tools/
validators/
auth/ # only when the auth prompt answers "Custom"
agent_auth.py
evals/
weather_agents_eval.py
user_simulator_eval.py
tests/
conftest.py
test_agent_eval.py
test_catalog_tools.py
test_graph_nodes.py

The Production path also writes the answers to the auth and rate-limit prompts into the generated agentflow.json (auth, authorization, rate_limit, thread_name_generator, injectq).

Assistant skill files are not part of init; install them separately with agentflow skills.

Example:

# Initialize in the current directory
agentflow init

# Initialize in a specific folder
agentflow init --path ./my-agent

# Overwrite an existing project
agentflow init --force

# Reproducible, no prompts
agentflow init --path ./my-agent --name MyAgent --template quick-start --non-interactive

# Production scaffold with every answer supplied, previewed first
agentflow init --template production --auth jwt --rate-limit redis --yes --dry-run

agentflow dev

Start the local development server and open the hosted playground once the API is reachable. This is the goal-oriented command for day-to-day development; it runs the same server as agentflow api and takes the same options, plus --open/--no-open.

agentflow dev [OPTIONS]
OptionDefaultDescription
--config, -cagentflow.jsonPath to the project configuration file
--host, -H127.0.0.1Host interface for the local development server
--port, -p8000Port for the local development server
--reload/--no-reload--reloadReload the server when project files change
--open/--no-open--openOpen the hosted playground when the API is ready
--verbose, -vfalseEnable verbose logging
--quiet, -qfalseSuppress output except errors

Example:

# Defaults: 127.0.0.1:8000, reload on, playground opens
agentflow dev

# Custom host and port
agentflow dev --host 127.0.0.1 --port 9000

# API only, no playground and no file watching
agentflow dev --no-open --no-reload

# A different config file
agentflow dev --config production.json

agentflow api (server only) and agentflow play (server plus playground) remain available and behave exactly as before.


agentflow api

Start the FastAPI server that serves your compiled graph.

agentflow api [OPTIONS]
OptionDefaultDescription
--config, -cagentflow.jsonPath to config file
--host, -H127.0.0.1Bind host. The default is localhost only; pass 0.0.0.0 to bind all interfaces.
--port, -p8000Bind port
--reload/--no-reload--reloadEnable auto-reload on file changes
--verbose, -vfalseEnable verbose logging
--quiet, -qfalseSuppress output except errors

Example:

# Start with defaults (localhost only, port 8000)
agentflow api

# Bind all interfaces (containers, LAN access)
agentflow api --host 0.0.0.0 --port 8000

# Disable auto-reload for production
agentflow api --no-reload

# Use a different config file
agentflow api --config ./config/prod.json

agentflow play

Start the API server and open the hosted playground in a browser.

agentflow play [OPTIONS]

Accepts the same options as agentflow api, including the 127.0.0.1 default for --host. The --host and --port values are also used to build the backendUrl that is passed to the hosted playground.

Example:

agentflow play --host 127.0.0.1 --port 8000

The CLI prints the playground URL. If the browser does not open automatically, open the URL manually. The backendUrl query parameter tells the playground which local API to call.


agentflow build

Generate a Dockerfile (and optionally docker-compose.yml and k8s.yaml) for deployment.

agentflow build [OPTIONS]
OptionDefaultDescription
--output, -oDockerfileOutput Dockerfile path
--force, -ffalseOverwrite existing Dockerfile, docker-compose.yml, or k8s.yaml
--python-version3.13Python base image version
--port, -p8000Port to expose in the container
--docker-compose/--no-docker-compose--no-docker-composeAlso generate docker-compose.yml and omit CMD from the Dockerfile
--k8s/--no-k8s--no-k8sAlso generate k8s.yaml (a Deployment plus a Service)
--service-nameagentflow-cliService name used in docker-compose.yml and k8s.yaml
--verbose, -vfalseEnable verbose logging
--quiet, -qfalseSuppress output except errors

--k8s always writes to k8s.yaml in the current directory (the path is not configurable). The generated Deployment sets a terminationGracePeriodSeconds long enough that a rolling deploy does not SIGKILL an agent run mid-LLM-call, plus a preStop hook. Kubernetes' own 30-second default is too short for agent workloads, which is the reason to generate the manifest instead of hand-rolling one.

Example:

# Minimal Dockerfile
agentflow build

# Dockerfile + docker-compose.yml
agentflow build --docker-compose --service-name my-agent

# Dockerfile + Kubernetes manifest
agentflow build --k8s --service-name my-agent

# Custom Python version
agentflow build --python-version 3.12

agentflow skills

Install bundled AgentFlow skills into project-local assistant skill directories.

agentflow skills [OPTIONS]

When --agent is omitted in an interactive terminal, the command shows a checklist — space toggles, enter confirms — instead of asking for a menu number:

Which agents should get the Agentflow skill?
◯ Codex .agents/skills/agentflow
◯ Claude .claude/skills/agentflow
◯ GitHub .github/instructions/agentflow.instructions.md

Each row shows where it installs. Agents that are already set up are labelled and pre-checked, and choosing one that exists offers to overwrite rather than failing. In a terminal that cannot host a prompt, the command asks for --agent or --all instead of raising.

OptionDefaultDescription
--agent, -apromptTarget agent: codex, claude, github, or menu number 1, 2, 3
--path, -p.Project directory where the skills should be installed
--force, -ffalseOverwrite the existing installed AgentFlow skill directory
--allfalseInstall skills for every supported agent
--list, -lfalseList supported agents and exit
--verbose, -vfalseEnable verbose logging
--quiet, -qfalseSuppress output except errors

Install locations:

AgentInstalled files
Codex.agents/skills/agentflow/
Claude.claude/skills/agentflow/
GitHub.github/instructions/agentflow.instructions.md and .github/skills/agentflow/

Example:

# Prompt for target agent
agentflow skills

# Install for Codex
agentflow skills --agent codex

# Install for Claude in another project directory
agentflow skills --agent claude --path ./my-agent

# Install for every supported assistant
agentflow skills --all

# List supported assistants
agentflow skills --list

# Overwrite an existing install
agentflow skills --agent github --force

agentflow test

Run the project's test suite with pytest.

agentflow test [PATH] [OPTIONS] [-- PYTEST_ARGS]
OptionDefaultDescription
PATHPath to a tests directory or file. When omitted, pytest auto-discovers tests across the whole project.
--coverage, -CfalseRun with coverage (--cov=. --cov-report=term-missing --cov-report=html:htmlcov)
--htmlfalseOpen the HTML coverage report in a browser after the run (requires --coverage)
-k EXPROnly run tests whose name matches the given expression (forwarded to pytest)
--verbose, -vfalseEnable verbose output
--quiet, -qfalseSuppress output except errors

Any arguments after -- are forwarded verbatim to pytest.

When PATH is omitted, no path argument is passed to pytest and pytest's own discovery rules apply (it searches testpaths from pytest.ini/pyproject.toml, or the current directory if none are configured). Supplying PATH restricts the run to that directory or file only.

The command also reads the optional test section from agentflow.json for project-level defaults. CLI flags take precedence over config file values. If path is set in agentflow.json, it is used only when no PATH argument is given on the CLI.

Example:

# Run tests/ with verbose output (default)
agentflow test

# Run with coverage
agentflow test --coverage

# Run with coverage and open the HTML report
agentflow test --coverage --html

# Target a specific path
agentflow test tests/unit

# Run only tests matching a keyword
agentflow test -k "weather"

# Pass raw pytest arguments after --
agentflow test -- --no-header -q --tb=short

# Combine: coverage + keyword filter + extra args
agentflow test --coverage -k "agent" -- --tb=long

agentflow eval

Run agent evaluations from an evals/ directory (or a specific file/folder). Always generates HTML and JSON reports unless --no-report is set.

agentflow eval [TARGET] [OPTIONS]
OptionDefaultDescription
TARGETevals/File or directory to evaluate. When omitted, uses evaluation.directory from agentflow.json, or evals/ if not set.
--output, -oeval_reportsDirectory for generated report files
--no-reportfalseSkip file report generation (console summary only)
--threshold, -tFail if overall pass rate is below this value (0.0–1.0)
--openfalseOpen the HTML report in the default browser after the run
--parallel, -pfalseCollect every case from every file into one flat pool and run them concurrently
--max-concurrency, -c4Maximum cases running at once when --parallel is set (a single global semaphore)
--verbose, -vfalseEnable verbose output
--quiet, -qfalseSuppress output except errors

Each eval file must expose one of the following entry points. They are checked in this order, and the first match wins:

SymbolDescription
get_scenarios() or SCENARIOSSimulator protocol. Returns user-simulation scenarios; the CLI drives a simulated user against your agent. See user simulation.
get_eval_set()Standard protocol. Returns an EvalSet. The CLI loads the agent, applies the resolved criteria, runs the cases, and writes reports.
Pytest-style functionsAny public module-level function annotated -> EvalSet is collected as an eval. A function annotated -> EvalConfig supplies that file's config.

Config is resolved per file, highest priority first:

SourceNotes
get_eval_config() or EVAL_CONFIG in the fileOverrides everything for that file. Used alongside any of the entry points above.
confeval.py in the eval directoryShared config, applied to files with no per-file config. Must expose get_eval_config() or EVAL_CONFIG.
Built-in defaultsUsed when neither is present.

Files matching no protocol are skipped with a warning: Skipping <file> — no eval entry point found.

Reports generated per run (unless --no-report):

  • eval_reports/eval_<timestamp>.html — visual dashboard
  • eval_reports/eval_<timestamp>.json — machine-readable results

Example:

# Auto-discover evals/ and generate reports
agentflow eval

# Run a specific file
agentflow eval evals/weather_agents_eval.py

# Run all evals in a subdirectory
agentflow eval evals/regression/

# Custom output directory
agentflow eval --output reports/

# Fail if pass rate is below 80 %
agentflow eval --threshold 0.8

# Skip file output (console only)
agentflow eval --no-report

# Open the HTML report when done
agentflow eval --open

# Run every case concurrently, at most 8 at a time
agentflow eval --parallel --max-concurrency 8

agentflow version

Print the CLI and core framework versions. Both are resolved from installed distribution metadata.

agentflow version [--verbose] [--quiet]

Example output:

10xscale-agentflow-cli
Version: 0.5.0
10xscale-agentflow (core)
Version: 0.9.0

For a script-friendly single line, use the root flag instead:

agentflow --version    # prints just the CLI version

agentflow audit

Read-only check of everything that has to be true before dev, eval, or build can work in the current directory. Nothing is written or changed, so it is always safe to run.

agentflow audit [OPTIONS]
OptionDefaultDescription
--verbose, -vfalseEnable verbose logging
--quiet, -qfalseSuppress output except errors

Six checks run in a fixed order and are reported twice: live through the step timeline, and again as a summary table.

CheckWhat it asserts
PythonThe interpreter running the CLI (reported, never failed)
CLI package10xscale-agentflow-cli is installed and resolvable
Core framework10xscale-agentflow is installed and resolvable
Evaluation APIThe installed core still exposes the evaluation symbols agentflow eval imports, catching a CLI/core version skew before it becomes an ImportError mid-run
Project configurationagentflow.json exists here, parses, and declares an agent key in module:attribute form
PortThe default API port (8000) is free to bind

Each check reports PASS, WARN, or FAIL. The command exits 1 if any check fails and 0 otherwise — warnings (no project config, port already bound) are surfaced without failing the run, which makes it usable as a CI gate.

Example:

# Human-readable table
agentflow audit

# Machine-readable events, for CI
agentflow --format json audit

# Static output, no motion
agentflow --no-animation audit

agentflow config

Inspect and manage user-level CLI preferences. They are stored as JSON in the per-user config directory (platformdirs), for example ~/.config/agentflow/config.json on Linux, and apply to every project.

agentflow config path       # print the configuration file path
agentflow config list # list every stored preference
agentflow config get KEY # read one preference
agentflow config set KEY VALUE
agentflow config unset KEY # remove one preference
agentflow config validate # parse the file and check known keys

Keys are dot-separated. set parses VALUE as JSON and falls back to a plain string, so agentflow config set output.format plain and agentflow config set rate_limit.requests 100 both work.

These keys are read at startup as defaults for the root output flags:

KeyValuesDefault
output.formathuman, plain, json, jsonlhuman
output.colorauto, always, neverauto
output.progressauto, tty, plain, json, quietauto

Command-line flags always win over stored values. If the file is unreadable or a key holds an unsupported value, commands fail with a pointer to agentflow config validate (the config sub-commands themselves still run, so the bad value can be fixed).


agentflow demo

Preview the terminal animations, step timelines, and progress states without touching project state. Useful for checking how the CLI will render in a given terminal, or over SSH and in CI.

agentflow demo [--style STYLE]
OptionDefaultDescription
--styleallAnimation theme: all, typing, network, init, build, or eval (play and api are accepted as aliases for typing and network)

Example:

agentflow demo
agentflow demo --style eval

Global options

These are root options: they are passed before the command name and apply to every command.

OptionDefaultDescription
--formathumanOutput format: human, plain, json, or jsonl
--jsonfalseShorthand for --format json
--colorautoColor policy: auto, always, or never
--no-colorfalseShorthand for --color never
--progressautoProgress mode: auto, tty, plain, json, or quiet
--animation/--no-animationautoEnable or disable decorative command animation
--fullscreen/--no-fullscreenfull-screen on an interactive terminalRun on a dedicated full-screen surface with a pinned header and footer
--cwdcurrent directoryRun as if the CLI was started in this directory
--verbose, -v0Increase diagnostic verbosity; repeat for more detail
--quiet, -qfalseSuppress informational, progress, and success output
--debugfalseEnable debug diagnostics
--yes, -yfalseAccept recommended defaults for supported workflows
--non-interactivefalseNever prompt for input
--version, -VPrint the CLI version and exit
agentflow --format json audit
agentflow --no-fullscreen dev
agentflow --cwd ../my-agent eval --parallel

Defaults for --format, --color, and --progress come from agentflow config. Set AGENTFLOW_NO_FULLSCREEN=1 to opt out of the full-screen surface for every invocation. Motion is disabled automatically for redirected output, CI, TERM=dumb, JSON/JSONL output, and AGENTFLOW_NO_SPINNER=1.

All commands also accept --help (-h) for usage information:

agentflow --help
agentflow dev --help
agentflow init --help