Create a Timbal Project
Run the following Timbal CLI command to create a new project:Project Structure
After running the command, your project will look like this:| Directory/File | Purpose |
|---|---|
| api/ | Elysia API server running on Bun |
| workforce/ | Your timbal components (Python). Contains subdirectories for each agent or workflow |
| workforce/<name>/agent.py | Main application file where you define your AI agents. If you create a workflow, you’ll have a workflow.py file instead |
| workforce/<name>/pyproject.toml | Python project configuration and dependency management |
| workforce/<name>/timbal.yaml | Timbal deployment configuration and settings |
| ui/ | React + Vite + TypeScript + shadcn running on Bun (only if UI is selected) |
Run locally
Runtimbal configure before your first timbal start — it stores your Timbal credentials locally. For model calls, platform auth from configure is enough; otherwise set OPENAI_API_KEY in <project>/.env (or the key for whichever provider your model uses).
From the project directory, start the full stack — API, workforce (your Python agents/workflows), and UI if you included one:
timbal start prints the local URLs and keeps services running until you quit (q). While it’s running you can press o to open the UI in your browser, or h for other commands.
If <project>/.env exists, timbal start loads it automatically and injects those variables into every service (UI, API, and all workforce members). Per-member overrides can live in workforce/<name>/.env. See Environment variables for scoping, precedence, and overrides.
Customize your agent
timbal create scaffolds a starter agent.py (or workflow.py) under workforce/<name>/. Open that file and edit the Agent definition.
A minimal agent needs only a name and model:
agent.py
If you use your own provider key instead of platform auth, set it in a
.env file at the project root (e.g. OPENAI_API_KEY for OpenAI models) — timbal start picks it up automatically. Never commit .env to version control.main() at the bottom of agent.py). After editing, restart with timbal start to pick up changes in the full app, or run the file directly for a quick loop.
You can learn more about the Agent class and all the available options in the Agents section.
Adding Tools
Agents become powerful with tools. In Timbal, you can use both baked-in tools (pre-built and ready to use) and custom tools (functions you write yourself).Baked-in Tools
Timbal includes several ready-to-use tools. For example, theWebSearch tool allows your agent to search the internet for real-time information:
agent.py
Custom Tools
Creating custom tools is straightforward—just write a function. Here’s a simple example that returns the current date and time:agent.py