This file documents the API server and CLI package only (10xscale-agentflow-cli). For the
core framework see agentflow/CLAUDE.md; for the TS client, docs, or playground see their folders;
for the monorepo overview see the workspace-root CLAUDE.md.
- Package name (PyPI):
10xscale-agentflow-cli - Version:
0.3.2.9(pyproject.toml).CLI_VERSIONandagentflow_cli.__version__are single-sourced from the installed distribution metadata (falling back topyproject.toml), soagentflow versionreports0.3.2.9consistently. The previous1.0.0hardcode is gone. - Requires: Python >= 3.12 · Status:
4 - Beta - Console entry point:
agentflow = agentflow_cli.cli.main:main - Depends on the core framework:
10xscale-agentflow>=0.7.0.
It turns an Agentflow CompiledGraph into a production FastAPI service, plus a Typer CLI to
scaffold, run, build, test, and evaluate that service. You write a graph, point agentflow.json
at it, and agentflow api serves it over REST + WebSocket with auth, rate limiting, media
handling, checkpointer/thread management, and a memory store API.
Importable package: agentflow_cli/. Two halves:
| Path | What lives there |
|---|---|
agentflow_cli/cli/ |
The Typer CLI. main.py (command definitions), commands/ (one class per command: api, build, eval, init, skills, test, version), core/ (config, output, validation), constants.py, templates/ (project scaffolds: dev/ minimal, prod/ full) |
agentflow_cli/src/app/ |
The FastAPI app. main.py + loader.py (build app from agentflow.json), routers/ (graph, checkpointer, store, media, ping; a2a/a2ui present but not mounted), core/auth/, core/config/, core/middleware/ (rate_limit, security_headers, request_limits), tasks/, utils/, worker.py |
Public exports from the package root (from agentflow_cli import ...): BaseAuth,
SnowFlakeIdGenerator, ThreadNameGenerator.
| Command | Purpose | Notable options |
|---|---|---|
agentflow api |
Start the API server | --config/-c (default agentflow.json), --host/-H, --port/-p (8000), --reload/--no-reload, -v/-q |
agentflow play |
Start the server and open the hosted playground | same as api |
agentflow init |
Interactively scaffold a project (questionary prompts pick dev vs production, auth, rate limit) | --path/-p, --force/-f. There is no --prod flag; setup type is chosen interactively |
agentflow build |
Generate a Dockerfile (and optionally docker-compose.yml) |
--output/-o, --python-version (3.13), --port, --docker-compose/--no-docker-compose, --service-name |
agentflow eval |
Run agent evaluations; discovers *_eval.py/eval_*.py, runs cases (optionally --parallel), writes HTML+JSON to eval_reports/ |
--output/-o, --no-report, --threshold/-t, --open, --parallel/-p, --max-concurrency/-c |
agentflow test |
Run project tests via pytest (args after -- forwarded verbatim) |
--coverage/-C, --html, -k, path arg |
agentflow skills |
Install bundled Agentflow skills for Codex/Claude/GitHub | --agent/-a, --path/-p, --force/-f, --all, --list/-l |
agentflow version |
Show CLI + package version | reads CLI_VERSION constant + package version from pyproject.toml |
Defaults (from cli/constants.py): DEFAULT_HOST="127.0.0.1", DEFAULT_PORT=8000,
DEFAULT_CONFIG_FILE="agentflow.json".
Parsed by agentflow_cli/src/app/core/config/graph_config.py. Supported keys:
| Key | Meaning |
|---|---|
agent (required) |
"module:attribute" resolving to a CompiledGraph. The loader accepts a CompiledGraph object, a sync/async factory returning one, or a callable. |
env |
Path to a .env file, loaded at config-load time |
thread_name_generator |
"module:attr" -> a ThreadNameGenerator |
auth |
null, the string "jwt", or {"method": "custom", "path": "module:attr"} |
authorization |
"module:attr" -> an AuthorizationBackend (RBAC / per-tool access) |
checkpointer |
"module:attr" -> a BaseCheckpointer |
injectq |
"module:attr" -> an InjectQ container |
store |
"module:attr" -> a BaseStore |
redis |
Redis URL string |
rate_limit |
Object (see below) |
rate_limit object: enabled, requests (default 100), window secs (60), by (ip |
global), backend (memory | redis | custom), trusted_proxy_headers (honour
X-Forwarded-For only when true), exclude_paths, fail_open (on backend error: allow vs deny),
and for redis backend a redis sub-object { "url", "prefix" } (or shorthand URL string). For
custom, bind a BaseRateLimitBackend in InjectQ.
"auth": "jwt"requiresJWT_SECRET_KEYandJWT_ALGORITHMin the environment (raises at load if missing). JWT logic lives incore/auth/jwt_auth.py."auth": {"method": "custom", "path": "module:attr"}loads yourBaseAuthsubclass (from agentflow_cli import BaseAuth).- Authorization (RBAC, per-tool) is separate:
core/auth/authorization.py(AuthorizationBackend/DefaultAuthorizationBackend), wired via theauthorizationkey.
- Graph (
tags=["Graph"]):POST /v1/graph/invoke,POST /v1/graph/stream,POST /v1/graph/stop,POST /v1/graph/setup,POST /v1/graph/fix,GET /v1/graph,WS /v1/graph/ws. - Checkpointer / threads:
GET/POST /v1/threads,GET/DELETE /v1/threads/{thread_id},GET /v1/threads/{thread_id}/state,GET /v1/threads/{thread_id}/messages,... /messages/{message_id}. - Store (memory):
POST /v1/store/memories,/v1/store/memories/list,/v1/store/memories/forget,/v1/store/memories/{memory_id},POST /v1/store/search. - Media / files (
tags=["Files"]):POST /v1/files/upload,GET /v1/files/{file_id},/{file_id}/info,/{file_id}/url,GET /v1/config/multimodal. - Ping:
GET /ping.
Routers are wired in routers/setup_router.py (init_routes). a2a.py and a2ui.py exist but
are not mounted there yet.
core/config/settings.py is a pydantic-settings Settings (with extra="allow", so unknown
env vars are tolerated). Notable vars: APP_NAME, APP_VERSION, MODE (development |
production), LOG_LEVEL, IS_DEBUG, MAX_REQUEST_SIZE (10MB default), security headers
(SECURITY_HEADERS_ENABLED, HSTS_*, FRAME_OPTIONS, CSP_POLICY, ...), ORIGINS (CORS,
default * with a wildcard warning), ALLOWED_HOST, ROOT_PATH/DOCS_PATH/REDOCS_PATH,
REDIS_URL, SENTRY_DSN, SNOWFLAKE_* (epoch/node/worker/bit layout), JWT_SECRET_KEY/
JWT_ALGORITHM, OTEL_ENABLED/OTEL_SERVICE_NAME/OTEL_EXPORTER_OTLP_ENDPOINT/OTEL_LEVEL.
In production: set MODE=production, IS_DEBUG=false, a non-* ORIGINS, and a strong
JWT_SECRET_KEY.
sentry, firebase, snowflakekit, redis, jwt, media (document text extraction via
textxtract), gcloud (Cloud Logging), otel (includes FastAPI instrumentation + OTLP exporter).
# from this folder (agentflow-api/); a .venv is present
.venv/bin/python -m pytest # tests in tests/
agentflow init # scaffold (interactive)
agentflow api --reload # dev server on 127.0.0.1:8000
agentflow play # server + hosted playground
agentflow build --docker-compose # Dockerfile + compose
ruff check . && ruff format .- Tests in
tests/;pytestconfig and ruff/bandit are inpyproject.toml. Templates undercli/templates/{dev,prod}are excluded from lint/type/bandit (they are emitted code, not lib). - The
prodtemplate is the reference for a real project: it scaffoldsgraph/(agent, state, tools, validators, thread_name_generator),auth/,evals/, andtests/.
- Version is now single-sourced.
CLI_VERSION(andagentflow_cli.__version__, which aliases it) resolve from installed distribution metadata, falling back topyproject.toml.agentflow versionreports0.3.2.9for both the CLI and package lines. (The old hardcoded1.0.0drift is resolved.) - README shows
agentflow init --prod— that flag does not exist.initis interactive and only accepts--path/--force. api/playhelp text claims default host0.0.0.0butDEFAULT_HOSTis127.0.0.1.- "Pyagenity" branding leftovers. The CLI app help,
agentflow_cli.__init__docstring, theversionbanner, and several router docstrings still say "Pyagenity" (the framework's former name). Cosmetic but pervasive; rename to Agentflow when touching those files. - a2a / a2ui routers are not mounted. Don't document a2a HTTP endpoints as live until
setup_router.init_routesincludes them. pyproject.tomlURLs point atgithub.com/10xHub/agentflow-cliandagentflow-cli.readthedocs.io; confirm these are canonical vs the core'sagentflow.10xscale.ai.- The workspace-root
CLAUDE.mdlists onlyinit/api/play/buildand an olderagentflow.jsonshape; the real CLI haseval/test/skills/versiontoo and the config supportsrate_limit,thread_name_generator, andauthorization.