| title | Quickstart |
|---|---|
| description | 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.
Install cpsl. The package includes the Python API and the capsule CLI.
uv add cpslor:
pip install cpslVerify the CLI:
capsule --helpcapsule loginThis authenticates your local machine as a builder. Your deployed app will still get its own app-scoped user sign-in flow.
Use a production-shaped starter instead of a blank file:
capsule create my-app --template quickstart
cd my-appThe generated README shows required secrets, local run commands, and the deploy entry point.
If you have uv:
uv syncWithout uv:
pip install -e .Templates print the exact secret commands they need. For quickstart:
capsule secret create ANTHROPIC_API_KEY=sk-ant-...Local environment variables work while serving locally. Deployed apps need Capsule secrets.
capsule serve app.py:appOpen the preview URL from the command output. You should see a hosted chat surface and a context page.
capsule deploy app.py:appDeploy 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.
capsule create studio --template media-studio
capsule create browser-demo --template browser-agent
capsule create monitor --template background-agent- First Chat App for the message loop
- Add Data And State for session data and collections
- Add Pages for app UI
- Deploy An App for serve/deploy details
- CLI Reference for the full command surface