> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sb0.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Initialize a new agent project

## Prerequisites

You have installed the `sb0` CLI:

```bash theme={null}
curl -fsSL https://raw.githubusercontent.com/terminal-use/sb0-cli/main/install.sh | bash
```

## Create Your Agent Project

Create a new directory and scaffold your agent:

```bash theme={null}
sb0 agent init my-agent
```

This creates the directory `my-agent/` with your agent code and configuration.

<Accordion title="Project structure" icon="folder">
  Your `agent/` directory contains:

  ```
  agent/
  ├── .sb0/                  # Internal sb0 files
  │   └── wheels/            # Embedded Python packages
  ├── .venv/                 # Python virtual environment
  ├── handle_query.py        # Your agent handler code
  ├── agent.config.yaml      # Agent configuration
  ├── pyproject.toml         # Python dependencies
  ├── .dockerignore          # Docker build exclusions
  └── .gitignore            # Git exclusions
  ```

  The key files are:

  * **`handle_query.py`**, which contains your agent's logic:

  ```python theme={null}
  class Handler:
      async def handle_query(
          self,
          prompt: str,
          session_id: str | None = None,
          **kwargs,
      ) -> AsyncIterator[Message]:
          # ... your agent logic
  ```

  * **`agent.config.yaml`**, which contains the build and runtime configuration:

  ```yaml theme={null}
  version: "0.1"
  image: "my-agent:latest"

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

  runtime:
    handler: "handle_query:Handler"
  ```
</Accordion>

## "Hello World!"

You can now test your agent with a single prompt:

```bash theme={null}
cd my-agent
sb0 agent run --prompt "Hello"
```

**Expected output:**

```
Streaming agent response...

Hello! How can I assist you today?
```

<Info>
  This step requies an Anthropic API key. Get one at [console.anthropic.com](https://console.anthropic.com). Then add it to your environment:

  ```bash theme={null}
  export ANTHROPIC_API_KEY="sk-ant-..."
  ```
</Info>
