Skip to main content

Command

sb0 init [name]

Description

Creates a new agent project with complete scaffolding, configuration, and dependencies automatically installed.

Usage

Create a new project:
mkdir my-project && cd my-project
sb0 init
This creates both agent/ and gateway/ directories. The gateway is platform infrastructure—you’ll work primarily in the agent/ directory.

What Gets Created

Agent Directory (agent/)

agent/
├── .sb0/                  # Internal sb0 files
│   └── wheels/            # Embedded Python packages
├── .venv/                 # Python virtual environment (auto-created)
├── handle_query.py        # Your agent handler code
├── agent.config.yaml      # Agent configuration
├── pyproject.toml         # Python dependencies
├── uv.lock                # Dependency lockfile
├── .dockerignore          # Docker build exclusions
└── .gitignore            # Git exclusions

Gateway Directory (gateway/)

Platform infrastructure—you can ignore this for now.

Automatic Setup

The sb0 init command automatically:
  1. Creates project structure - Agent and gateway directories
  2. Generates configuration - agent.config.yaml and pyproject.toml
  3. Embeds packages - Copies sb0-runner and sb0-protocol wheels
  4. Locks dependencies - Runs uv lock to create uv.lock
  5. Installs dependencies - Runs uv sync --no-dev to create .venv/

Example Output

Generating uv.lock...
Installing agent dependencies...
✔ Agent initialized successfully!

Next steps:
  cd agent
  sb0 run --prompt "Hello!"

Configuration Files

agent.config.yaml

version: "0.1"
image: "my-agent:latest"

build:
  python_version: "3.12"
  python_project: "pyproject.toml"
  system_packages: []

runtime:
  handler: "handle_query:Handler"

pyproject.toml

[project]
name = "sb0-agent"
version = "0.1.0"
requires-python = ">=3.12"
dependencies = [
  "claude-agent-sdk~=0.1.0",
  "sb0-runner",
  "sb0-protocol",
]

Next Steps

After initialization:
  1. Navigate to agent directory:
    cd agent
    
  2. Set your API key:
    export ANTHROPIC_API_KEY="sk-ant-..."
    
  3. Test your agent:
    sb0 run --prompt "Hello!"