The Tyler CLI provides tools for creating and interacting with Tyler agents. It includes commands for scaffolding new projects and chatting with agents interactively.
Installation
The Tyler CLI is automatically installed when you install the Tyler package:
After installation, the tyler command will be available in your terminal.
Commands
tyler init
Create a new Tyler agent project with all the necessary scaffolding:
tyler init my-agent
tyler init "Research Assistant" --purpose "To help with academic research"
This creates a project structure with:
agent.py - Main agent configuration
tyler-config.yaml - Chat configuration
.env.example - API key template
pyproject.toml - Project dependencies
tools/ - Directory for custom tools
README.md - Project documentation
tyler chat
Start an interactive chat session with an agent:
tyler chat
tyler chat --config my-agent-config.yaml
tyler chat --title "Research Session"
This launches an interactive chat where you can:
Type messages and see streaming responses
Use commands to manage your conversation
Switch between different conversation threads
Configuration
Tyler Chat can be configured using a YAML or JSON file to customize the agent’s behavior, tools, and parameters.
Using a configuration file
tyler chat --config my-agent-config.yaml
# or
tyler chat -c config.json
Create a tyler-config.yaml file:
# Agent Identity
name : "Tyler"
purpose : "To be a helpful AI assistant with access to various tools and capabilities."
notes : |
- Prefer clear, concise communication
- Use tools when appropriate to enhance responses
- Maintain context across conversations
# Model Configuration
model_name : "gpt-4o" # or any LiteLLM-compatible model
temperature : 0.7
max_tool_iterations : 10
# Tool Configuration
tools :
# Built-in tool modules
- "web" # Web search and browsing
- "files" # File operations
- "slack" # Slack integration
- "notion" # Notion integration
- "command_line" # System commands
- "image" # Image processing
- "audio" # Audio processing
# Custom tool files
- "./my_custom_tools.py"
- "~/tools/special_tool.py"
# MCP Server Configuration (optional)
# Connect to external docs, APIs, databases
# mcp:
# servers:
# - name: docs
# transport: sse
# url: https://docs.example.com/mcp
See the MCP Integration Guide for full MCP configuration options.
Environment variable substitution
Config files support environment variable substitution using ${VAR_NAME} syntax. This is useful for securely referencing API keys:
# Example: W&B Inference configuration
model_name : "openai/deepseek-ai/DeepSeek-R1-0528"
base_url : "https://api.inference.wandb.ai/v1"
api_key : "${WANDB_API_KEY}" # Reads from environment
extra_headers :
HTTP-Referer : "https://wandb.ai/my-team/my-project"
Never hardcode API keys in config files. Always use environment variables via ${VAR_NAME} syntax or store them in your .env file.
Command line options
# Specify a configuration file
tyler chat --config path/to/config.yaml
# Set an initial thread title
tyler chat --title "Research Session"
# Combine options
tyler chat -c my-config.yaml -t "Project Discussion"
Chat commands
During a chat session, you can use these special commands:
Command Description /helpShow available commands /quit or /exitExit the chat /newCreate a new conversation thread /threadsList all conversation threads /switch <id>Switch to a different thread /saveSave the current thread /clearClear the screen
Command examples
You: /threads
╭─────────────── Threads ───────────────╮
│ 1. Research Session (2 messages) │
│ 2. Code Review (5 messages) │
│ 3. Project Planning (3 messages) │
╰──────────────────────────────────────╯
You: /switch 2
Switched to thread: Code Review
You: /new
Created new thread: Untitled Thread
Features
Streaming responses
Tyler Chat displays responses in real-time as they’re generated, providing immediate feedback and a more interactive experience.
Thread persistence
Conversations are automatically saved and can be resumed later. By default, threads are stored in memory during the session.
Markdown support : Responses are rendered with proper formatting
Syntax highlighting : Code blocks are displayed with syntax colors
Structured output : Tables, lists, and other elements are properly formatted
When your agent uses tools, you’ll see real-time updates:
You: Search for the latest AI news
Agent: Let me search for the latest AI news for you.
[🔧 Using tool: web-search]
Here's what I found about the latest AI developments...
Advanced usage
Persistent storage
To enable persistent storage across sessions, set up a database:
# Set environment variable
export NARRATOR_DATABASE_URL = "sqlite:///tyler_chat.db"
# Then run tyler chat
tyler chat
Create a Python file with your custom tools:
# my_tools.py
from lye import tool
@tool
def calculate_compound_interest (
principal : float ,
rate : float ,
time : int ,
compounds_per_year : int = 12
) -> float :
"""Calculate compound interest"""
amount = principal * ( 1 + rate / compounds_per_year) ** (compounds_per_year * time)
return round (amount, 2 )
# Export tools
TOOLS = [calculate_compound_interest]
Then reference it in your config:
Environment variables
Tyler Chat respects these environment variables:
Variable Description OPENAI_API_KEYAPI key for OpenAI models ANTHROPIC_API_KEYAPI key for Anthropic models WANDB_API_KEYW&B API key (for W&B Inference or Weave tracking) WANDB_PROJECTW&B project for Weave tracking (optional - if not set, Weave won’t initialize) NARRATOR_DATABASE_URLDatabase URL for thread persistence
To enable Weave tracing for observability, set WANDB_PROJECT to your desired project name. If not set, the CLI runs without tracing overhead for faster startup.
Troubleshooting
Clean output mode
Tyler Chat automatically suppresses noisy output from third-party libraries. If you need to see debug information:
# Enable debug mode
TYLER_DEBUG = 1 tyler chat
Common issues
“Module not found” errors : Make sure all dependencies are installed:
API key errors : Ensure your API keys are set in environment variables or .env file
Database errors : Check your NARRATOR_DATABASE_URL is correctly formatted
Examples
Research assistant
# research-assistant-config.yaml
name : "Research Assistant"
purpose : "To help with in-depth research and analysis"
model_name : "gpt-4o"
tools :
- "web"
- "files"
notes : |
- Always cite sources
- Create organized reports
- Fact-check information
tyler chat -c research-assistant-config.yaml -t "Climate Research"
Code helper
# code-helper-config.yaml
name : "Code Helper"
purpose : "To assist with programming tasks"
temperature : 0.3 # Lower temperature for more consistent code
tools :
- "files"
- "command_line"
notes : |
- Write clean, well-commented code
- Follow best practices
- Include error handling
Quick project setup
Use tyler init to scaffold a complete project:
# Create a new research assistant project
tyler init research-bot --purpose "To help with academic research and paper analysis"
cd research-bot
# Set up environment
cp .env.example .env
# Edit .env with your API keys
# Start chatting with your configured agent
tyler chat --config tyler-config.yaml
Next steps
Build custom agents Learn to create agents programmatically
Add custom tools Extend agent capabilities with custom tools
Deploy to Slack Run your agent as a Slack bot
Advanced patterns Explore advanced agent patterns