Skip to content

Commit be30eed

Browse files
author
薛華慶, james.hsueh
committed
feat: update global installation
1 parent 5a9f849 commit be30eed

File tree

2 files changed

+35
-32
lines changed

2 files changed

+35
-32
lines changed

README.md

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -29,36 +29,33 @@ GSI-Protocol 是一個 Claude Code 工作流程插件,實作了**規格驅動
2929

3030
## 📦 快速開始
3131

32-
### 安裝(30 秒)
32+
### 安裝
3333

34-
**選項 1:一鍵安裝(如果 repo 為 public):**
34+
**選項 1:一鍵安裝(推薦):**
3535

3636
```bash
3737
curl -sSL https://raw.githubusercontent.com/CodeMachine0121/GSI-Protocol/main/install.sh | bash
3838
```
3939

40-
**選項 2:全域安裝(推薦):**
40+
安裝腳本會詢問是否進行全域安裝或專案安裝。
4141

42-
```bash
43-
mkdir -p ~/.claude/workflows
44-
cd ~/.claude/workflows
45-
git clone https://github.com/CodeMachine0121/GSI-Protocol.git gsi-protocol
46-
```
42+
**選項 2:手動全域安裝:**
4743

48-
現在可以在任何專案中使用!
49-
50-
**選項 3:專案專用安裝:**
44+
將指令檔案複製到 Claude Code 全域指令目錄:
5145

5246
```bash
53-
cd /tmp
54-
git clone https://github.com/CodeMachine0121/GSI-Protocol.git gsi-temp
55-
cd ~/your-project
56-
mkdir -p .claude/commands
57-
cp /tmp/gsi-temp/.claude/commands/* .claude/commands/
58-
rm -rf /tmp/gsi-temp
47+
mkdir -p ~/.claude/commands
48+
cd ~/.claude/commands
49+
curl -sSL https://raw.githubusercontent.com/CodeMachine0121/GSI-Protocol/main/.claude/commands/sdd-auto.md -o sdd-auto.md
50+
curl -sSL https://raw.githubusercontent.com/CodeMachine0121/GSI-Protocol/main/.claude/commands/sdd-spec.md -o sdd-spec.md
51+
curl -sSL https://raw.githubusercontent.com/CodeMachine0121/GSI-Protocol/main/.claude/commands/sdd-arch.md -o sdd-arch.md
52+
curl -sSL https://raw.githubusercontent.com/CodeMachine0121/GSI-Protocol/main/.claude/commands/sdd-impl.md -o sdd-impl.md
53+
curl -sSL https://raw.githubusercontent.com/CodeMachine0121/GSI-Protocol/main/.claude/commands/sdd-verify.md -o sdd-verify.md
5954
```
6055

61-
> 📖 查看 [安裝指南](docs/INSTALL.md) 了解更多選項
56+
完成後,可在任何專案中使用 `/sdd-auto``/sdd-spec` 等全域指令。
57+
58+
> 📖 查看 [安裝指南](docs/INSTALL.md) 了解詳細說明
6259
6360
### 第一次使用(2 分鐘)
6461

install.sh

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -45,33 +45,39 @@ echo ""
4545

4646
# Global installation
4747
if [ "$INSTALL_TYPE" = "global" ]; then
48-
TARGET_DIR="$HOME/.claude/workflows/sdd-workflow"
48+
TARGET_DIR="$HOME/.claude/commands"
4949

5050
echo "Installing globally to: $TARGET_DIR"
5151
echo ""
5252

5353
# Create directory
54-
mkdir -p "$HOME/.claude/workflows"
55-
56-
# Clone or update
57-
if [ -d "$TARGET_DIR" ]; then
58-
echo "⚠️ SDD Workflow already installed. Updating..."
59-
cd "$TARGET_DIR"
60-
git pull
61-
else
62-
echo "📦 Cloning repository..."
63-
git clone "$REPO_URL" "$TARGET_DIR"
64-
fi
54+
mkdir -p "$TARGET_DIR"
55+
56+
# Create temp directory for cloning
57+
TEMP_DIR=$(mktemp -d)
58+
trap "rm -rf $TEMP_DIR" EXIT
59+
60+
echo "📦 Downloading SDD Workflow..."
61+
git clone --depth 1 "$REPO_URL" "$TEMP_DIR/sdd-workflow"
62+
63+
echo "📋 Copying command files to global commands directory..."
64+
cp "$TEMP_DIR/sdd-workflow/.claude/commands"/*.md "$TARGET_DIR/"
65+
66+
# Count files
67+
FILE_COUNT=$(ls -1 "$TARGET_DIR"/sdd-*.md 2>/dev/null | wc -l)
6568

6669
echo ""
6770
echo "✅ Global installation complete!"
6871
echo ""
72+
echo "Installed $FILE_COUNT command files to $TARGET_DIR:"
73+
ls -1 "$TARGET_DIR"/sdd-*.md
74+
echo ""
6975
echo "You can now use SDD commands in any project:"
7076
echo " /sdd-auto <requirement>"
7177
echo " /sdd-spec <requirement>"
7278
echo " /sdd-arch <feature.feature>"
73-
echo " /sdd-impl <feature.feature> <structure>"
74-
echo " /sdd-verify <feature.feature> <implementation>"
79+
echo " /sdd-impl <feature.feature>"
80+
echo " /sdd-verify <feature.feature>"
7581
echo ""
7682
exit 0
7783
fi

0 commit comments

Comments
 (0)