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

# Quickstart

> Run paddock on your machine, define an agent in a file, put it to work with one HTTP request, and watch it live. Then do the same in code.

In a few minutes you will start paddock on your machine, create an agent from a template file, send it a message with `curl`, and watch it write and run a script, live, in your terminal. Each step is one command.

You need Go 1.24 or later, Node.js 22 or later with pnpm, and an Anthropic API key for the agent's model. There is no Docker, no sandbox account, and no tunnel: the local server runs everything on your machine.

**1. Get the CLI**

Clone the repository, install the CLI with `paddockd`, the daemon the local server runs beside each agent, and build the terminal UI that `agents watch` runs:

```bash theme={null}
git clone https://github.com/wenfengwang/paddock && cd paddock
go install ./cmd/paddock ./cmd/paddockd
(cd sdk/js && pnpm install && pnpm -r build)
```

Run the commands below from the repository's directory.

**2. Start a server**

Start paddock with your Anthropic key in the environment, and `ANTHROPIC_BASE_URL` too when the key is for another Anthropic-compatible endpoint:

```bash theme={null}
$ export ANTHROPIC_API_KEY=sk-ant-...
$ paddock server start
PostgreSQL  17.6 on 127.0.0.1:15432, data in /Users/ada/.paddock/postgres/data
Harnesses   claude 2.1.300, codex 0.162.1 in /Users/ada/.paddock/harnesses
Paddock is running at http://127.0.0.1:8080/v1 (local mode: agents run on this machine, not in sandboxes)
API key: none required (base URL saved to /Users/ada/.config/paddock/credentials)
Agents:  /Users/ada/.paddock/agents
Logs:    /Users/ada/.paddock/logs/server.log
```

The first start downloads PostgreSQL and installs the pinned Claude Code and Codex CLIs under `~/.paddock`. Your model key stays in the server's memory and never reaches an agent. Agents run as you, on this machine, with no sandbox around them. See [Local server](https://docs.paddockai.dev/platform/cli.md#local-server).

