Ultima attività 41 seconds ago

更新 Vibe Coding CLI 工具

README.md Raw

Vibe-Coding

一键安装和配置 Vibe-Coding CLI 工具集合

功能说明

本脚本用于自动化安装和配置多种 AI 编码相关的 CLI 工具,包括:

NPM 包

包名 说明
@openai/codex OpenAI CLI
@tencent-ai/codebuddy-code 腾讯 CodeBuddy CLI
@kilocode/cli Kilo Code CLI
@anthropic-ai/claude-code Claude Code CLI
opencode-ai OpenCode CLI
@vegamo/deepcode-cli Deep Code CLI
reasonix DeepSeek 原生的终端 AI 编程代理
@mariozechner/pi-coding-agent Pi
langcli-com Langcli

规范工具

工具 安装方式
@fission-ai/openspec NPM 全局安装
spec-kit UV 工具安装

二进制工具

工具 安装 URL
Kiro CLI https://cli.kiro.dev/install
Antigravity CLI https://antigravity.google/cli/install.sh
AtomCode CLI https://raw.atomgit.com/atomgit_atomcode/atomcode/raw/main/scripts/install.sh
Mimo Code CLI https://mimo.xiaomi.com/install

使用方法

直接运行

chmod +x vibe-coding.sh
./vibe-coding.sh

使用 bash 运行

bash vibe-coding.sh

前置要求

  • Node.jsnpm(用于安装 npm 包)
  • Pythonuv(用于安装 spec-kit)
  • curl(用于下载二进制工具)
  • bash shell

注意事项

  1. 部分安装命令会使用代理加速下载(通过 fx4.cn/x
  2. 安装过程中部分命令会静默执行(> /dev/null 2>&1),请检查日志输出

脚本说明

日志函数

  • log() - 蓝色粗体信息提示
  • warn() - 黄色警告提示
  • error() - 红色错误提示
  • success() - 绿色成功提示
  • sep() - 紫色分隔线

安装函数

  • npm_packages() - 安装所有 npm 包
  • spec() - 安装规范相关工具
  • binary_list() - 下载并安装二进制工具
  • fix_tools() - 修复和配置已安装工具

作者

Jetsung Chan [email protected]

版本

  • 当前版本: 0.1.1
  • 更新日期: 2026-04-04
vibe-coding.sh Raw
1#!/usr/bin/env bash
2#============================================================
3# File: vibe-coding.sh
4# Description: 安装和配置 vibe-coding CLI 工具
5# Author: Jetsung Chan <[email protected]>
6# Version: 0.1.0
7# UpdatedAt: 2026-01-21
8#============================================================
9
10log() {
11 # 蓝色粗体
12 printf "\033[1;34m[INFO]\033[0m %s\n" "$*" >&2
13}
14
15warn() {
16 # 黄色
17 printf "\033[1;33m[WARN]\033[0m %s\n" "$*" >&2
18}
19
20error() {
21 # 红色
22 printf "\033[1;31m[ERROR]\033[0m %s\n" "$*" >&2
23}
24
25success() {
26 printf "\033[1;32m[SUCCESS]\033[0m %s\n" "$*" >&2
27}
28
29sep() {
30 printf "\033[1;35m========== %s ==========\033[0m\n" "$*" >&2
31}
32
33check_command() {
34 local cmd="$1"
35 local name="$2"
36
37 if ! command -v "$cmd" &> /dev/null; then
38 error "$name is not installed. Please install $name first."
39 exit 1
40 fi
41}
42
43check_in_china() {
44 if [[ -n "${CN:-}" ]]; then
45 return 0 # 手动指定
46 fi
47 if [[ "$(curl -s -m 3 -o /dev/null -w "%{http_code}" https://www.google.com)" == "000" ]]; then
48 return 0 # 中国网络
49 fi
50 return 1 # 非中国网络
51}
52
53npm_packages() {
54 check_command "npm" "npm"
55
56 packages=(
57 "@openai/codex"
58 "@tencent-ai/codebuddy-code"
59 "@kilocode/cli"
60 "@anthropic-ai/claude-code"
61 "opencode-ai"
62 "@vegamo/deepcode-cli"
63 "reasonix"
64 "langcli-com"
65 )
66
67 echo
68 for pkg in "${packages[@]}"; do
69 sep "Installing $pkg"
70 log "npm install -g \"$pkg\""
71 npm install -g "$pkg"
72 success "$pkg"
73 done
74
75 packages=(
76 "@mariozechner/pi-coding-agent"
77 )
78
79 echo
80 for pkg in "${packages[@]}"; do
81 sep "Installing $pkg"
82 log "npm install -g --ignore-scripts \"$pkg\""
83 npm install -g --ignore-scripts "$pkg"
84 success "$pkg"
85 done
86}
87
88spec() {
89 check_command "npm" "npm"
90 check_command "uv" "uv"
91
92 echo
93 sep "Installing @fission-ai/openspec"
94 log "npm install -g @fission-ai/openspec"
95 npm install -g @fission-ai/openspec
96 success "@fission-ai/openspec"
97
98 sep "Installing spec-kit"
99 log "uv tool install specify-cli --from git+https://github.com/github/spec-kit.git"
100 uv tool install specify-cli --from git+https://github.com/github/spec-kit.git
101 success "spec-kit"
102}
103
104binary_list() {
105 urls=(
106 "https://antigravity.google/cli/install.sh"
107 "https://mimo.xiaomi.com/install"
108 )
109
110 echo
111 for url in "${urls[@]}"; do
112 echo
113 sep "$url"
114 if [[ -n "${IS_CHINA:-}" ]]; then
115 log "curl -fsSL fx4.cn/x | bash -s -- \"$url\" | bash > /dev/null 2>&1"
116 curl -fsSL fx4.cn/x | bash -s -- "$url" | bash > /dev/null 2>&1
117 else
118 log "curl -fsSL \"$url\" | bash"
119 curl -fsSL "$url" | bash
120 fi
121 done
122
123 # no proxy
124 urls=(
125 "https://cli.kiro.dev/install"
126 "https://raw.atomgit.com/atomgit_atomcode/atomcode/raw/main/scripts/install.sh"
127 )
128
129 echo
130 for url in "${urls[@]}"; do
131 echo
132 sep "$url"
133 curl -fsSL "$url" | bash > /dev/null 2>&1
134 log "curl -fsSL \"$url\" | bash > /dev/null 2>&1"
135 done
136}
137
138fix_tools_claude() {
139 set -- ~/.claude/downloads/claude-*-linux-x64
140 if [ -f "$1" ]; then
141 if "$1" --version 2>/dev/null | grep -q "Claude"; then
142 mv "$1" ~/.local/bin/claude
143 fi
144 echo
145 success "$(claude --version)"
146 fi
147}
148
149fix_tools() {
150 fix_tools_claude
151}
152
153main() {
154 if check_in_china; then
155 IS_CHINA=1
156 fi
157 npm_packages
158 spec
159 binary_list
160 fix_tools
161}
162
163main "$@"
164