This directory contains scripts to help with development, testing, and maintaining the vtcode codebase.
Sets up the complete development environment with all necessary tools.
# Basic setup
./scripts/setup.sh
# Setup with git hooks
./scripts/setup.sh --with-hooks
# Show help
./scripts/setup.sh --helpWhat it does:
- Checks Rust installation
- Updates Rust toolchain
- Installs rustfmt and clippy components
- Installs development tools (cargo-audit, cargo-outdated, etc.)
- Optionally sets up git hooks
- Verifies everything works
Runs comprehensive code quality checks (same as CI pipeline).
# Run all checks
./scripts/check.sh
# Run specific checks
./scripts/check.sh fmt # Format check only
./scripts/check.sh clippy # Clippy check only
./scripts/check.sh test # Tests only
./scripts/check.sh build # Build only
./scripts/check.sh docs # Documentation only
# Show help
./scripts/check.sh helpChecks performed:
- Code formatting (rustfmt)
- Linting (clippy)
- Build verification
- Test execution
- Documentation generation
Creates multi-crate releases for VT Code using cargo-release.
# Create a specific version release
./scripts/release.sh 1.0.0
# Create patch release (increment patch version)
./scripts/release.sh --patch
# Create minor release (increment minor version)
./scripts/release.sh --minor
# Create major release (increment major version)
./scripts/release.sh --major
# Dry run to see what would happen
./scripts/release.sh --patch --dry-run
# Show help
./scripts/release.sh --helpWhat it does:
- Delegates version management, tagging, pushing, and changelog updates to
cargo release - Keeps
vtcodeandvtcode-coreversions in sync and updatesnpm/package.json - Creates GitHub releases populated with the relevant changelog section
- Publishes crates to crates.io (unless
--skip-cratesis provided) - Optionally publishes to npm and builds Homebrew binaries
Prerequisites:
- Must be on
mainbranch with a clean working tree - Requires GitHub repository access and
cargo-releaseinstalled (cargo install cargo-release) CHANGELOG.mdentries follow the expected format (Unreleased + sections)- Logged in to crates.io (
cargo login) and npm (npm login) when publishing
Release Process:
- Pre-flight checks: Verifies branch, working tree, and authentication
- cargo-release execution: Runs
cargo releasewith workspace configuration fromrelease.toml - Git operations:
cargo releasecommits, tags, pushes, and updatesCHANGELOG.md - Distribution: Publishes crates, optionally publishes npm package, triggers docs.rs rebuild, and builds binaries
- GitHub Release:
cargo releaseuploads release notes using the generated changelog section
Recent Updates:
- Fixed changelogithub CLI compatibility issues by switching to the official GitHub Action
- Added proper workflow permissions for release creation
- Improved error handling and debugging information
For new developers:
-
Clone the repository
git clone <repository-url> cd vtcode
-
Set up development environment
./scripts/setup.sh --with-hooks
-
Configure API keys (optional)
Create a
.envfile in the project root to store your API keys:# .env file GEMINI_API_KEY=your_gemini_api_key_here ANTHROPIC_API_KEY=your_anthropic_api_key_here OPENAI_API_KEY=your_openai_api_key_here -
Run code quality checks
./scripts/check.sh
-
Start developing!
cargo build cargo nextest run
vtcode supports multiple ways to configure API keys, with the following priority:
- Environment variables (highest priority) - Most secure
- .env file - Convenient for development
- Configuration file (vtcode.toml) - Least secure, but convenient
Example .env file:
GEMINI_API_KEY=your_gemini_api_key_here
ANTHROPIC_API_KEY=your_anthropic_api_key_here
OPENAI_API_KEY=your_openai_api_key_hereExample vtcode.toml configuration:
[agent]
gemini_api_key = "your_gemini_api_key_here"
anthropic_api_key = "your_anthropic_api_key_here"
openai_api_key = "your_openai_api_key_here"These scripts run the same checks as our GitHub Actions workflows:
ci.yml- Main CI pipelinecode-quality.yml- Code quality checksdevelopment.yml- Development workflownightly.yml- Nightly builds
When you run ./scripts/setup.sh --with-hooks, a pre-commit hook is created that will:
- Check code formatting with rustfmt
- Run clippy linting
- Prevent commits if issues are found
The hook can be bypassed with git commit --no-verify if needed.
You can modify these scripts to fit your development workflow:
- Add additional tools to
setup.sh - Modify check criteria in
check.sh - Customize git hooks for your team
chmod +x scripts/*.shMake sure Rust is installed:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source ~/.cargo/envSome tools might require additional dependencies:
# For cargo-tarpaulin (code coverage)
sudo apt-get install libssl-dev pkg-config
# For cargo-udeps (unused dependencies)
rustup install nightly