vibe-coding.sh
· 1.5 KiB · Bash
Ham
#!/usr/bin/env bash
log() {
# 蓝色粗体
printf "\033[1;34m[INFO]\033[0m %s\n" "$*" >&2
}
warn() {
# 黄色
printf "\033[1;33m[WARN]\033[0m %s\n" "$*" >&2
}
error() {
# 红色
printf "\033[1;31m[ERROR]\033[0m %s\n" "$*" >&2
}
success() {
printf "\033[1;32m[SUCCESS]\033[0m %s\n" "$*" >&2
}
sep() {
printf "\033[1;35m========== %s ==========\033[0m\n" "$*" >&2
}
npm_packages() {
packages=(
"@openai/codex"
"@google/gemini-cli"
"@iflow-ai/iflow-cli"
"@qwen-code/qwen-code"
"@tencent-ai/codebuddy-code"
"@musistudio/claude-code-router"
)
echo
for pkg in "${packages[@]}"; do
sep "Installing $pkg"
npm install -g "$pkg"
success "$pkg"
done
}
spec() {
echo
sep "Installing @fission-ai/openspec"
npm install -g @fission-ai/openspec
success "@fission-ai/openspec"
sep "Installing spec-kit"
uv tool install specify-cli --from git+https://github.com/github/spec-kit.git
success "spec-kit"
}
binary_list() {
urls=(
"https://opencode.ai/install"
"https://filetas.asfd.cn/claude.ai/install.sh"
)
echo
for url in "${urls[@]}"; do
echo
log "curl -L fx4.cn/x | bash -s -- $url | bash"
curl -L fx4.cn/x | bash -s -- "$url" | bash
done
}
fix_tools_claude() {
set -- ~/.claude/downloads/claude-*-linux-x64
if [ -f "$1" ]; then
if "$1" --version 2>/dev/null | grep -q "Claude"; then
mv "$1" ~/.local/bin/claude
fi
fi
}
fix_tools() {
# fix_tools_claude
echo
}
main() {
npm_packages
spec
binary_list
fix_tools
}
main "$@"
| 1 | #!/usr/bin/env bash |
| 2 | |
| 3 | log() { |
| 4 | # 蓝色粗体 |
| 5 | printf "\033[1;34m[INFO]\033[0m %s\n" "$*" >&2 |
| 6 | } |
| 7 | |
| 8 | warn() { |
| 9 | # 黄色 |
| 10 | printf "\033[1;33m[WARN]\033[0m %s\n" "$*" >&2 |
| 11 | } |
| 12 | |
| 13 | error() { |
| 14 | # 红色 |
| 15 | printf "\033[1;31m[ERROR]\033[0m %s\n" "$*" >&2 |
| 16 | } |
| 17 | |
| 18 | success() { |
| 19 | printf "\033[1;32m[SUCCESS]\033[0m %s\n" "$*" >&2 |
| 20 | } |
| 21 | |
| 22 | sep() { |
| 23 | printf "\033[1;35m========== %s ==========\033[0m\n" "$*" >&2 |
| 24 | } |
| 25 | |
| 26 | npm_packages() { |
| 27 | packages=( |
| 28 | "@openai/codex" |
| 29 | "@google/gemini-cli" |
| 30 | "@iflow-ai/iflow-cli" |
| 31 | "@qwen-code/qwen-code" |
| 32 | "@tencent-ai/codebuddy-code" |
| 33 | "@musistudio/claude-code-router" |
| 34 | ) |
| 35 | |
| 36 | echo |
| 37 | for pkg in "${packages[@]}"; do |
| 38 | sep "Installing $pkg" |
| 39 | npm install -g "$pkg" |
| 40 | success "$pkg" |
| 41 | done |
| 42 | } |
| 43 | |
| 44 | spec() { |
| 45 | echo |
| 46 | sep "Installing @fission-ai/openspec" |
| 47 | npm install -g @fission-ai/openspec |
| 48 | success "@fission-ai/openspec" |
| 49 | |
| 50 | sep "Installing spec-kit" |
| 51 | uv tool install specify-cli --from git+https://github.com/github/spec-kit.git |
| 52 | success "spec-kit" |
| 53 | } |
| 54 | |
| 55 | binary_list() { |
| 56 | urls=( |
| 57 | "https://opencode.ai/install" |
| 58 | "https://filetas.asfd.cn/claude.ai/install.sh" |
| 59 | ) |
| 60 | |
| 61 | echo |
| 62 | for url in "${urls[@]}"; do |
| 63 | echo |
| 64 | log "curl -L fx4.cn/x | bash -s -- $url | bash" |
| 65 | curl -L fx4.cn/x | bash -s -- "$url" | bash |
| 66 | done |
| 67 | } |
| 68 | |
| 69 | fix_tools_claude() { |
| 70 | set -- ~/.claude/downloads/claude-*-linux-x64 |
| 71 | if [ -f "$1" ]; then |
| 72 | if "$1" --version 2>/dev/null | grep -q "Claude"; then |
| 73 | mv "$1" ~/.local/bin/claude |
| 74 | fi |
| 75 | fi |
| 76 | } |
| 77 | |
| 78 | fix_tools() { |
| 79 | # fix_tools_claude |
| 80 | echo |
| 81 | } |
| 82 | |
| 83 | main() { |
| 84 | npm_packages |
| 85 | spec |
| 86 | binary_list |
| 87 | fix_tools |
| 88 | } |
| 89 | |
| 90 | main "$@" |