class Vtcode < Formula
desc "Rust-based terminal coding agent with semantic code intelligence"
homepage "https://github.com/vinhnx/vtcode"
license "MIT"
version "0.99.1"
on_macos do
if Hardware::CPU.arm?
url "https://github.com/vinhnx/vtcode/releases/download/#{version}/vtcode-#{version}-aarch64-apple-darwin.tar.gz"
sha256 "1897ffe8f564567acd56e8f09c5f379867b6aef5a8575fc657ba91ca92f53d6a"
else
url "https://github.com/vinhnx/vtcode/releases/download/#{version}/vtcode-#{version}-x86_64-apple-darwin.tar.gz"
sha256 "698d56bb8a08cbca5518ff24418cea8f5a9232cdc389aa06f2897ca4a6c676e0"
end
end
on_linux do
if Hardware::CPU.arm? && Hardware::CPU.is_64_bit?
url "https://github.com/vinhnx/vtcode/releases/download/#{version}/vtcode-#{version}-aarch64-unknown-linux-gnu.tar.gz"
sha256 "a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0u1v2w3x4y5z6a7b8c9d0e1f"
else
url "https://github.com/vinhnx/vtcode/releases/download/#{version}/vtcode-#{version}-x86_64-unknown-linux-gnu.tar.gz"
sha256 "b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0u1v2w3x4y5z6a7b8c9d0e1f2g"
end
end
def install
bin.install "vtcode"
end
def caveats
<<~EOS
VT Code is now installed! To get started:
1. Set your API key environment variable:
export OPENAI_API_KEY="sk-..."
(or use ANTHROPIC_API_KEY, GEMINI_API_KEY, etc.)
2. Launch VT Code:
vtcode
Supported providers:
• OpenAI (OPENAI_API_KEY)
• Anthropic (ANTHROPIC_API_KEY)
• Google Gemini (GEMINI_API_KEY)
• xAI (XAI_API_KEY)
• DeepSeek (DEEPSEEK_API_KEY)
• OpenRouter (OPENROUTER_API_KEY)
• Ollama (local)
For more information, visit:
https://github.com/vinhnx/vtcode
EOS
end
test do
assert_match version.to_s, shell_output("#{bin}/vtcode --version")
end
end