- a local app with chat and a page
- one small piece of session state
- a successful hosted deploy
- a clear sense of where channels, tasks, filesystems, and pricing fit next
1. Create app.py
App(...)defines the runtime and deploy configimage=cpsl.Image()says the app should run in a default Python environment@app.page(...)registers a structured UI page alongside chat@app.message()registers the chat handlersession.datastores per-session state for the current app usersession.reply()sends a message back to the user
image= is required here: in functional apps, App(...) needs to know the runtime environment up front. In class-based apps, that same information lives on @app.cls(...) instead.
2. Authenticate once
If you have not used Capsule on this machine before:serve and deploy can talk to the platform.
3. Start the live dev loop
app:app means:
- module:
app.py - symbol:
app
capsule serve uploads the project, boots the runtime, and hot-reloads when you edit watched files such as Python, TSX, CSS, JSON, and Markdown.
4. Use the app
Open the local preview from thecapsule serve output. You should see:
- chat, powered by the
@app.message()handler - a
Statuspage in the sidebar, powered by@app.page(...)
session.datastores per-conversation statesession.idgives you a stable session identifier- saving the file should cause the local preview to pick up the change
5. Deploy it
When the local version looks good:6. Add the next product surface
From here, most apps branch into one or more of these directions:- channels for Telegram, Slack, WhatsApp, or API entry points
- collections for durable data and tables
- data handlers for computed JSON
- DSL or React pages for structured UI
- tasks and schedules for asynchronous work
- filesystems, integrations, and secrets for external systems
- pricing when the app becomes something users pay for
App(...):
Where to go next
- Why Capsule for the full platform story
- First Chat App for a fuller message-driven app
- Collections And Scopes for persisted data
- Data Handlers And Pages for dashboards and UI
- Tasks And Schedules for the built-in task execution model
- CLI Reference for the full command surface