CLI Overview
The Stoneforge CLI (sf) is the primary command-line interface for managing agents, tasks, and orchestration workflows. While the web dashboard is the main interface for human operators, the CLI is heavily used by agents internally and provides full programmatic access to the platform.
Installation
@stoneforge/smithy package.
Command Structure
Global Options
These options are available for all commands:Path to SQLite database file (default:
.stoneforge/stoneforge.db)Entity ID of the actor performing the operation (default:
operator)Output results in JSON format
Minimal output (IDs only, no formatting)
Verbose output with additional debug information
Show help for a command
Output Modes
The CLI supports three output modes:Standard Mode (default)
Human-readable tables and formatted text:JSON Mode
Machine-readable JSON output for scripting:Quiet Mode
Minimal output (just IDs) for piping:Command Categories
Server & Runtime
sf serve— Start orchestrator server + web dashboardsf daemon start|stop|status|sleep|wake— Control the dispatch daemon
Initialization
sf init— Initialize a Stoneforge workspace in the current project
Agent Management
sf agent register|start|stop|list|show|stream— Manage orchestrator agentssf pool create|list|show|update|delete|status— Manage agent pools
Task Management
sf task create|list|ready|close|reopen— Create and manage taskssf task assign|defer|undefer|describe— Task operations
Git Operations
sf merge— Squash-merge branches (used by agents for task completion)
Common Workflows
Start the Orchestrator
Register and Start an Agent
Manage Tasks
Control the Dispatch Daemon
Exit Codes
The CLI uses standard exit codes:| Code | Meaning |
|---|---|
0 | Success |
1 | General error |
2 | Invalid arguments |
3 | Validation error |
4 | Not found |
5 | Conflict (e.g., duplicate) |
Environment Variables
The CLI respects these environment variables:STONEFORGE_DB— Default database path (overridden by--db)STONEFORGE_ACTOR— Default actor entity ID (overridden by--actor)
Next Steps
Agent Commands
Register, start, stop, and manage orchestrator agents
Task Commands
Create, list, and manage tasks
Daemon Commands
Control the dispatch daemon
Serve Command
Start the orchestrator server and web dashboard