The local server listens on `127.0.0.1` only and needs no API key, so `curl` works as it is. The CLI and every server SDK find its URL on their own. Starting again reports the running server. To require a key, see [Local server](https://docs.paddockai.dev/platform/cli.md#configuration-file).

**3. Define an agent**

A template is a YAML file that says what kind of agent to run: its harness, its model, and its instructions. The repository's `examples/hello/template.yaml` is a Claude Code agent that writes and runs small scripts:

```yaml examples/hello/template.yaml theme={null}
apiVersion: paddock.build/v1
kind: Template
metadata:
  name: hello
spec:
  harness: claude-code
  model: claude-sonnet
  system_prompt: |
    You write small scripts. For every request, write one short script in the
    workspace (Python unless asked otherwise), run it, and answer in one or two
    sentences with the file's name and what it printed.
```

```bash theme={null}
$ paddock templates create ./examples/hello
TEMPLATE  HARNESS      MODEL          CREATED
hello@1   claude-code  claude-sonnet  2026-11-22 09:15:30 +01:00
```

**4. Run it**

Create an agent from the template. It gets its own directory under `~/.paddock/agents` the first time it has work, and prints its URL:

```bash theme={null}
$ paddock agents create hello
ID                              TEMPLATE  HARNESS      MODEL          STATUS    SESSIONS  CREATED
agt_01h455vb4pex5vsknk084sn02q  hello@1   claude-code  claude-sonnet  sleeping  0         2026-11-22 09:15:41 +01:00
url: http://127.0.0.1:8080/v1/agents/agt_01h455vb4pex5vsknk084sn02q
```

**5. Watch it work**

Open the agent in one terminal:

```bash theme={null}
paddock agents watch agt_01h455vb4pex5vsknk084sn02q
```

And send it a message from another, a `POST` to its URL:

```bash theme={null}
curl -X POST http://127.0.0.1:8080/v1/agents/agt_01h455vb4pex5vsknk084sn02q/messages \
  -d '{"text": "Write and run a hello script"}'
```

The message lands in the agent's default session, which the first message creates. In the watch UI the session appears on the left as `running`; on the right, **Events** shows the turn start, the agent writing `hello.py` and running it, and its answer, as they happen:

```text theme={null}
agt_01h455vb4pex5vsknk084sn02q  hello@1  claude-code  awake  1 session
╭──────────────────────────────────╮╭──────────────────────────────────────────────────────────────────╮
│ Sessions                         ││ ses_…js9p9rj6   Events  Transcript  Stats   follow                │
│ > idle     ses_…js9p9rj6 1s ago  ││ [1] user: Write and run a hello script                            │
│                                  ││ [2] turn.started user                                             │
│                                  ││ [3] config.applied                                                │
│                                  ││ [4] tool_call shell (Bash)                                        │
│                                  ││ [5] tool_result shell                                             │
│                                  ││ [6] assistant: I wrote `hello.py` in the workspace and ran it ... │
│                                  ││ [7] session.status                                                │
│                                  ││ [8] turn.ended completed                                          │
╰──────────────────────────────────╯╰──────────────────────────────────────────────────────────────────╯
↑↓ session  tab/←→ view  f follow  pgup/pgdn scroll  q quit
```

`tab` switches to **Transcript**, the conversation with each command it ran, and to **Stats**: the turn's time, how long the agent took to wake, the tool calls, and the tokens used. `q` quits.

**6. Do the same in code**

Everything the CLI did is one call of a server SDK, which finds the URL as the CLI does:

```go Go theme={null}
package main

import (
	"context"
	"fmt"
	"log"

	"github.com/wenfengwang/paddock/sdk/go/paddock"
)

func main() {
	ctx := context.Background()
	client, err := paddock.NewClient(paddock.Options{})
	if err != nil {
		log.Fatal(err)
	}
	tpl, err := client.Templates.Create(ctx, "examples/hello/template.yaml")
	if err != nil {
		log.Fatal(err)
	}
	agent, err := client.Agents.Create(ctx, paddock.AgentCreate{Template: fmt.Sprintf("%s@%d", tpl.Name, tpl.Version)})
	if err != nil {
		log.Fatal(err)
	}
	ev, err := agent.Send(ctx, "Write and run a hello script")
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println("agent", agent.ID, "session", *ev.SessionID)
}
```

```python Python theme={null}
from paddockai import Paddock

client = Paddock()
template = client.templates.create("examples/hello/template.yaml")
agent = client.agents.create(template=f"{template.name}@{template.version}")
event = agent.send("Write and run a hello script")
print("agent", agent.id, "session", event.session_id)
```

```ts TypeScript theme={null}
import { Paddock } from "@paddockai/server";

const paddock = new Paddock();
const template = await paddock.templates.create("examples/hello/template.yaml");
const agent = await paddock.agents.create({ template: `${template.name}@${template.version}` });
const event = await agent.send("Write and run a hello script");
console.log("agent", agent.id, "session", event.sessionId);
```

Creating the same template again returns `hello@1` unchanged. Watch the new agent with `paddock agents watch` and the ID it prints.

## What just happened

* **Define.** The template became version 1 of `hello`. A changed file becomes version 2; agents keep the version they were created from.
* **Run.** The agent owns one directory, its local stand-in for a sandbox, created for its first message. When its sessions are idle for a while it sleeps, and the next message wakes it with its conversation and files intact; the watch UI shows the wake time. On the hosted API the same agent runs in its own cloud sandbox.
* **Use.** `POST <agent URL>/messages` is `agent.send`: it stores the message in the agent's default session and returns at once, without waiting for the turn. For several conversations, create sessions yourself; see [Agents and sessions](https://docs.paddockai.dev/guides/agents-and-sessions.md).
* **See.** `agents watch` follows sessions with the [client SDK](https://docs.paddockai.dev/sdks/client.md), the same live state a browser gets from a session token.

Next, put a session in your own frontend with [Streaming to the browser](https://docs.paddockai.dev/guides/streaming.md) and the [React chat example](https://docs.paddockai.dev/examples/react-chat.md), or run against the hosted API with [`paddock auth login`](https://docs.paddockai.dev/platform/cli#log-in). `paddock server stop` stops the local server and its agents, after asking; their data stays for the next start.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.