CLI¶
The tp command-line tool manages your oneprompt project: scaffolding, starting/stopping services, and launching the API server.
Commands¶
op init¶
Initialize a new oneprompt project in the current directory.
| Option | Default | Description |
|---|---|---|
--dir |
. |
Target directory to initialize |
Creates the following files:
| File | Purpose |
|---|---|
.env |
Configuration template with API key and database URL placeholders |
DATABASE.md |
Schema documentation template |
docker-compose.yml |
Docker stack for MCP servers |
example.py |
Ready-to-run example script |
Note
Existing files are never overwritten. Only missing files are created.
op start¶
Build and start all MCP servers and the Artifact Store via Docker Compose.
| Option | Env Variable | Description |
|---|---|---|
--gemini-key |
GOOGLE_API_KEY |
Gemini API key |
--database-url |
DATABASE_URL |
PostgreSQL connection string |
--schema |
OP_SCHEMA_DOCS_PATH |
Path to DATABASE.md |
-d / --detach |
— | Run in background (default: yes) |
--no-detach |
— | Run in foreground |
If credentials are not provided via options or environment variables, you will be prompted interactively.
Example:
# Using .env file (recommended)
op start
# With explicit options
op start --gemini-key "your-key" --database-url "postgresql://..."
# Run in foreground to see logs
op start --no-detach
Services started:
| Service | Port | Description |
|---|---|---|
| Artifact Store | 3336 | File storage for generated outputs |
| PostgreSQL MCP | 3333 | SQL query execution engine |
| Chart MCP | 3334 | AntV chart generation |
| Python MCP | 3335 | Sandboxed Python execution |
op stop¶
Stop all running Docker services.
op status¶
Show the status of all Docker services.
Runs docker compose ps to display running containers and their ports.
op logs¶
Tail the Docker service logs.
Shows the last 50 lines and follows new output. Press Ctrl+C to stop.
op api¶
Start the local REST API server.
| Option | Default | Description |
|---|---|---|
--host |
0.0.0.0 |
API server host |
--port |
8000 |
API server port |
--reload / --no-reload |
--reload |
Auto-reload on code changes |
Example:
# Default settings
op api
# Custom port
op api --port 9000
# Production mode (no auto-reload)
op api --no-reload
Prerequisite
Run op start before op api. The API server depends on the MCP Docker services.
op --version¶
Show the installed SDK version.
Typical Workflow¶
# 1. Set up the project
op init
# 2. Edit configuration
# → .env (API key, database URL)
# → DATABASE.md (schema documentation)
# 3. Start services
op start
# 4. Verify everything is running
op status
# 5. Use the SDK or start the API
python example.py # Python SDK
op api # REST API
# 6. View logs if needed
op logs
# 7. Stop when done
op stop