Files
cli/tools/detect-clis.sh
2026-08-21 13:08:43 +08:00

17 lines
598 B
Bash
Executable File
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/usr/bin/env sh
# detect-clis.sh — 找出已安裝的 AI CLI 工具與執行檔路徑。
# 輸出(TSV): name<TAB>path<TAB>version(未安裝的不輸出)
# 支援: claude / codex / copilot / antigravity(agy) / kiro
set -u
probe() { # $1=顯示名 $2=執行檔名 $3=版本參數
p=$(command -v "$2" 2>/dev/null) || return 0
v=$("$p" "$3" 2>/dev/null | head -n1 | tr -d '\r') || v=""
printf '%s\t%s\t%s\n' "$1" "$p" "$v"
}
probe claude claude --version
probe codex codex --version
probe copilot copilot --version
probe antigravity agy --version
probe kiro kiro-cli --version
exit 0