Skip to content

Core Commands

The five commands you’ll use most: scaffold, validate, run, build, and test.


Scaffold a new Dockfile with sensible defaults.

Terminal window
dockrion init <name> [options]
Argument/OptionFlagTypeDefaultDescription
name(positional)strrequiredAgent name (lowercase with hyphens)
--output-ostrDockfile.yamlOutput file path
--force-fboolfalseOverwrite existing file without confirmation
--framework-FstrlanggraphFramework: langgraph, langchain, or custom
--handler-HboolfalseUse handler mode (no .invoke() needed)
--auth-astrnullAuth mode: none, api_key, or jwt
--corsboolfalseEnable CORS for browser access
--secretsboolfalseAdd secrets section (includes OPENAI_API_KEY etc.)
--secret-namesstrnullCustom secret names, comma-separated
--streaming-sstrsseStreaming: sse, websocket, or none
--streaming-events-EstrnullEvents preset or comma-separated list
--async-runs-AboolfalseEnable async /runs endpoint
--streaming-backendstrmemoryBackend: memory or redis
--observability--obsboolfalseAdd observability config
--metadata-mboolfalseAdd metadata section
--fullboolfalseInclude everything: auth, secrets, cors, observability, metadata
Terminal window
# Simplest handler agent
dockrion init my-bot --handler
# LangGraph with full features
dockrion init invoice-copilot --framework langgraph --auth api_key --streaming sse --async-runs --full
# Custom output path
dockrion init my-agent -o config/agent.yaml --force

Validate a Dockfile without running or building.

Terminal window
dockrion validate [path] [options]
Argument/OptionFlagTypeDefaultDescription
path(positional)strDockfile.yamlPath to Dockfile
--verbose-vboolfalseShow full spec details
--quiet-qboolfalseOnly show errors
  • File exists and is valid YAML
  • Schema validation against DockSpec (all Pydantic validators run)
  • Agent name format, entrypoint/handler format
  • Framework is supported
  • Auth mode, rate limit syntax, permissions
  • Secret name format, event type names, port ranges
  • Cross-field rules (entrypoint requires framework, array needs items, etc.)
✓ Dockfile is valid
Agent: invoice-copilot
Mode: entrypoint (app.graph:create_graph)
Framework: langgraph

With --verbose, the full parsed spec is printed.


Start a local development server using uvicorn.

Terminal window
dockrion run [path] [options]
Argument/OptionFlagTypeDefaultDescription
path(positional)strDockfile.yamlPath to Dockfile
--hoststr(from Dockfile)Override bind host
--portint(from Dockfile)Override bind port
--reload-rboolfalseHot reload on file changes
--env-file-estrnullPath to .env file (overrides auto-detection)
--verbose-vboolfalseShow detailed output including env summary
  1. Loads and validates the Dockfile
  2. Resolves secrets from environment / .env / --env-file
  3. Generates runtime files in .dockrion_runtime/
  4. Installs requirements (prefers uv if available)
  5. Starts uvicorn with main:app
Terminal window
# Default (port 8080)
dockrion run
# Custom port with hot reload
dockrion run --port 3000 --reload
# With explicit env file
dockrion run --env-file .env.development -v

Press Ctrl+C to stop the server (exits with code 0).


Generate runtime files and build a Docker image.

Terminal window
dockrion build [path] [options]
Argument/OptionFlagTypeDefaultDescription
path(positional)strDockfile.yamlPath to Dockfile
--targetstrlocalDeployment target (only local in V1)
--tagstrdevDocker image tag
--no-cacheboolfalseBuild without Docker layer cache
--env-file-estrnullPath to .env file for secret validation
--allow-missing-secretsboolfalseContinue even if required secrets are missing
--verbose-vboolfalseShow detailed build output

Hidden option: --use-local-dockrion-packages — for framework developers only.

  1. Loads and validates the Dockfile
  2. Checks secrets (fails if required secrets missing, unless --allow-missing-secrets)
  3. Calls deploy() from the SDK:
    • Generates main.py, requirements.txt, Dockerfile from templates
    • Resolves build context (includes, excludes, auto-detected imports)
    • Runs docker build to create the image
  4. Reports the image name: dockrion/{agent-name}:{tag}
Terminal window
# Default build
dockrion build
# Production tag, no cache
dockrion build --tag v1.0.0 --no-cache
# CI/CD (secrets not available locally)
dockrion build --allow-missing-secrets --tag $CI_COMMIT_SHA
# With env file for secret validation
dockrion build -e .env.production

Invoke the agent locally without starting an HTTP server.

Terminal window
dockrion test [path] [options]
Argument/OptionFlagTypeDefaultDescription
path(positional)strDockfile.yamlPath to Dockfile
--payload-pstrnullJSON payload as a string
--payload-file-fstrnullPath to a JSON file with the payload
--output-ostrnullSave output to file
--verbose-vboolfalseShow detailed output

Either --payload or --payload-file is required.

  1. Parses the JSON payload
  2. Calls invoke_local(path, payload) from the SDK
  3. Prints the result as formatted JSON
  4. Optionally saves to a file
Terminal window
# Inline payload
dockrion test -p '{"query": "hello"}'
# From file
dockrion test -f test_payload.json
# Save output
dockrion test -p '{"query": "test"}' -o result.json

Source: packages/cli/dockrion_cli/init_cmd.py, validate_cmd.py, run_cmd.py, build_cmd.py, test_cmd.py


Next: 3.2 Utility Commands →