Welcome to VT Code! This guide will help you get up and running with this Rust-based terminal coding agent that provides intelligent.
VT Code represents a modern approach to AI-powered software development, featuring:
- Multi-Provider LLM Support - Gemini, OpenAI, Anthropic integration
- 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
- Rust: 1.75+ (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.
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
# 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/vtcodeGitHub release archives may also include an optional ghostty-vt/ sidecar directory for enhanced PTY snapshots. VT Code still runs without it and falls back to legacy_vt100.
# 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# When published to crates.io
cargo install vtcode
# Optional: install search dependencies after VT Code is on PATH
vtcode dependencies install search-tools# 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_hereWORKSPACE_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# Navigate to your project
cd /path/to/your/project
# Initialize VT Code (creates vtcode.toml and .vtcodegitignore)
../vtcode/target/release/vtcode init# Start interactive chat
../vtcode/target/release/vtcode chat- 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.
VT Code now features a completely revamped terminal user interface with numerous enhancements:
- 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
- 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
- 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
- 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)
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
Slash commands execute immediately and respect the same tool policies configured in vtcode.toml.
VT Code uses a comprehensive TOML configuration system. The init command creates a vtcode.toml file with sensible defaults.
# Agent settings
[agent]
model = "gemini-3-flash-preview" # Your preferred model
max_conversation_turns = 1000
verbose_logging = false
# Security settings
[security]
human_in_the_loop = true
confirm_destructive_actions = true
max_file_size_mb = 50
# Tool policies
[tools]
default_policy = "prompt"
[tools.policies]
unified_search = "allow"
unified_exec = "prompt"
apply_patch = "prompt"# 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
emulation_backend = "ghostty" # or "legacy_vt100"
# 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
}
]
}
]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.
- 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.
vtcode chatThe 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"
For quick questions or piping to other tools, use the ask command:
vtcode ask "Write a Python function to calculate Fibonacci numbers" > fib.pyNote: 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.
# Comprehensive project analysis
vtcode analyze
# Get detailed information
vtcode info
# Generate project summary
vtcode summary- Role: Strategic coordinator and task planner
- Capabilities: Task decomposition, agent delegation, progress tracking
- Use for: Complex multi-step tasks requiring coordination
- Role: Investigation and verification specialist
- Capabilities: Code analysis, system exploration, testing
- Use for: Understanding codebases, verifying implementations
- Role: Implementation specialist
- Capabilities: Code writing, refactoring, debugging
- Use for: Making code changes, adding features, fixing bugs
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
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
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
# Check if API key is set
echo $GEMINI_API_KEY
# Set the API key
export GEMINI_API_KEY=your_key_here# Validate configuration
vtcode config --validate
# Reset to defaults
vtcode config --reset# Clean and rebuild
cargo clean
cargo build --release
# Check Rust version
rustc --version
cargo --version- 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
VT Code is designed with security as a first-class concern:
- 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
- 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 mode
- Monitor Logs - Review
.vtcode/logs/for suspicious activity - Be Cautious - Don't process code from untrusted sources
- Security Guide - Complete security documentation
- Security Model - Architecture and threat model
- Tool Policies - Command execution policies
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
Interested in contributing? Check out:
- Development Guide - Development setup
- Contributing Guide - Contribution guidelines
- Code Standards - Coding conventions
Happy coding with VT Code!