Custom Bot Commands
The custom-bot commands deploy and manage custom bot definitions on the0 platform.
Deploy
Deploy a custom bot from the current directory:
the0 custom-bot deployThe CLI reads bot-config.yaml and performs the following steps:
- Validates configuration and semantic version
- Vendors dependencies (Python: pip install to
vendor/, Node.js: npm install) - Compiles code for compiled languages (Rust, C#, Scala, C++, Haskell)
- Builds frontend if
hasFrontend: trueis set - Packages files into a deployable archive (respecting
.the0ignore) - Uploads to the platform
Required project structure:
my-bot/
├── bot-config.yaml # Bot metadata and configuration
├── main.py # Entry point (or main.ts, main.rs, etc.)
├── bot-schema.json # Configuration parameter schema
├── requirements.txt # Dependencies (Python)
└── README.md # DocumentationExample bot-config.yaml:
name: sma-crossover
description: "SMA crossover strategy bot"
version: 1.0.0
author: "your-name"
type: realtime
runtime: python3.11
entrypoints:
bot: main.py
schema:
bot: bot-schema.json
readme: README.md
metadata:
categories: [trading, technical-analysis]
tags: [sma, crossover]Each deployment requires a unique version. Increment the version field before deploying updates.
List
Display all your deployed custom bots:
the0 custom-bot listOutput shows bot name, latest version, creation date, and type.
Versions
List all versions of a specific custom bot:
the0 custom-bot versions <name>Example:
the0 custom-bot versions sma-crossoverSchema
Retrieve the JSON Schema for a custom bot's configuration parameters:
the0 custom-bot schema <version> <name>Use this to understand what parameters are required when deploying bot instances.
Example:
the0 custom-bot schema 1.0.0 sma-crossoverThe .the0ignore File
Exclude files from deployment by creating a .the0ignore file. The syntax is similar to .gitignore:
# Exclude test files
tests/
*_test.py
# Exclude local configuration
*.local.yaml
.env
# Exclude build artifacts
__pycache__/
*.pycThe following directories are always included regardless of ignore patterns:
vendor/- Python dependenciesnode_modules/- Node.js dependencies
Default exclusions when no .the0ignore exists:
*.log,*.tmp,*.temptest/,tests/,__tests__/.git/,build/,dist/__pycache__/,*.pyc,*.pyo.DS_Store,Thumbs.db
Related
- Bot Commands - Deploy bot instances from custom bots
- Secrets - Configure private dependency access
- Custom Bots - Understanding custom bot concepts