Part of Forge Documentation
Complete reference for all Forge CLI commands.
| Flag | Short | Default | Description |
|---|---|---|---|
--config |
forge.yaml |
Config file path | |
--verbose |
-v |
false |
Enable verbose output |
--output-dir |
-o |
. |
Output directory |
Initialize a new agent project.
forge init [name] [flags]
| Flag | Short | Default | Description |
|---|---|---|---|
--name |
-n |
Agent name | |
--framework |
-f |
Framework: crewai, langchain, or custom |
|
--language |
-l |
Language: python, typescript, or go |
|
--model-provider |
-m |
Model provider: openai, anthropic, ollama, or custom |
|
--channels |
Channel adapters (e.g., slack,telegram) |
||
--tools |
Builtin tools to enable (e.g., web_search,http_request) |
||
--skills |
Registry skills to include (e.g., github,weather) |
||
--api-key |
LLM provider API key | ||
--org-id |
OpenAI Organization ID (enterprise) | ||
--from-skills |
Path to a SKILL.md file for auto-configuration | ||
--non-interactive |
false |
Skip interactive prompts |
# Interactive mode (default)
forge init my-agent
# Non-interactive with all options
forge init my-agent \
--framework langchain \
--language python \
--model-provider openai \
--channels slack,telegram \
--non-interactive
# From a skills file
forge init my-agent --from-skills SKILL.md
# With builtin tools and registry skills
forge init my-agent \
--framework custom \
--model-provider openai \
--tools web_search,http_request \
--skills github \
--api-key sk-... \
--non-interactive
# OpenAI enterprise with organization ID
forge init my-agent \
--model-provider openai \
--api-key sk-... \
--org-id org-xxxxxxxxxxxxxxxxxxxxxxxx \
--non-interactiveBuild the agent container artifact. Runs the full 8-stage build pipeline.
forge build [flags]
Uses global --config and --output-dir flags. Output is written to .forge-output/ by default.
# Build with default config
forge build
# Build with custom config and output
forge build --config agent.yaml --output-dir ./buildValidate agent spec and forge.yaml.
forge validate [flags]
| Flag | Default | Description |
|---|---|---|
--strict |
false |
Treat warnings as errors |
--command-compat |
false |
Check Command platform import compatibility |
# Basic validation
forge validate
# Strict mode
forge validate --strict
# Check Command compatibility
forge validate --command-compatRun the agent locally with an A2A-compliant dev server.
forge run [flags]
| Flag | Default | Description |
|---|---|---|
--port |
8080 |
Port for the A2A dev server |
--host |
"" (all interfaces) |
Bind address |
--shutdown-timeout |
0 (immediate) |
Graceful shutdown timeout |
--mock-tools |
false |
Use mock runtime instead of subprocess |
--enforce-guardrails |
false |
Enforce guardrail violations as errors |
--model |
Override model name (sets MODEL_NAME env var) |
|
--provider |
LLM provider: openai, anthropic, or ollama |
|
--env |
.env |
Path to .env file |
--with |
Comma-separated channel adapters (e.g., slack,telegram) |
|
--cors-origins |
localhost | Comma-separated CORS allowed origins (e.g., https://app.example.com,https://admin.example.com). Use * to allow all origins |
# Run with defaults
forge run
# Run with mock tools on custom port
forge run --port 9090 --mock-tools
# Run with LLM provider and channels
forge run --provider openai --model gpt-4 --with slack
# Container deployment
forge run --host 0.0.0.0 --shutdown-timeout 30s
# Run with guardrails enforced
forge run --enforce-guardrails --env .env.production
# Run with custom CORS origins (for K8s ingress)
forge run --cors-origins 'https://app.example.com,https://admin.example.com'Manage the agent as a background daemon process.
forge serve [start|stop|status|logs] [flags]
| Subcommand | Description |
|---|---|
start (default) |
Start the daemon in background |
stop |
Send SIGTERM (10s timeout, SIGKILL fallback) |
status |
Show PID, listen address, health check |
logs |
Tail .forge/serve.log |
| Flag | Default | Description |
|---|---|---|
--port |
8080 |
HTTP server port |
--host |
127.0.0.1 |
Bind address (secure default) |
--with |
Channel adapters | |
--cors-origins |
localhost | Comma-separated CORS allowed origins |
# Start daemon (secure defaults: 127.0.0.1, 30s shutdown timeout)
forge serve
# Start on custom port
forge serve start --port 9090 --host 0.0.0.0
# Stop the daemon
forge serve stop
# Check status (PID, uptime, health)
forge serve status
# View recent logs (last 100 lines)
forge serve logsThe daemon forks forge run in the background with setsid, writes state to .forge/serve.json, and redirects output to .forge/serve.log.
Export agent spec for Command platform import.
forge export [flags]
| Flag | Default | Description |
|---|---|---|
--output |
{agent_id}-forge.json |
Output file path |
--pretty |
false |
Format JSON with indentation |
--include-schemas |
false |
Embed tool schemas inline |
--simulate-import |
false |
Print simulated import result |
--dev |
false |
Include dev-category tools in export |
# Export with defaults
forge export
# Pretty-print with embedded schemas
forge export --pretty --include-schemas
# Simulate Command import
forge export --simulate-importBuild a container image for the agent.
forge package [flags]
| Flag | Default | Description |
|---|---|---|
--push |
false |
Push image to registry after building |
--platform |
Target platform (e.g., linux/amd64) |
|
--no-cache |
false |
Disable layer cache |
--dev |
false |
Include dev tools in image |
--prod |
false |
Production build (rejects dev tools and dev-open egress) |
--verify |
false |
Smoke-test container after build |
--registry |
Registry prefix (e.g., ghcr.io/org) |
|
--builder |
Force builder: docker, podman, or buildah |
|
--skip-build |
false |
Skip re-running forge build |
--with-channels |
false |
Generate docker-compose.yaml with channel adapters |
# Build image with auto-detected builder
forge package
# Build and push to registry
forge package --registry ghcr.io/myorg --push
# Build for specific platform with no cache
forge package --platform linux/amd64 --no-cache
# Generate docker-compose with channels
forge package --with-channelsManage cron schedules.
forge schedule list
Lists all configured cron schedules (both YAML-defined and LLM-created).
Manage and inspect agent tools.
List all available tools.
forge tool listShow tool details and input schema.
forge tool describe <name>Manage agent communication channels.
Add a channel adapter to the project.
forge channel add <slack|telegram>Run a standalone channel adapter.
forge channel serve <slack|telegram>Requires the AGENT_URL environment variable to be set.
List available channel adapters.
forge channel listShow configured channels from forge.yaml.
forge channel statusManage encrypted secrets.
# Store a secret (prompts for value securely)
forge secret set OPENAI_API_KEY
# Store with inline value
forge secret set SLACK_BOT_TOKEN xoxb-...
# Retrieve a secret (shows source)
forge secret get OPENAI_API_KEY
# List all secret keys
forge secret list
# Delete a secret
forge secret delete OLD_KEY
# Agent-local secret
forge secret set API_KEY --localManage Ed25519 signing keys.
# Generate an Ed25519 signing keypair
forge key generate
# Generate with a custom name
forge key generate --name ci-key
# Add a public key to the trusted keyring
forge key trust ~/.forge/signing-key.pub
# List signing and trusted keys
forge key listManage agent skills.
# Add a skill from the registry
forge skills add <skill-name>
# List available skills
forge skills list
# Filter by category
forge skills list --category sre
# Filter by tags
forge skills list --tags kubernetes,incident-response
# Validate skill requirements
forge skills validate
# Audit skill security
forge skills audit --embedded
# Sign a skill
forge skills sign
# Generate a signing key
forge skills keygen
# Generate trust report
forge skills trust-reportLaunch the local web dashboard.
# Launch with defaults
forge ui
# Specify workspace and port
forge ui --dir /path/to/workspace --port 4200
# Launch without auto-opening browser
forge ui --no-openSee Dashboard for full documentation.
← Hooks | Back to README | Configuration →