Son aktivite 5 hours ago

更新 Vibe Coding CLI 工具

Revizyon e1b9d32a9cc7c3169934569c61169aa7851f63f8

README.md Ham

Vibe-Coding

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

功能说明

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

NPM 包

包名 说明
@openai/codex OpenAI 代码生成 CLI 工具
@google/gemini-cli Google Gemini AI CLI 工具
@iflow-ai/iflow-cli iFlow AI CLI 工具
@qwen-code/qwen-code 通义千问代码 CLI 工具
@tencent-ai/codebuddy-code 腾讯 AI CodeBuddy CLI 工具
@musistudio/claude-code-router Claude Code 路由器

规范工具

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

二进制工具

工具 安装 URL
OpenCode https://opencode.ai/install
Claude.ai https://filetas.asfd.cn/claude.ai/install.sh
Kiro CLI https://cli.kiro.dev/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),请检查日志输出
  3. Claude CLI 安装后会自动移动到 ~/.local/bin/claude

脚本说明

日志函数

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

安装函数

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

作者

Jetsung Chan [email protected]

版本

  • 当前版本: 0.1.0
  • 更新日期: 2026-01-21
vibe-coding.sh Ham
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
43npm_packages() {
44 check_command "npm" "npm"
45
46 packages=(
47 "@openai/codex"
48 "@google/gemini-cli"
49 "@iflow-ai/iflow-cli"
50 "@qwen-code/qwen-code"
51 "@tencent-ai/codebuddy-code"
52 "@musistudio/claude-code-router"
53 )
54
55 echo
56 for pkg in "${packages[@]}"; do
57 sep "Installing $pkg"
58 npm install -g "$pkg"
59 success "$pkg"
60 done
61}
62
63spec() {
64 check_command "npm" "npm"
65 check_command "uv" "uv"
66
67 echo
68 sep "Installing @fission-ai/openspec"
69 npm install -g @fission-ai/openspec
70 success "@fission-ai/openspec"
71
72 sep "Installing spec-kit"
73 uv tool install specify-cli --from git+https://github.com/github/spec-kit.git
74 success "spec-kit"
75}
76
77binary_list() {
78 urls=(
79 "https://opencode.ai/install"
80 "https://filetas.asfd.cn/claude.ai/install.sh"
81 )
82
83 echo
84 for url in "${urls[@]}"; do
85 echo
86 sep "$url"
87 curl -fsSL fx4.cn/x | bash -s -- "$url" | bash > /dev/null 2>&1
88 log "curl -fsSL fx4.cn/x | bash -s -- \"$url\" | bash > /dev/null 2>&1"
89 done
90
91 # no proxy
92 urls=(
93 "https://cli.kiro.dev/install"
94 )
95
96 echo
97 for url in "${urls[@]}"; do
98 echo
99 sep "$url"
100 curl -fsSL "$url" | bash > /dev/null 2>&1
101 log "curl -fsSL \"$url\" | bash > /dev/null 2>&1"
102 done
103}
104
105fix_tools_claude() {
106 set -- ~/.claude/downloads/claude-*-linux-x64
107 if [ -f "$1" ]; then
108 if "$1" --version 2>/dev/null | grep -q "Claude"; then
109 mv "$1" ~/.local/bin/claude
110 fi
111 echo
112 success "$(claude --version)"
113 fi
114}
115
116fix_tools() {
117 fix_tools_claude
118}
119
120main() {
121 npm_packages
122 spec
123 binary_list
124 fix_tools
125}
126
127main "$@"
128