Information for VT Code maintainers and contributors.
VT Code provides native installers for three platforms:
- Shell script (macOS, Linux) -
scripts/install.sh - PowerShell script (Windows) -
scripts/install.ps1 - Homebrew formula -
homebrew/vtcode.rb
- Uses
uname -sfor OS (Darwin, Linux, etc.) - Uses
uname -mfor arch (x86_64, arm64, aarch64, armv7l) - Maps to release binary:
ARCH-PLATFORM(e.g.,x86_64-apple-darwin)
- Uses
[Environment]::Is64BitProcessfor 64-bit detection - Uses WMI
Get-WmiObject Win32_Processorfor ARM64 detection - Maps to:
x86_64-pc-windows-msvc
Required for installation. Must be generated for all platforms:
vtcode-v{VERSION}-{PLATFORM}.tar.gz (macOS, Linux, etc.)
vtcode-v{VERSION}-{PLATFORM}.zip (Windows)
aarch64-apple-darwin(macOS ARM64/M1/M2)x86_64-apple-darwin(macOS Intel)aarch64-unknown-linux-gnu(Linux ARM64)x86_64-unknown-linux-gnu(Linux x86_64)armv7-unknown-linux-gnueabihf(Linux ARMv7)x86_64-pc-windows-msvc(Windows)
Installers expect binaries at:
https://github.com/vinhnx/vtcode/releases/download/v{VERSION}/{BINARY}
Example CI/CD for cross-platform builds:
name: Release
on:
push:
tags:
- 'v*'
jobs:
build:
strategy:
matrix:
include:
- os: macos-latest
target: x86_64-apple-darwin
- os: macos-latest
target: aarch64-apple-darwin
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
- os: ubuntu-latest
target: aarch64-unknown-linux-gnu
- os: windows-latest
target: x86_64-pc-windows-msvc
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Build
run: cargo build --release --target ${{ matrix.target }}
- name: Package
run: |
if [ "$RUNNER_OS" = "Windows" ]; then
7z a vtcode-v${{ github.ref_name }}-${{ matrix.target }}.zip \
target/${{ matrix.target }}/release/vtcode.exe
else
tar -czf vtcode-v${{ github.ref_name }}-${{ matrix.target }}.tar.gz \
-C target/${{ matrix.target }}/release vtcode
fi
- name: Upload
uses: softprops/action-gh-release@v1
with:
files: vtcode-v*bash scripts/install.sh
# Verify
vtcode --versionbash scripts/install.sh
vtcode --version# Test on Linux
docker run -it --rm ubuntu:latest bash -c \
'apt-get update && apt-get install -y curl && \
bash <(curl -fsSL file:///path/to/install.sh)'.\scripts\install.ps1
vtcode --versionpwsh -File scripts/install.ps1
vtcode --version# Test locally
brew install --verbose --formula ./homebrew/vtcode.rb
vtcode --version
# Uninstall
brew uninstall vtcode- Create release on GitHub with tag
v{VERSION} - Upload binary artifacts for all platforms
- Note the SHA256 hashes
Edit homebrew/vtcode.rb:
class Vtcode < Formula
version "X.Y.Z"
on_macos do
if Hardware::CPU.arm?
url "https://github.com/vinhnx/vtcode/releases/download/v#{version}/vtcode-v#{version}-aarch64-apple-darwin.tar.gz"
sha256 "HASH_HERE"
else
url "https://github.com/vinhnx/vtcode/releases/download/v#{version}/vtcode-v#{version}-x86_64-apple-darwin.tar.gz"
sha256 "HASH_HERE"
end
end
on_linux do
if Hardware::CPU.arm? && Hardware::CPU.is_64_bit?
url "https://github.com/vinhnx/vtcode/releases/download/v#{version}/vtcode-v#{version}-aarch64-unknown-linux-gnu.tar.gz"
sha256 "HASH_HERE"
else
url "https://github.com/vinhnx/vtcode/releases/download/v#{version}/vtcode-v#{version}-x86_64-unknown-linux-gnu.tar.gz"
sha256 "HASH_HERE"
end
end
endGet SHA256:
shasum -a 256 vtcode-v*.tar.gz
shasum -a 256 vtcode-v*.zipIf using a personal tap (github.com/vinhnx/homebrew-vtcode):
cd ~/homebrew-vtcode
cp ../vtcode/homebrew/vtcode.rb Formula/
git add Formula/vtcode.rb
git commit -m "Update VT Code to v{VERSION}"
git pushTest on each platform:
# macOS/Linux
curl -fsSL https://raw.githubusercontent.com/vinhnx/vtcode/main/scripts/install.sh | bash
vtcode --version
# Windows
irm https://raw.githubusercontent.com/vinhnx/vtcode/main/scripts/install.ps1 | iex
vtcode --version
# Homebrew
brew install vtcode
vtcode --versionKey functions:
detect_platform()- Determine OS and architecturecheck_existing()- Check if already installedget_latest_version()- Query GitHub APIdownload_binary()- Download and extractdetermine_install_path()- Find best installation locationinstall_binary()- Copy binary and make executableverify_installation()- Run vtcode --versionprint_next_steps()- Show post-install guidance
Error handling: set -e (exit on error)
Key functions:
Get-PlatformInfo- Detect architectureTest-ExistingInstallation- Check if already installedGet-LatestVersion- Query GitHub APIGet-Binary- Download binaryExpand-Binary- Extract binaryGet-InstallDirectory- Find best locationInstall-Binary- Copy and verifyAdd-ToPATH- Configure PATHTest-Installation- Verify installationCleanup-TempFiles- Remove temp files
Error handling: $ErrorActionPreference = "Stop"
Check if GitHub API is accessible:
curl https://api.github.com/repos/vinhnx/vtcode/releases/latestTest detection logic:
# Shell
uname -s
uname -m
# PowerShell
[Environment]::Is64BitProcess
Get-WmiObject Win32_Processor | Select ArchitectureVerify PATH after installation:
# Shell
echo $PATH
# PowerShell
$env:PATHUser-facing docs:
docs/installation/README.md- Main installation guidedocs/installation/QUICK_REFERENCE.md- Quick commandsdocs/installation/NATIVE_INSTALLERS.md- Technical details
This file:
docs/installation/DEVELOPERS.md- Maintainer guide
Ensure binaries are uploaded to GitHub Releases for all platforms. Check:
curl https://api.github.com/repos/vinhnx/vtcode/releases/latest | jq '.assets'Regenerate SHA256:
shasum -a 256 vtcode-v*.tar.gzUpdate formula with new hashes.
Make sure installers are executable:
chmod +x scripts/install.sh scripts/install.ps1Users might need to set execution policy:
Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope ProcessThe script handles this in comments.
- Auto-generated SHA256 - Update formula automatically on release
- Signature verification - Sign binaries and verify in installers
- Rollback support - Install/downgrade specific versions
- Delta updates - Only download changed binary segments
- Cached downloads - Distribute via CDN or mirrors