Files
juliusbrussee__caveman/scripts/install-local-cli.ps1
T
Julius Brussee 82864c8f4c feat: ship Caveman 2.0.0 — engine, proxy, SDKs, unified CLI
Single-commit port of the Caveman 2 tree onto the original repo history
(candidate caveman-2@88878a4 applied over main@3098342). No unrelated-history
merge; original history untouched.

Preserved v1 surfaces:
- skills/caveman/SKILL.md byte-for-byte, plus plugin mirror and caveman.skill zip
- legacy CI (Node 18/20/22 installer + Python 3.11 suites) alongside engine-ci
- cli/install.js compatibility shim forwarding to bin/install.js
- .codex/config.toml ships both hooks and codex_hooks for older Codex (#617)
- README Trendshift + Skills.sh badges and local star-history asset
- v1.10.0-pinned curl installs; benchmarks/tmp-starcharts ignore rules

Fixed for public same-repo release:
- SECURITY.md vulnerability reporting points at this repository
- release-binaries.yml publishes to this repo via job-scoped GITHUB_TOKEN
  (cross-repo PAT removed); binary-release environment still gates signing
- packages/cli/PUBLISHING.md rewritten for packages/ layout and same-repo flow
- profile-contract and provider-catalog lanes skip lane-scope gates on
  initial import so the launch PR can gate on their real validation steps
- ANNOUNCEMENT.md network claim corrected: compression is local; requests
  still go to the provider you configured

Caveman 2 stays opt-in: bin-v1.0.0 binaries and @caveman-ai/cli publish
separately after this lands and soaks.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BLvb5QniwYjmcawyssQNw9
2026-08-11 16:46:10 +02:00

87 lines
2.6 KiB
PowerShell

[CmdletBinding()]
param(
[switch]$NoLink
)
$ErrorActionPreference = "Stop"
$RepoRoot = Split-Path -Parent $PSScriptRoot
if (Test-Path (Join-Path $RepoRoot "public/cli")) {
$CliDir = Join-Path $RepoRoot "public/cli"
$StackRoot = Join-Path $RepoRoot "public"
} elseif (Test-Path (Join-Path $RepoRoot "packages/cli")) {
$CliDir = Join-Path $RepoRoot "packages/cli"
$StackRoot = $RepoRoot
} elseif (Test-Path (Join-Path $RepoRoot "cli")) {
$CliDir = Join-Path $RepoRoot "cli"
$StackRoot = $RepoRoot
} else {
throw "Caveman CLI source not found"
}
$Dist = Join-Path $CliDir "dist/index.js"
if (-not (Test-Path $Dist)) {
if (-not (Get-Command pnpm -ErrorAction SilentlyContinue)) {
throw "$Dist missing and pnpm not found. Install pnpm and re-run."
}
Write-Host "building CLI ($CliDir)"
Push-Location $CliDir
try {
& pnpm install --silent
if ($LASTEXITCODE -ne 0) { throw "pnpm install failed with exit code $LASTEXITCODE" }
& pnpm build
if ($LASTEXITCODE -ne 0) { throw "pnpm build failed with exit code $LASTEXITCODE" }
} finally {
Pop-Location
}
}
if (-not $NoLink) {
if (-not (Get-Command npm -ErrorAction SilentlyContinue)) {
throw "npm not found. Install Node.js >=18 and re-run."
}
Push-Location $CliDir
try {
& npm link
if ($LASTEXITCODE -ne 0) { throw "npm link failed with exit code $LASTEXITCODE" }
} finally {
Pop-Location
}
Write-Host "linked cave + caveman through npm"
}
$Go = Get-Command go -ErrorAction SilentlyContinue
if (-not $Go) {
Write-Warning "Go toolchain not found; skipped six runtime companions. CLI remains installed and reports missing capabilities."
exit 0
}
$CavemanHome = if ($env:CAVEMAN_HOME) {
$env:CAVEMAN_HOME
} elseif ($env:USERPROFILE) {
Join-Path $env:USERPROFILE ".caveman"
} else {
Join-Path ([Environment]::GetFolderPath("UserProfile")) ".caveman"
}
$BinDir = Join-Path $CavemanHome "bin"
New-Item -ItemType Directory -Force -Path $BinDir | Out-Null
$Binaries = [ordered]@{
"caveman-proxy" = "proxy/cmd/caveman-proxy"
"caveman-engine" = "engine/cmd/caveman-engine"
"caveman-mcp" = "mcp/cmd/caveman-mcp"
"cavemem" = "mem/cmd/cavemem"
"caveman-browse" = "browse/cmd/caveman-browse"
"caveman-shrink" = "shrink/cmd/caveman-shrink"
}
Write-Host "building Go binaries into $BinDir"
foreach ($Entry in $Binaries.GetEnumerator()) {
$Output = Join-Path $BinDir "$($Entry.Key).exe"
$Package = Join-Path $StackRoot $Entry.Value
& go build -o $Output $Package
if ($LASTEXITCODE -ne 0) { throw "go build failed for $($Entry.Key) with exit code $LASTEXITCODE" }
}
Write-Host "done - try: caveman claude"