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

# Quickstart

> Build, serve, and deploy a small Capsule app.

This is the shortest path from an empty project to a live Capsule app.

You will build one app with chat and a small page, run it locally, then deploy the same entry point. Once deployed, Capsule gives each app user an isolated sandboxed runtime where your agent can use its Python environment, files, secrets, and mounted filesystems.

## 1. Install Capsule

Install `cpsl`. The package includes the Python API and the `capsule` CLI.

```bash theme={null}
uv add cpsl
```

or:

```bash theme={null}
pip install cpsl
```

Verify the CLI:

```bash theme={null}
capsule --help
```

## 2. Authenticate

```bash theme={null}
capsule login
```

This authenticates your local machine as a builder. Your deployed app will still get its own app-scoped user sign-in flow.

## 3. Create a project from a template

Use a production-shaped starter instead of a blank file:

```bash theme={null}
capsule create my-app --template quickstart
cd my-app
```

The generated README shows required secrets, local run commands, and the deploy entry point.

## 4. Install dependencies

If you have `uv`:

```bash theme={null}
uv sync
```

Without `uv`:

```bash theme={null}
pip install -e .
```

## 5. Add secrets

Templates print the exact secret commands they need. For `quickstart`:

```bash theme={null}
capsule secret create ANTHROPIC_API_KEY=sk-ant-...
```

Local environment variables work while serving locally. Deployed apps need Capsule secrets.

## 6. Serve locally

```bash theme={null}
capsule serve app.py:app
```

Open the preview URL from the command output. You should see a hosted chat surface and a context page.

## 7. Deploy

```bash theme={null}
capsule deploy app.py:app
```

Deploy packages the same app definition and returns a hosted URL. Users sign into that hosted app; the signed-in user is available inside handlers as `session.user`.

## Try another template

```bash theme={null}
capsule create studio --template media-studio
capsule create browser-demo --template browser-agent
capsule create monitor --template background-agent
```

## Next steps

* [First Chat App](/build/first-chat-app) for the message loop
* [Add Data And State](/build/add-data-and-state) for session data and collections
* [Add Pages](/build/add-pages) for app UI
* [Deploy An App](/build/deploy-an-app) for serve/deploy details
* [CLI Reference](/reference/cli) for the full command surface
