Tonbo Documentation

Durable state for agents and the programs around them: SQLite databases that outlive their machine, streams any program reads live, and services that sleep when idle.

Add a Tonbo database to this project: SQLite the program opens by name, which outlives the machine. If I asked for an append-only log that programs append to and read, add a Tonbo stream instead.

1. Check that TONBO_API_KEY is set, in the environment the program runs with or in the .env or secret store the project already uses; check only that it is set, and never print it. If it is not set, stop and ask me to create a key in the Tonbo console under API keys and set it. Do not guess, invent or hardcode a key, and never write one into source code.
2. Check that the Tonbo CLI is signed in as me: `env -u TONBO_API_KEY tonbo account show`. If `tonbo` is missing or not signed in, stop and ask me to run `npm i -g @tonbo/cli` and `tonbo login`. Run every `tonbo` command below as `env -u TONBO_API_KEY tonbo`, so it acts as my login rather than the program's key.
3. Detect the stack in the current directory. In a monorepo, work only in the current directory and below. Take the first that matches:
   - a package.json that depends on `@earendil-works/pi-durable`: https://tonbo.dev/docs/getting-started/quickstarts/pi#setup
   - a package.json that depends on `drizzle-orm`: https://tonbo.dev/docs/getting-started/quickstarts/drizzle#setup
   - any other package.json (Node.js): https://tonbo.dev/docs/getting-started/quickstarts/sqlite#setup
   - a pyproject.toml, requirements.txt or setup.py (Python): https://tonbo.dev/docs/getting-started/quickstarts/sqlite-python#setup
   - a stream, in any language: https://tonbo.dev/docs/getting-started/quickstarts/stream#setup
   If none matches, stop and ask me.
4. Read only the section headed "Add it to a project" at that link, and follow it. Use the name I gave, or else the page's example name, and tell me which.

Rules:
- Add only a database or a stream. Do not create, change or delete any other Tonbo resource, and do not touch Machines or any other product.
- Do not run application code. Install the packages at the exact versions the section names, and change no other dependency.
- Put the key only where the project already keeps secrets.

Success: `env -u TONBO_API_KEY tonbo database show <name>` (or `stream show <name>`) prints `State:` with `active`, and the section's install check, if it names one, prints what it says. Then tell me the one command that runs the program with TONBO_API_KEY set.

For anything else, start at https://tonbo.dev/docs.

Start with a quickstart

Start with Pi Durable, or pick another; each runs from your laptop.

Products

Three products, on one account and one set of keys.

When Tonbo fits ›

What people build

Each links to the page that shows how.

Use a client library

Databases from Node.js and Python; streams over plain HTTP.

Manage your account

Keys, usage and billing for your account.

Need some help? Talk to a founder ↗ (opens in a new tab)

Pricing and limits? See pricing