Getting Started with VT Code
June 17, 2026 · View on GitHub
Welcome to VT Code! This guide will help you get up and running with this Rust-based terminal coding agent that provides intelligent.
What Makes VT Code Special
VT Code represents a modern approach to AI-powered software development, featuring:
- Multi-Provider LLM Support - Gemini, OpenAI, Anthropic, DeepSeek, OpenRouter, Z.AI, Moonshot, StepFun, MiniMax, and more
- Enhanced Terminal Interface - Modern TUI with mouse support and text selection
- Advanced Code Intelligence - Tree-sitter parsers for 6+ programming languages
- Enterprise-Grade Safety - Comprehensive security controls and path validation
- Flexible Configuration - TOML-based configuration with granular policies
- Research-Preview Features - Cutting-edge agent coordination and context engineering
- Workspace-First Operations - Full read/write/command access within
WORKSPACE_DIRand built-in project indexing
Prerequisites
System Requirements
- Rust: 1.88+ (stable recommended)
- Install from rustup.rs
- Includes Cargo package manager
- Git: For version control and cloning the repository
- Operating System: macOS, Linux, or Windows (with WSL2)
For contributor workflow setup (tooling, checks, and test loop), use the canonical Development Setup guide.
API Requirements
Choose one of the supported LLM providers:
-
Gemini (Primary):
export GEMINI_API_KEY=your_key_hereorexport GOOGLE_API_KEY=your_key_here- Get from Google AI Studio
-
OpenAI:
export OPENAI_API_KEY=your_key_here- Get from OpenAI Platform
-
Anthropic:
export ANTHROPIC_API_KEY=your_key_here- Get from Anthropic Console
-
Z.AI:
export ZAI_API_KEY=your_key_here- Get from Z.AI Platform
- Models: GLM-5.2, GLM-5.1, GLM-4.7
-
Moonshot (Kimi):
export MOONSHOT_API_KEY=your_key_here- Get from Moonshot Platform
- Models: Kimi K2.7 Code, K2.6, K2.5
-
StepFun:
export STEPFUN_API_KEY=your_key_here- Get from StepFun Platform
- Models: Step-3.7-Flash
-
MiniMax:
export MINIMAX_API_KEY=your_key_here- Get from MiniMax Platform
- Models: MiniMax-M3, M2.7, M2.5
For more providers, see the Provider Guides.
Installation
Option 1: Direct Download (Recommended)
# Clone the repository
git clone https://github.com/vinhnx/vtcode.git
cd vtcode
# Build the project
cargo build --release
# The binary will be available at target/release/vtcode
Option 2: Using Provided Scripts
# Clone and build using the production script
git clone https://github.com/vinhnx/vtcode.git
cd vtcode
# Build and run in production mode
./scripts/run.sh
# Or build and run in development mode
./scripts/run-debug.sh
Option 3: Cargo Install (Future)
# When published to crates.io
cargo install vtcode
# Optional: install search dependencies after VT Code is on PATH
vtcode dependencies install search-tools
Quick Start
1. Set Your API Key
# For Gemini (recommended)
export GEMINI_API_KEY=your_api_key_here
# For OpenAI
export OPENAI_API_KEY=your_api_key_here
# For Anthropic
export ANTHROPIC_API_KEY=your_api_key_here
2. Confirm Workspace Context
WORKSPACE_DIR tells VT Code which project folder to treat as its primary context. The CLI sets this automatically when you launch inside a directory, but you can override or verify it explicitly:
# Confirm the workspace root
echo "Workspace: $WORKSPACE_DIR"
# Override if you need to target a different project
export WORKSPACE_DIR="/path/to/your/project"
# One-off override when launching commands
vtcode chat --workspace-dir /path/to/your/project
vtcode /path/to/your/project
3. Initialize VT Code in Your Project
# Navigate to your project
cd /path/to/your/project
# Initialize VT Code (creates vtcode.toml and .vtcodegitignore)
../vtcode/target/release/vtcode init
4. Start Your First Session
# Start interactive chat
../vtcode/target/release/vtcode chat
Resume Previous Sessions
- Run
vtcode --resumeto open an interactive picker of recent sessions, orvtcode --resume <SESSION_ID>to jump directly to a known session. - Use
vtcode --continueto resume the most recent session automatically without picking from the list. - These flags are global; do not append a subcommand (for example,
vtcode chat --resumeis rejected). Resume or continue first, then start a new command if needed.
Enhanced Terminal Interface
VT Code now features a completely revamped terminal user interface with numerous enhancements:
Visual Improvements
- Modern, clean interface with rounded borders and improved styling
- Customizable color themes with Catppuccin color palette integration
- Enhanced message formatting with distinct markers for different message types
- Color-coded tool banners highlight execution summaries, detailed output, and MCP status updates
- Real-time command output display with proper ANSI color support
Interaction Features
- Full mouse support for scrolling and text selection
- Interactive text selection with click-and-drag functionality
- Improved input area with placeholder text ("Implement {feature}...")
- Slash command auto-suggestions for quick access to built-in commands
Terminal Command Support
- Real-time PTY (pseudo-terminal) integration for running shell commands
- Dedicated terminal output panels with command summaries
- Streaming output display for long-running processes
- Proper handling of ANSI escape sequences and colors
Navigation & Controls
- Smooth scrolling with mouse wheel and keyboard shortcuts
- Page navigation with Page Up/Down keys
- Dedicated status bar with contextual information
- Clear exit and cancel controls (Esc key)
Configuration
Quick Slash Commands
During chat you can lead with / to trigger built-in actions without leaving the session:
-
/help— list supported commands -
/theme <id>— switch the active theme -
/command <program> [args...]— run a shell command viaunified_exec -
/agents— create, inspect, edit, or delete subagent definitions with VT Code-native frontmatter -
/agent— inspect delegated child threads in the current session
Press Tab on an empty idle composer to cycle primary agents. The active primary agent appears in the session header badge and controls the session's instructions, model, granular permission policy, and tool access.
Slash commands execute immediately and respect the same tool policies configured in vtcode.toml.
For delegated child-agent workflows and primary agents, see the dedicated Subagents guide. Primary agents (mode: primary or mode: all) control the main session directly; subagents (mode: subagent or mode: all) are spawned as child threads via @agent-name. New .vtcode/agents/*.md files should use VT Code tool ids such as read_file, list_files, unified_search, and unified_exec, not Claude-style names like Read or Bash.
VT Code uses a comprehensive TOML configuration system. The init command creates a vtcode.toml file with sensible defaults.
Basic Configuration
# Agent settings
[agent]
provider = "openai" # or anthropic, google, deepseek, etc.
default_model = "gpt-5.4" # Your preferred model
max_conversation_turns = 150
# Security settings
[features]
human_in_the_loop = true # enable human-in-the-loop tool approval
# Tool policies
[tools]
default_policy = "prompt"
[tools.policies]
unified_search = "allow"
unified_exec = "prompt"
apply_patch = "prompt"
Advanced Configuration
# Command permissions
[commands]
allow_list = ["ls", "pwd", "cat", "git status", "cargo check"]
deny_list = ["rm -rf", "sudo rm", "shutdown"]
# PTY settings
[pty]
enabled = true
default_rows = 24
default_cols = 80
command_timeout_seconds = 300
# Lifecycle hooks - Execute shell commands in response to agent events
# For comprehensive examples and setup, see: ../../guides/lifecycle-hooks.md
[hooks.lifecycle]
# Example: Run security validation before bash commands
pre_tool_use = [
{
matcher = "Bash",
hooks = [
{
command = "$VT_PROJECT_DIR/.vtcode/hooks/security-check.sh",
timeout_seconds = 10
}
]
}
]
Session Onboarding
VT Code opens each chat with a workspace-specific orientation generated by the context engine. Configure it with the [agent.onboarding] section:
[agent.onboarding]
enabled = true
intro_text = "Welcome! I preloaded workspace context so you can focus on decisions."
include_project_overview = true
include_language_summary = true
include_guideline_highlights = true
guideline_highlight_limit = 4
usage_tips = [
"Share the outcome you need or ask for a quick /status summary.",
"Reference AGENTS.md expectations before changing files.",
"Draft or refresh your TODOs with task_tracker before editing.",
"Prefer targeted reads and unified_search (grep or structural) before editing.",
]
recommended_actions = [
"Outline a 3-6 step TODO plan via task_tracker before coding.",
"Request a workspace orientation or describe the task you want to tackle.",
"Confirm priorities or blockers so I can suggest next steps.",
]
# chat_placeholder = "Describe the task you want to tackle next."
When enabled, VT Code prints the onboarding message before the first prompt and appends the same context block to the system prompt for the model. Provide chat_placeholder only if you want a custom hint above the initial > prompt; leaving it unset keeps the input empty by default.
Terminal parity extras
- Enable Vim-style prompt editing persistently with:
[ui]
vim_mode = true
- Use
/vimto toggle Vim mode for the current session only. - Use
/statuslineto generate a custom status-line command in either your user config or the current workspace. - Use
hooks.lifecycle.notificationif you want shell hooks forpermission_promptoridle_promptnotifications.
Usage Examples
Basic Chat Session
vtcode chat
The agent will greet you and await your instructions. Try asking:
- "Analyze this codebase"
- "Add error handling to the user authentication"
- "Refactor this function to be more readable"
- "Create a new API endpoint for user registration"
Command Line Queries
For quick questions or piping to other tools, use the ask command:
vtcode ask "Write a Python function to calculate Fibonacci numbers" > fib.py
Note: vtcode ask sends the raw response code/text to stdout, while sending metadata (provider info, reasoning traces) to stderr. This makes it perfect for shell scripting and piping.
Project Analysis
# Comprehensive project analysis
vtcode analyze
# Get detailed information
vtcode info
# Generate project summary
vtcode summary
Understanding the Agents
Orchestrator Agent
- Role: Strategic coordinator and task planner
- Capabilities: Task decomposition, agent delegation, progress tracking
- Use for: Complex multi-step tasks requiring coordination
Explorer Agent
- Role: Investigation and verification specialist
- Capabilities: Code analysis, system exploration, testing
- Use for: Understanding codebases, verifying implementations
Coder Agent
- Role: Implementation specialist
- Capabilities: Code writing, refactoring, debugging
- Use for: Making code changes, adding features, fixing bugs
Advanced Features
Context Engineering
VT Code automatically manages conversation context:
- Intelligent compression of long conversations
- Persistent context store across sessions
- Automatic summarization of completed tasks
- Context-aware responses based on full history
Safety Features
Comprehensive security controls:
- Path validation - Prevents access outside workspace
- Command policies - Allow/deny lists for terminal commands
- Human-in-the-loop - Confirmation for dangerous operations
- File size limits - Prevents processing of large files
- API key masking - Secure credential handling
Tool Integration
Rich tool ecosystem:
- File Operations: Read, write, edit files safely
- Search & Analysis: Fast text search and AST-based analysis
- Terminal Commands: Execute shell commands with PTY support
- Code Intelligence: Tree-sitter powered syntax analysis
- Batch Operations: Process multiple files efficiently
Troubleshooting
Common Issues
API Key Not Set
# Check if API key is set
echo $GEMINI_API_KEY
# Set the API key
export GEMINI_API_KEY=your_key_here
Configuration Issues
# Validate configuration
vtcode config --validate
# Reset to defaults
vtcode config --reset
Build Issues
# Clean and rebuild
cargo clean
cargo build --release
# Check Rust version
rustc --version
cargo --version
Getting Help
- Documentation: Comprehensive guides in
docs/directory - GitHub Issues: Report bugs and request features
- GitHub Discussions: Community support and discussions
- Configuration Examples: Check
vtcode.toml.example
Security & Safety
VT Code is designed with security as a first-class concern:
Built-in Security Features
- Execution Policy - Only 9 safe commands allowed by default
- Argument Validation - Blocks dangerous flags like
--pre,-exec,-e - Workspace Isolation - All operations confined to workspace boundaries
- Human-in-the-Loop - Three-tier approval system for tool execution
- Sandbox Integration - Optional Anthropic sandbox for network commands
Security Best Practices
- Review Tool Approvals - Check
~/.config/vtcode/tool_policy.tomlregularly - Use "Approve Once" - For unfamiliar operations, don't auto-approve
- Enable Sandbox - For network commands, configure sandbox policy
- Monitor Logs - Review
.vtcode/logs/for suspicious activity - Be Cautious - Don't process code from untrusted sources
Learn More
- Security Guide - Complete security documentation
- Security Model - Architecture and threat model
- Tool Policies - Command execution policies
Next Steps
Now that you have VT Code running, explore:
- Security Guide - Understand security features
- Lifecycle Hooks Guide - Execute shell commands in response to agent events for context enrichment, policy enforcement, and automation
- Configuration Guide - Advanced configuration options and precedence rules
- Architecture Guide - System design and components
- Provider Guides - LLM provider integration
Contributing
Interested in contributing? Check out:
- Development Guide - Development setup
- Contributing Guide - Contribution guidelines
Happy coding with VT Code!