Files
gstack/bin/gstack-platform-detect
Garry Tan 9ac662f6d2 refactor: setup tooling uses config-driven host detection
- host-config-export.ts: new CLI that exposes host configs to bash
  (list, get, detect, validate, symlinks commands)
- bin/gstack-platform-detect: reads host configs instead of hardcoded
  binary/path mapping
- scripts/skill-check.ts: iterates host configs for skill validation
  and freshness checks instead of separate Codex/Factory blocks
- lib/worktree.ts: iterates host configs for directory copy instead
  of hardcoded .agents

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-03 16:32:53 -07:00

28 lines
1.0 KiB
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
# gstack-platform-detect: show which AI coding agents are installed and gstack status
# Config-driven: reads host definitions from hosts/*.ts via host-config-export.ts
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
GSTACK_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
printf "%-16s %-10s %-40s %s\n" "Agent" "Version" "Skill Path" "gstack"
printf "%-16s %-10s %-40s %s\n" "-----" "-------" "----------" "------"
for host in $(bun run "$GSTACK_DIR/scripts/host-config-export.ts" list 2>/dev/null); do
cmd=$(bun run "$GSTACK_DIR/scripts/host-config-export.ts" get "$host" cliCommand 2>/dev/null)
root=$(bun run "$GSTACK_DIR/scripts/host-config-export.ts" get "$host" globalRoot 2>/dev/null)
spath="$HOME/$root"
if command -v "$cmd" >/dev/null 2>&1; then
ver=$("$cmd" --version 2>/dev/null | head -1 || echo "unknown")
if [ -d "$spath" ] || [ -L "$spath" ]; then
status="INSTALLED"
else
status="NOT INSTALLED"
fi
printf "%-16s %-10s %-40s %s\n" "$host" "$ver" "$spath" "$status"
fi
done