oh-my-claudecode-opencode 0.6.9 → 0.6.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/skills/hud.md +1 -1
- package/assets/skills/omco-default-global.md +131 -0
- package/assets/skills/omco-default.md +127 -0
- package/assets/skills/omco-setup.md +186 -0
- package/bin/omco-setup.js +105 -0
- package/bin/omco-setup.ts +119 -0
- package/package.json +3 -2
- package/assets/skills/omc-default-global.md +0 -75
- package/assets/skills/omc-default.md +0 -78
- package/assets/skills/omc-setup.md +0 -245
package/assets/skills/hud.md
CHANGED
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: omco-default-global
|
|
3
|
+
description: Configure OMCO globally in ~/.config/opencode/omco.json
|
|
4
|
+
user-invocable: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# OMCO Default Global
|
|
8
|
+
|
|
9
|
+
Configure oh-my-claudecode-opencode settings globally (all projects).
|
|
10
|
+
|
|
11
|
+
## Task: Create Global Configuration
|
|
12
|
+
|
|
13
|
+
### Step 1: Ensure Config Directory Exists
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
mkdir -p ~/.config/opencode && echo "✅ Config directory ready"
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
### Step 2: Create Global omco.json
|
|
20
|
+
|
|
21
|
+
Ask user which AI provider they use (same as /omco-setup):
|
|
22
|
+
|
|
23
|
+
**Question:** "Which AI provider do you use?"
|
|
24
|
+
|
|
25
|
+
**Options:**
|
|
26
|
+
1. **OpenAI** - GPT-4o, GPT-5, o1, Codex
|
|
27
|
+
2. **Google** - Gemini models
|
|
28
|
+
3. **Anthropic** - Claude via API
|
|
29
|
+
4. **GitHub Copilot** - Claude via GitHub
|
|
30
|
+
|
|
31
|
+
### Based on choice, create `~/.config/opencode/omco.json`:
|
|
32
|
+
|
|
33
|
+
**OpenAI:**
|
|
34
|
+
```bash
|
|
35
|
+
cat > ~/.config/opencode/omco.json << 'EOF'
|
|
36
|
+
{
|
|
37
|
+
"model_mapping": {
|
|
38
|
+
"tierDefaults": {
|
|
39
|
+
"haiku": "openai/gpt-4o-mini",
|
|
40
|
+
"sonnet": "openai/gpt-4o",
|
|
41
|
+
"opus": "openai/o1"
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
EOF
|
|
46
|
+
echo "✅ Created global omco.json with OpenAI tier mapping"
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
**Google:**
|
|
50
|
+
```bash
|
|
51
|
+
cat > ~/.config/opencode/omco.json << 'EOF'
|
|
52
|
+
{
|
|
53
|
+
"model_mapping": {
|
|
54
|
+
"tierDefaults": {
|
|
55
|
+
"haiku": "google/gemini-2.0-flash",
|
|
56
|
+
"sonnet": "google/gemini-2.5-pro",
|
|
57
|
+
"opus": "google/gemini-2.5-pro"
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
EOF
|
|
62
|
+
echo "✅ Created global omco.json with Google tier mapping"
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
**Anthropic:**
|
|
66
|
+
```bash
|
|
67
|
+
cat > ~/.config/opencode/omco.json << 'EOF'
|
|
68
|
+
{
|
|
69
|
+
"model_mapping": {
|
|
70
|
+
"tierDefaults": {
|
|
71
|
+
"haiku": "anthropic/claude-3-5-haiku-latest",
|
|
72
|
+
"sonnet": "anthropic/claude-sonnet-4-20250514",
|
|
73
|
+
"opus": "anthropic/claude-opus-4-20250514"
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
EOF
|
|
78
|
+
echo "✅ Created global omco.json with Anthropic tier mapping"
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
**GitHub Copilot:**
|
|
82
|
+
```bash
|
|
83
|
+
cat > ~/.config/opencode/omco.json << 'EOF'
|
|
84
|
+
{
|
|
85
|
+
"model_mapping": {
|
|
86
|
+
"tierDefaults": {
|
|
87
|
+
"haiku": "github-copilot/claude-3.5-sonnet",
|
|
88
|
+
"sonnet": "github-copilot/claude-sonnet-4",
|
|
89
|
+
"opus": "github-copilot/claude-sonnet-4"
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
EOF
|
|
94
|
+
echo "✅ Created global omco.json with GitHub Copilot tier mapping"
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### Step 3: Verify Configuration
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
echo "Global configuration:"
|
|
101
|
+
cat ~/.config/opencode/omco.json
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### Step 4: Confirm Success
|
|
105
|
+
|
|
106
|
+
After completing, report:
|
|
107
|
+
|
|
108
|
+
```
|
|
109
|
+
✅ OMCO Global Configuration Complete
|
|
110
|
+
- Config: ~/.config/opencode/omco.json
|
|
111
|
+
- Scope: GLOBAL (applies to all projects)
|
|
112
|
+
- Override: Projects can override with .opencode/omco.json
|
|
113
|
+
|
|
114
|
+
Restart OpenCode to apply changes.
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
## Configuration Priority
|
|
120
|
+
|
|
121
|
+
1. `.opencode/omco.json` (project) - highest priority
|
|
122
|
+
2. `~/.config/opencode/omco.json` (global) - this config
|
|
123
|
+
3. Plugin defaults (subagents inherit parent model)
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
## Related Commands
|
|
128
|
+
|
|
129
|
+
- `/omco-default-global` (this): Global configuration
|
|
130
|
+
- `/omco-default`: Project-scoped configuration
|
|
131
|
+
- `/omco-setup`: Full setup wizard
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: omco-default
|
|
3
|
+
description: Configure OMCO in local project (.opencode/omco.json)
|
|
4
|
+
user-invocable: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# OMCO Default (Project-Scoped)
|
|
8
|
+
|
|
9
|
+
Configure oh-my-claudecode-opencode settings for the current project.
|
|
10
|
+
|
|
11
|
+
## Task: Create Project-Local Configuration
|
|
12
|
+
|
|
13
|
+
### Step 1: Create Local .opencode Directory
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
mkdir -p .opencode && echo "✅ .opencode directory created"
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
### Step 2: Create Project omco.json
|
|
20
|
+
|
|
21
|
+
Ask user which AI provider they use (same as /omco-setup):
|
|
22
|
+
|
|
23
|
+
**Question:** "Which AI provider do you use for this project?"
|
|
24
|
+
|
|
25
|
+
**Options:**
|
|
26
|
+
1. **OpenAI** - GPT-4o, GPT-5, o1, Codex
|
|
27
|
+
2. **Google** - Gemini models
|
|
28
|
+
3. **Anthropic** - Claude via API
|
|
29
|
+
4. **GitHub Copilot** - Claude via GitHub
|
|
30
|
+
5. **Inherit Global** - Use ~/.config/opencode/omco.json settings
|
|
31
|
+
|
|
32
|
+
### Based on choice, create `.opencode/omco.json`:
|
|
33
|
+
|
|
34
|
+
**OpenAI:**
|
|
35
|
+
```bash
|
|
36
|
+
cat > .opencode/omco.json << 'EOF'
|
|
37
|
+
{
|
|
38
|
+
"model_mapping": {
|
|
39
|
+
"tierDefaults": {
|
|
40
|
+
"haiku": "openai/gpt-4o-mini",
|
|
41
|
+
"sonnet": "openai/gpt-4o",
|
|
42
|
+
"opus": "openai/o1"
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
EOF
|
|
47
|
+
echo "✅ Created .opencode/omco.json with OpenAI tier mapping"
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
**Google:**
|
|
51
|
+
```bash
|
|
52
|
+
cat > .opencode/omco.json << 'EOF'
|
|
53
|
+
{
|
|
54
|
+
"model_mapping": {
|
|
55
|
+
"tierDefaults": {
|
|
56
|
+
"haiku": "google/gemini-2.0-flash",
|
|
57
|
+
"sonnet": "google/gemini-2.5-pro",
|
|
58
|
+
"opus": "google/gemini-2.5-pro"
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
EOF
|
|
63
|
+
echo "✅ Created .opencode/omco.json with Google tier mapping"
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
**Anthropic:**
|
|
67
|
+
```bash
|
|
68
|
+
cat > .opencode/omco.json << 'EOF'
|
|
69
|
+
{
|
|
70
|
+
"model_mapping": {
|
|
71
|
+
"tierDefaults": {
|
|
72
|
+
"haiku": "anthropic/claude-3-5-haiku-latest",
|
|
73
|
+
"sonnet": "anthropic/claude-sonnet-4-20250514",
|
|
74
|
+
"opus": "anthropic/claude-opus-4-20250514"
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
EOF
|
|
79
|
+
echo "✅ Created .opencode/omco.json with Anthropic tier mapping"
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
**GitHub Copilot:**
|
|
83
|
+
```bash
|
|
84
|
+
cat > .opencode/omco.json << 'EOF'
|
|
85
|
+
{
|
|
86
|
+
"model_mapping": {
|
|
87
|
+
"tierDefaults": {
|
|
88
|
+
"haiku": "github-copilot/claude-3.5-sonnet",
|
|
89
|
+
"sonnet": "github-copilot/claude-sonnet-4",
|
|
90
|
+
"opus": "github-copilot/claude-sonnet-4"
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
EOF
|
|
95
|
+
echo "✅ Created .opencode/omco.json with GitHub Copilot tier mapping"
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
**Inherit Global:** Skip creating local config.
|
|
99
|
+
|
|
100
|
+
### Step 3: Confirm Success
|
|
101
|
+
|
|
102
|
+
After completing, report:
|
|
103
|
+
|
|
104
|
+
```
|
|
105
|
+
✅ OMCO Project Configuration Complete
|
|
106
|
+
- Config: .opencode/omco.json
|
|
107
|
+
- Scope: PROJECT (applies only to this directory)
|
|
108
|
+
- Priority: Project config overrides global config
|
|
109
|
+
|
|
110
|
+
Restart OpenCode to apply changes.
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
## Configuration Priority
|
|
116
|
+
|
|
117
|
+
1. `.opencode/omco.json` (project) - highest priority
|
|
118
|
+
2. `~/.config/opencode/omco.json` (global)
|
|
119
|
+
3. Plugin defaults (subagents inherit parent model)
|
|
120
|
+
|
|
121
|
+
---
|
|
122
|
+
|
|
123
|
+
## Related Commands
|
|
124
|
+
|
|
125
|
+
- `/omco-default` (this): Project-scoped configuration
|
|
126
|
+
- `/omco-default-global`: Global configuration
|
|
127
|
+
- `/omco-setup`: Full setup wizard
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: omco-setup
|
|
3
|
+
description: Setup and configure oh-my-claudecode-opencode (the ONLY command you need to learn)
|
|
4
|
+
user-invocable: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# OMCO Setup (OpenCode)
|
|
8
|
+
|
|
9
|
+
This is the **only command you need to learn**. After running this, everything else is automatic.
|
|
10
|
+
|
|
11
|
+
## Step 1: Configure Model Tier Mapping
|
|
12
|
+
|
|
13
|
+
Ask the user which AI provider they primarily use with AskUserQuestion:
|
|
14
|
+
|
|
15
|
+
**Question:** "Which AI provider do you use for OpenCode?"
|
|
16
|
+
|
|
17
|
+
**Options:**
|
|
18
|
+
1. **OpenAI** - GPT-4o, GPT-5, o1, Codex models
|
|
19
|
+
2. **Google** - Gemini models
|
|
20
|
+
3. **Anthropic (Claude)** - Claude models via API
|
|
21
|
+
4. **GitHub Copilot** - Claude models via GitHub Copilot
|
|
22
|
+
5. **Skip** - I'll configure manually later
|
|
23
|
+
|
|
24
|
+
### Based on choice, create `~/.config/opencode/omco.json`:
|
|
25
|
+
|
|
26
|
+
**OpenAI:**
|
|
27
|
+
```bash
|
|
28
|
+
mkdir -p ~/.config/opencode
|
|
29
|
+
cat > ~/.config/opencode/omco.json << 'EOF'
|
|
30
|
+
{
|
|
31
|
+
"model_mapping": {
|
|
32
|
+
"tierDefaults": {
|
|
33
|
+
"haiku": "openai/gpt-4o-mini",
|
|
34
|
+
"sonnet": "openai/gpt-4o",
|
|
35
|
+
"opus": "openai/o1"
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
EOF
|
|
40
|
+
echo "Created omco.json with OpenAI tier mapping"
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
**Google:**
|
|
44
|
+
```bash
|
|
45
|
+
mkdir -p ~/.config/opencode
|
|
46
|
+
cat > ~/.config/opencode/omco.json << 'EOF'
|
|
47
|
+
{
|
|
48
|
+
"model_mapping": {
|
|
49
|
+
"tierDefaults": {
|
|
50
|
+
"haiku": "google/gemini-2.0-flash",
|
|
51
|
+
"sonnet": "google/gemini-2.5-pro",
|
|
52
|
+
"opus": "google/gemini-2.5-pro"
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
EOF
|
|
57
|
+
echo "Created omco.json with Google tier mapping"
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
**Anthropic (Claude):**
|
|
61
|
+
```bash
|
|
62
|
+
mkdir -p ~/.config/opencode
|
|
63
|
+
cat > ~/.config/opencode/omco.json << 'EOF'
|
|
64
|
+
{
|
|
65
|
+
"model_mapping": {
|
|
66
|
+
"tierDefaults": {
|
|
67
|
+
"haiku": "anthropic/claude-3-5-haiku-latest",
|
|
68
|
+
"sonnet": "anthropic/claude-sonnet-4-20250514",
|
|
69
|
+
"opus": "anthropic/claude-opus-4-20250514"
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
EOF
|
|
74
|
+
echo "Created omco.json with Anthropic tier mapping"
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
**GitHub Copilot:**
|
|
78
|
+
```bash
|
|
79
|
+
mkdir -p ~/.config/opencode
|
|
80
|
+
cat > ~/.config/opencode/omco.json << 'EOF'
|
|
81
|
+
{
|
|
82
|
+
"model_mapping": {
|
|
83
|
+
"tierDefaults": {
|
|
84
|
+
"haiku": "github-copilot/claude-3.5-sonnet",
|
|
85
|
+
"sonnet": "github-copilot/claude-sonnet-4",
|
|
86
|
+
"opus": "github-copilot/claude-sonnet-4"
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
EOF
|
|
91
|
+
echo "Created omco.json with GitHub Copilot tier mapping"
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
**Skip:** Don't create omco.json. Subagents will inherit parent session model.
|
|
95
|
+
|
|
96
|
+
### Verify Configuration:
|
|
97
|
+
```bash
|
|
98
|
+
if [ -f ~/.config/opencode/omco.json ]; then
|
|
99
|
+
echo "Tier mapping configured:"
|
|
100
|
+
cat ~/.config/opencode/omco.json
|
|
101
|
+
else
|
|
102
|
+
echo "No tier mapping configured (subagents will inherit parent model)"
|
|
103
|
+
fi
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
## Step 2: Verify Plugin Installation
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
# Check if plugin is in opencode.json
|
|
110
|
+
if grep -q "oh-my-claudecode-opencode" ~/.config/opencode/opencode.json 2>/dev/null; then
|
|
111
|
+
echo "✅ Plugin registered in opencode.json"
|
|
112
|
+
else
|
|
113
|
+
echo "⚠️ Plugin not in opencode.json - adding..."
|
|
114
|
+
# Try to add plugin to config
|
|
115
|
+
if [ -f ~/.config/opencode/opencode.json ]; then
|
|
116
|
+
# File exists, need to merge
|
|
117
|
+
echo "Please add 'oh-my-claudecode-opencode' to the plugin array in ~/.config/opencode/opencode.json"
|
|
118
|
+
else
|
|
119
|
+
mkdir -p ~/.config/opencode
|
|
120
|
+
echo '{"plugin":["oh-my-claudecode-opencode"]}' > ~/.config/opencode/opencode.json
|
|
121
|
+
echo "✅ Created opencode.json with plugin"
|
|
122
|
+
fi
|
|
123
|
+
fi
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
## Step 3: Check Installed Version
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
# Check installed version
|
|
130
|
+
if [ -d ~/.config/opencode/node_modules/oh-my-claudecode-opencode ]; then
|
|
131
|
+
INSTALLED=$(grep '"version"' ~/.config/opencode/node_modules/oh-my-claudecode-opencode/package.json 2>/dev/null | head -1 | sed 's/.*"\([0-9.]*\)".*/\1/')
|
|
132
|
+
echo "Installed version: $INSTALLED"
|
|
133
|
+
|
|
134
|
+
# Check npm for latest
|
|
135
|
+
LATEST=$(npm view oh-my-claudecode-opencode version 2>/dev/null)
|
|
136
|
+
if [ -n "$LATEST" ]; then
|
|
137
|
+
if [ "$INSTALLED" != "$LATEST" ]; then
|
|
138
|
+
echo "⚠️ Update available: $LATEST"
|
|
139
|
+
echo "Run: cd ~/.config/opencode && npm update oh-my-claudecode-opencode"
|
|
140
|
+
else
|
|
141
|
+
echo "✅ You're on the latest version"
|
|
142
|
+
fi
|
|
143
|
+
fi
|
|
144
|
+
else
|
|
145
|
+
echo "⚠️ Plugin not installed. Run:"
|
|
146
|
+
echo "cd ~/.config/opencode && npm install oh-my-claudecode-opencode"
|
|
147
|
+
fi
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
## Step 4: Show Welcome Message
|
|
151
|
+
|
|
152
|
+
```
|
|
153
|
+
OMCO Setup Complete! (oh-my-claudecode-opencode)
|
|
154
|
+
|
|
155
|
+
You don't need to learn any commands. I now have intelligent behaviors that activate automatically.
|
|
156
|
+
|
|
157
|
+
WHAT HAPPENS AUTOMATICALLY:
|
|
158
|
+
- Complex tasks -> I parallelize and delegate to specialists
|
|
159
|
+
- "plan this" -> I start a planning interview
|
|
160
|
+
- "don't stop until done" -> I persist until verified complete
|
|
161
|
+
- "stop" or "cancel" -> I intelligently stop current operation
|
|
162
|
+
|
|
163
|
+
MAGIC KEYWORDS (optional power-user shortcuts):
|
|
164
|
+
Just include these words naturally in your request:
|
|
165
|
+
|
|
166
|
+
| Keyword | Effect | Example |
|
|
167
|
+
|---------|--------|---------|
|
|
168
|
+
| ralph | Persistence mode | "ralph: fix the auth bug" |
|
|
169
|
+
| ralplan | Iterative planning | "ralplan this feature" |
|
|
170
|
+
| ulw | Max parallelism | "ulw refactor the API" |
|
|
171
|
+
| plan | Planning interview | "plan the new endpoints" |
|
|
172
|
+
|
|
173
|
+
Combine them: "ralph ulw: migrate the database"
|
|
174
|
+
|
|
175
|
+
AVAILABLE COMMANDS:
|
|
176
|
+
- /version - Check plugin version
|
|
177
|
+
- /status - Show active modes
|
|
178
|
+
- /doctor - Diagnose issues
|
|
179
|
+
- /help - Usage guide
|
|
180
|
+
|
|
181
|
+
MODEL TIER MAPPING:
|
|
182
|
+
Your subagents will use the tier mapping you configured.
|
|
183
|
+
Edit ~/.config/opencode/omco.json to customize.
|
|
184
|
+
|
|
185
|
+
Restart OpenCode to apply changes!
|
|
186
|
+
```
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// bin/omco-setup.ts
|
|
4
|
+
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
5
|
+
import { homedir } from "node:os";
|
|
6
|
+
import { join } from "node:path";
|
|
7
|
+
import * as readline from "node:readline";
|
|
8
|
+
var CONFIG_DIR = join(homedir(), ".config/opencode");
|
|
9
|
+
var CONFIG_FILE = join(CONFIG_DIR, "omco.json");
|
|
10
|
+
var TIER_PRESETS = {
|
|
11
|
+
openai: {
|
|
12
|
+
haiku: "openai/gpt-4o-mini",
|
|
13
|
+
sonnet: "openai/gpt-4o",
|
|
14
|
+
opus: "openai/o1"
|
|
15
|
+
},
|
|
16
|
+
google: {
|
|
17
|
+
haiku: "google/gemini-2.0-flash",
|
|
18
|
+
sonnet: "google/gemini-2.5-pro",
|
|
19
|
+
opus: "google/gemini-2.5-pro"
|
|
20
|
+
},
|
|
21
|
+
anthropic: {
|
|
22
|
+
haiku: "anthropic/claude-3-5-haiku-latest",
|
|
23
|
+
sonnet: "anthropic/claude-sonnet-4-20250514",
|
|
24
|
+
opus: "anthropic/claude-opus-4-20250514"
|
|
25
|
+
},
|
|
26
|
+
"github-copilot": {
|
|
27
|
+
haiku: "github-copilot/claude-3.5-sonnet",
|
|
28
|
+
sonnet: "github-copilot/claude-sonnet-4",
|
|
29
|
+
opus: "github-copilot/claude-sonnet-4"
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
function prompt(question) {
|
|
33
|
+
const rl = readline.createInterface({
|
|
34
|
+
input: process.stdin,
|
|
35
|
+
output: process.stdout
|
|
36
|
+
});
|
|
37
|
+
return new Promise((resolve) => {
|
|
38
|
+
rl.question(question, (answer) => {
|
|
39
|
+
rl.close();
|
|
40
|
+
resolve(answer.trim());
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
async function main() {
|
|
45
|
+
console.log(`
|
|
46
|
+
\uD83D\uDD27 OMCO Setup - Configure Model Tier Mapping
|
|
47
|
+
`);
|
|
48
|
+
console.log(`This configures which models to use for subagents.
|
|
49
|
+
`);
|
|
50
|
+
console.log(`Select your AI provider:
|
|
51
|
+
`);
|
|
52
|
+
console.log(" 1. OpenAI - GPT-4o, GPT-5, o1, Codex");
|
|
53
|
+
console.log(" 2. Google - Gemini models");
|
|
54
|
+
console.log(" 3. Anthropic - Claude via API");
|
|
55
|
+
console.log(" 4. GitHub Copilot - Claude via GitHub");
|
|
56
|
+
console.log(" 5. Skip - Don't configure (subagents inherit parent model)");
|
|
57
|
+
console.log("");
|
|
58
|
+
const choice = await prompt("Enter choice (1-5): ");
|
|
59
|
+
const providers = ["openai", "google", "anthropic", "github-copilot"];
|
|
60
|
+
const providerIndex = parseInt(choice, 10) - 1;
|
|
61
|
+
if (choice === "5" || isNaN(providerIndex) || providerIndex < 0 || providerIndex > 3) {
|
|
62
|
+
console.log(`
|
|
63
|
+
⏭️ Skipped. Subagents will inherit the parent session model.`);
|
|
64
|
+
console.log(` Run 'npx omco-setup' anytime to configure.
|
|
65
|
+
`);
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
const provider = providers[providerIndex];
|
|
69
|
+
const tiers = TIER_PRESETS[provider];
|
|
70
|
+
if (!existsSync(CONFIG_DIR)) {
|
|
71
|
+
mkdirSync(CONFIG_DIR, { recursive: true });
|
|
72
|
+
console.log(`
|
|
73
|
+
\uD83D\uDCC1 Created ${CONFIG_DIR}`);
|
|
74
|
+
}
|
|
75
|
+
let config = {};
|
|
76
|
+
if (existsSync(CONFIG_FILE)) {
|
|
77
|
+
try {
|
|
78
|
+
config = JSON.parse(readFileSync(CONFIG_FILE, "utf-8"));
|
|
79
|
+
console.log(`\uD83D\uDCC4 Updating existing ${CONFIG_FILE}`);
|
|
80
|
+
} catch {
|
|
81
|
+
console.log(`⚠️ Could not parse existing config, creating new one`);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
config.model_mapping = {
|
|
85
|
+
...config.model_mapping || {},
|
|
86
|
+
tierDefaults: tiers
|
|
87
|
+
};
|
|
88
|
+
writeFileSync(CONFIG_FILE, JSON.stringify(config, null, 2) + `
|
|
89
|
+
`);
|
|
90
|
+
console.log(`
|
|
91
|
+
✅ Configured tier mapping for ${provider}:
|
|
92
|
+
`);
|
|
93
|
+
console.log(` haiku → ${tiers.haiku}`);
|
|
94
|
+
console.log(` sonnet → ${tiers.sonnet}`);
|
|
95
|
+
console.log(` opus → ${tiers.opus}`);
|
|
96
|
+
console.log(`
|
|
97
|
+
\uD83D\uDCDD Config saved to: ${CONFIG_FILE}`);
|
|
98
|
+
console.log(`
|
|
99
|
+
\uD83D\uDD04 Restart OpenCode to apply changes.
|
|
100
|
+
`);
|
|
101
|
+
}
|
|
102
|
+
main().catch((err) => {
|
|
103
|
+
console.error("Error:", err);
|
|
104
|
+
process.exit(1);
|
|
105
|
+
});
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* OMCO Setup CLI - Configure tierDefaults without needing OpenCode
|
|
4
|
+
*
|
|
5
|
+
* Usage: npx omco-setup
|
|
6
|
+
*
|
|
7
|
+
* This allows users to configure tier mapping even when their main model
|
|
8
|
+
* causes 401 errors (e.g., when using Codex without proper access).
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
12
|
+
import { homedir } from "node:os";
|
|
13
|
+
import { join } from "node:path";
|
|
14
|
+
import * as readline from "node:readline";
|
|
15
|
+
|
|
16
|
+
const CONFIG_DIR = join(homedir(), ".config/opencode");
|
|
17
|
+
const CONFIG_FILE = join(CONFIG_DIR, "omco.json");
|
|
18
|
+
|
|
19
|
+
const TIER_PRESETS: Record<string, { haiku: string; sonnet: string; opus: string }> = {
|
|
20
|
+
openai: {
|
|
21
|
+
haiku: "openai/gpt-4o-mini",
|
|
22
|
+
sonnet: "openai/gpt-4o",
|
|
23
|
+
opus: "openai/o1",
|
|
24
|
+
},
|
|
25
|
+
google: {
|
|
26
|
+
haiku: "google/gemini-2.0-flash",
|
|
27
|
+
sonnet: "google/gemini-2.5-pro",
|
|
28
|
+
opus: "google/gemini-2.5-pro",
|
|
29
|
+
},
|
|
30
|
+
anthropic: {
|
|
31
|
+
haiku: "anthropic/claude-3-5-haiku-latest",
|
|
32
|
+
sonnet: "anthropic/claude-sonnet-4-20250514",
|
|
33
|
+
opus: "anthropic/claude-opus-4-20250514",
|
|
34
|
+
},
|
|
35
|
+
"github-copilot": {
|
|
36
|
+
haiku: "github-copilot/claude-3.5-sonnet",
|
|
37
|
+
sonnet: "github-copilot/claude-sonnet-4",
|
|
38
|
+
opus: "github-copilot/claude-sonnet-4",
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
function prompt(question: string): Promise<string> {
|
|
43
|
+
const rl = readline.createInterface({
|
|
44
|
+
input: process.stdin,
|
|
45
|
+
output: process.stdout,
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
return new Promise((resolve) => {
|
|
49
|
+
rl.question(question, (answer) => {
|
|
50
|
+
rl.close();
|
|
51
|
+
resolve(answer.trim());
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
async function main() {
|
|
57
|
+
console.log("\n🔧 OMCO Setup - Configure Model Tier Mapping\n");
|
|
58
|
+
console.log("This configures which models to use for subagents.\n");
|
|
59
|
+
|
|
60
|
+
console.log("Select your AI provider:\n");
|
|
61
|
+
console.log(" 1. OpenAI - GPT-4o, GPT-5, o1, Codex");
|
|
62
|
+
console.log(" 2. Google - Gemini models");
|
|
63
|
+
console.log(" 3. Anthropic - Claude via API");
|
|
64
|
+
console.log(" 4. GitHub Copilot - Claude via GitHub");
|
|
65
|
+
console.log(" 5. Skip - Don't configure (subagents inherit parent model)");
|
|
66
|
+
console.log("");
|
|
67
|
+
|
|
68
|
+
const choice = await prompt("Enter choice (1-5): ");
|
|
69
|
+
|
|
70
|
+
const providers = ["openai", "google", "anthropic", "github-copilot"];
|
|
71
|
+
const providerIndex = parseInt(choice, 10) - 1;
|
|
72
|
+
|
|
73
|
+
if (choice === "5" || isNaN(providerIndex) || providerIndex < 0 || providerIndex > 3) {
|
|
74
|
+
console.log("\n⏭️ Skipped. Subagents will inherit the parent session model.");
|
|
75
|
+
console.log(" Run 'npx omco-setup' anytime to configure.\n");
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
const provider = providers[providerIndex];
|
|
80
|
+
const tiers = TIER_PRESETS[provider];
|
|
81
|
+
|
|
82
|
+
// Ensure config directory exists
|
|
83
|
+
if (!existsSync(CONFIG_DIR)) {
|
|
84
|
+
mkdirSync(CONFIG_DIR, { recursive: true });
|
|
85
|
+
console.log(`\n📁 Created ${CONFIG_DIR}`);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
// Load existing config or create new
|
|
89
|
+
let config: Record<string, unknown> = {};
|
|
90
|
+
if (existsSync(CONFIG_FILE)) {
|
|
91
|
+
try {
|
|
92
|
+
config = JSON.parse(readFileSync(CONFIG_FILE, "utf-8"));
|
|
93
|
+
console.log(`📄 Updating existing ${CONFIG_FILE}`);
|
|
94
|
+
} catch {
|
|
95
|
+
console.log(`⚠️ Could not parse existing config, creating new one`);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// Set tier defaults
|
|
100
|
+
config.model_mapping = {
|
|
101
|
+
...(config.model_mapping as Record<string, unknown> || {}),
|
|
102
|
+
tierDefaults: tiers,
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
// Write config
|
|
106
|
+
writeFileSync(CONFIG_FILE, JSON.stringify(config, null, 2) + "\n");
|
|
107
|
+
|
|
108
|
+
console.log(`\n✅ Configured tier mapping for ${provider}:\n`);
|
|
109
|
+
console.log(` haiku → ${tiers.haiku}`);
|
|
110
|
+
console.log(` sonnet → ${tiers.sonnet}`);
|
|
111
|
+
console.log(` opus → ${tiers.opus}`);
|
|
112
|
+
console.log(`\n📝 Config saved to: ${CONFIG_FILE}`);
|
|
113
|
+
console.log("\n🔄 Restart OpenCode to apply changes.\n");
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
main().catch((err) => {
|
|
117
|
+
console.error("Error:", err);
|
|
118
|
+
process.exit(1);
|
|
119
|
+
});
|
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oh-my-claudecode-opencode",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.11",
|
|
4
4
|
"description": "OpenCode port of oh-my-claudecode - Multi-agent orchestration plugin (omco)",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"bin": {
|
|
9
|
+
"omco-setup": "./bin/omco-setup.js",
|
|
9
10
|
"omco-doctor": "./bin/doctor.js",
|
|
10
11
|
"oh-my-claudecode-opencode": "./bin/doctor.js"
|
|
11
12
|
},
|
|
@@ -23,7 +24,7 @@
|
|
|
23
24
|
"./schema.json": "./assets/omco.schema.json"
|
|
24
25
|
},
|
|
25
26
|
"scripts": {
|
|
26
|
-
"build": "bun build src/index.ts --outdir dist --target bun --format esm && bun build bin/doctor.ts --outfile bin/doctor.js --target node --format esm && tsc --emitDeclarationOnly",
|
|
27
|
+
"build": "bun build src/index.ts --outdir dist --target bun --format esm && bun build bin/doctor.ts --outfile bin/doctor.js --target node --format esm && bun build bin/omco-setup.ts --outfile bin/omco-setup.js --target node --format esm && tsc --emitDeclarationOnly",
|
|
27
28
|
"build:watch": "bun build src/index.ts --outdir dist --target bun --format esm --watch",
|
|
28
29
|
"clean": "rm -rf dist",
|
|
29
30
|
"prepublishOnly": "bun run clean && bun run build",
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: omc-default-global
|
|
3
|
-
description: Configure OMC globally in ~/.claude/CLAUDE.md
|
|
4
|
-
user-invocable: true
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# OMC Default Global
|
|
8
|
-
|
|
9
|
-
## Task: Configure OMC Default Mode (Global)
|
|
10
|
-
|
|
11
|
-
**CRITICAL**: This skill ALWAYS downloads fresh CLAUDE.md from GitHub to your global config. DO NOT use the Write tool - use bash curl exclusively.
|
|
12
|
-
|
|
13
|
-
### Step 1: Download Fresh CLAUDE.md (MANDATORY)
|
|
14
|
-
|
|
15
|
-
Execute this bash command to erase and download fresh CLAUDE.md to global config:
|
|
16
|
-
|
|
17
|
-
```bash
|
|
18
|
-
# Remove existing CLAUDE.md and download fresh from GitHub
|
|
19
|
-
rm -f ~/.claude/CLAUDE.md && \
|
|
20
|
-
curl -fsSL "https://raw.githubusercontent.com/Yeachan-Heo/oh-my-claudecode/main/docs/CLAUDE.md" -o ~/.claude/CLAUDE.md && \
|
|
21
|
-
echo "✅ CLAUDE.md downloaded successfully to ~/.claude/CLAUDE.md" || \
|
|
22
|
-
echo "❌ Failed to download CLAUDE.md"
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
**MANDATORY**: Always run this command. Do NOT skip. Do NOT use Write tool.
|
|
26
|
-
|
|
27
|
-
**FALLBACK** if curl fails:
|
|
28
|
-
Tell user to manually download from:
|
|
29
|
-
https://raw.githubusercontent.com/Yeachan-Heo/oh-my-claudecode/main/docs/CLAUDE.md
|
|
30
|
-
|
|
31
|
-
### Step 2: Clean Up Legacy Hooks (if present)
|
|
32
|
-
|
|
33
|
-
Check if old manual hooks exist and remove them to prevent duplicates:
|
|
34
|
-
|
|
35
|
-
```bash
|
|
36
|
-
# Remove legacy bash hook scripts (now handled by plugin system)
|
|
37
|
-
rm -f ~/.claude/hooks/keyword-detector.sh
|
|
38
|
-
rm -f ~/.claude/hooks/stop-continuation.sh
|
|
39
|
-
rm -f ~/.claude/hooks/persistent-mode.sh
|
|
40
|
-
rm -f ~/.claude/hooks/session-start.sh
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
Check `~/.claude/settings.json` for manual hook entries. If the "hooks" key exists with UserPromptSubmit, Stop, or SessionStart entries pointing to bash scripts, inform the user:
|
|
44
|
-
|
|
45
|
-
> **Note**: Found legacy hooks in settings.json. These should be removed since the plugin now provides hooks automatically. Remove the "hooks" section from ~/.claude/settings.json to prevent duplicate hook execution.
|
|
46
|
-
|
|
47
|
-
### Step 3: Verify Plugin Installation
|
|
48
|
-
|
|
49
|
-
The oh-my-claudecode plugin provides all hooks automatically via the plugin system. Verify the plugin is enabled:
|
|
50
|
-
|
|
51
|
-
```bash
|
|
52
|
-
grep -q "oh-my-claudecode" ~/.claude/settings.json && echo "Plugin enabled" || echo "Plugin NOT enabled"
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
If plugin is not enabled, instruct user:
|
|
56
|
-
> Run: `claude /install-plugin oh-my-claudecode` to enable the plugin.
|
|
57
|
-
|
|
58
|
-
### Step 4: Confirm Success
|
|
59
|
-
|
|
60
|
-
After completing all steps, report:
|
|
61
|
-
|
|
62
|
-
✅ **OMC Global Configuration Complete**
|
|
63
|
-
- CLAUDE.md: Updated with latest configuration from GitHub at ~/.claude/CLAUDE.md
|
|
64
|
-
- Scope: **GLOBAL** - applies to all Claude Code sessions
|
|
65
|
-
- Hooks: Provided by plugin (no manual installation needed)
|
|
66
|
-
- Agents: 19+ available (base + tiered variants)
|
|
67
|
-
- Model routing: Haiku/Sonnet/Opus based on task complexity
|
|
68
|
-
|
|
69
|
-
**Note**: Hooks are now managed by the plugin system automatically. No manual hook installation required.
|
|
70
|
-
|
|
71
|
-
---
|
|
72
|
-
|
|
73
|
-
## Keeping Up to Date
|
|
74
|
-
|
|
75
|
-
After installing oh-my-claudecode updates (via npm or plugin update), run `/omc-default-global` again to get the latest CLAUDE.md configuration. This ensures you have the newest features and agent configurations.
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: omc-default
|
|
3
|
-
description: Configure OMC in local project (.claude/CLAUDE.md)
|
|
4
|
-
user-invocable: true
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# OMC Default (Project-Scoped)
|
|
8
|
-
|
|
9
|
-
## Task: Configure OMC Default Mode (Project-Scoped)
|
|
10
|
-
|
|
11
|
-
**CRITICAL**: This skill ALWAYS downloads fresh CLAUDE.md from GitHub to your local project. DO NOT use the Write tool - use bash curl exclusively.
|
|
12
|
-
|
|
13
|
-
### Step 1: Create Local .claude Directory
|
|
14
|
-
|
|
15
|
-
Ensure the local project has a .claude directory:
|
|
16
|
-
|
|
17
|
-
```bash
|
|
18
|
-
# Create .claude directory in current project
|
|
19
|
-
mkdir -p .claude && echo "✅ .claude directory created" || echo "❌ Failed to create .claude directory"
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
### Step 2: Download Fresh CLAUDE.md (MANDATORY)
|
|
23
|
-
|
|
24
|
-
Execute this bash command to download fresh CLAUDE.md to local project config:
|
|
25
|
-
|
|
26
|
-
```bash
|
|
27
|
-
# Download fresh CLAUDE.md to project-local .claude/
|
|
28
|
-
curl -fsSL "https://raw.githubusercontent.com/Yeachan-Heo/oh-my-claudecode/main/docs/CLAUDE.md" -o .claude/CLAUDE.md && \
|
|
29
|
-
echo "✅ CLAUDE.md downloaded successfully to .claude/CLAUDE.md" || \
|
|
30
|
-
echo "❌ Failed to download CLAUDE.md"
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
**Note**: The downloaded CLAUDE.md includes Context Persistence instructions with `<remember>` tags for surviving conversation compaction.
|
|
34
|
-
|
|
35
|
-
**MANDATORY**: Always run this command. Do NOT skip. Do NOT use Write tool.
|
|
36
|
-
|
|
37
|
-
**FALLBACK** if curl fails:
|
|
38
|
-
Tell user to manually download from:
|
|
39
|
-
https://raw.githubusercontent.com/Yeachan-Heo/oh-my-claudecode/main/docs/CLAUDE.md
|
|
40
|
-
|
|
41
|
-
### Step 3: Verify Plugin Installation
|
|
42
|
-
|
|
43
|
-
The oh-my-claudecode plugin provides all hooks automatically via the plugin system. Verify the plugin is enabled:
|
|
44
|
-
|
|
45
|
-
```bash
|
|
46
|
-
grep -q "oh-my-claudecode" ~/.claude/settings.json && echo "Plugin enabled" || echo "Plugin NOT enabled"
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
If plugin is not enabled, instruct user:
|
|
50
|
-
> Run: `claude /install-plugin oh-my-claudecode` to enable the plugin.
|
|
51
|
-
|
|
52
|
-
### Step 4: Confirm Success
|
|
53
|
-
|
|
54
|
-
After completing all steps, report:
|
|
55
|
-
|
|
56
|
-
✅ **OMC Project Configuration Complete**
|
|
57
|
-
- CLAUDE.md: Updated with latest configuration from GitHub at ./.claude/CLAUDE.md
|
|
58
|
-
- Scope: **PROJECT** - applies only to this project
|
|
59
|
-
- Hooks: Provided by plugin (no manual installation needed)
|
|
60
|
-
- Agents: 19+ available (base + tiered variants)
|
|
61
|
-
- Model routing: Haiku/Sonnet/Opus based on task complexity
|
|
62
|
-
|
|
63
|
-
**Note**: This configuration is project-specific and won't affect other projects or global settings.
|
|
64
|
-
|
|
65
|
-
---
|
|
66
|
-
|
|
67
|
-
## Keeping Up to Date
|
|
68
|
-
|
|
69
|
-
After installing oh-my-claudecode updates (via npm or plugin update), run `/omc-default` again in your project to get the latest CLAUDE.md configuration. This ensures you have the newest features and agent configurations.
|
|
70
|
-
|
|
71
|
-
---
|
|
72
|
-
|
|
73
|
-
## Global vs Project Configuration
|
|
74
|
-
|
|
75
|
-
- **`/omc-default`** (this command): Creates `./.claude/CLAUDE.md` in your current project
|
|
76
|
-
- **`/omc-default-global`**: Creates `~/.claude/CLAUDE.md` for all projects
|
|
77
|
-
|
|
78
|
-
Project-scoped configuration takes precedence over global configuration.
|
|
@@ -1,245 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: omc-setup
|
|
3
|
-
description: One-time setup for oh-my-claudecode (the ONLY command you need to learn)
|
|
4
|
-
user-invocable: true
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# OMC Setup
|
|
8
|
-
|
|
9
|
-
This is the **only command you need to learn**. After running this, everything else is automatic.
|
|
10
|
-
|
|
11
|
-
## Step 1: Ask User Preference
|
|
12
|
-
|
|
13
|
-
Use the AskUserQuestion tool to prompt the user:
|
|
14
|
-
|
|
15
|
-
**Question:** "Where should I configure oh-my-claudecode?"
|
|
16
|
-
|
|
17
|
-
**Options:**
|
|
18
|
-
1. **Local (this project)** - Creates `.claude/CLAUDE.md` in current project directory. Best for project-specific configurations.
|
|
19
|
-
2. **Global (all projects)** - Creates `~/.claude/CLAUDE.md` for all Claude Code sessions. Best for consistent behavior everywhere.
|
|
20
|
-
|
|
21
|
-
## Step 2: Execute Based on Choice
|
|
22
|
-
|
|
23
|
-
### If User Chooses LOCAL:
|
|
24
|
-
|
|
25
|
-
```bash
|
|
26
|
-
# Create .claude directory in current project
|
|
27
|
-
mkdir -p .claude
|
|
28
|
-
|
|
29
|
-
# Extract old version before download
|
|
30
|
-
OLD_VERSION=$(grep -m1 "^# oh-my-claudecode" .claude/CLAUDE.md 2>/dev/null | grep -oE 'v[0-9]+\.[0-9]+\.[0-9]+' || echo "none")
|
|
31
|
-
|
|
32
|
-
# Download fresh CLAUDE.md from GitHub
|
|
33
|
-
curl -fsSL "https://raw.githubusercontent.com/Yeachan-Heo/oh-my-claudecode/main/docs/CLAUDE.md" -o .claude/CLAUDE.md && \
|
|
34
|
-
echo "Downloaded CLAUDE.md to .claude/CLAUDE.md"
|
|
35
|
-
|
|
36
|
-
# Extract new version and report
|
|
37
|
-
NEW_VERSION=$(grep -m1 "^# oh-my-claudecode" .claude/CLAUDE.md 2>/dev/null | grep -oE 'v[0-9]+\.[0-9]+\.[0-9]+' || echo "unknown")
|
|
38
|
-
if [ "$OLD_VERSION" = "none" ]; then
|
|
39
|
-
echo "Installed CLAUDE.md: $NEW_VERSION"
|
|
40
|
-
elif [ "$OLD_VERSION" = "$NEW_VERSION" ]; then
|
|
41
|
-
echo "CLAUDE.md unchanged: $NEW_VERSION"
|
|
42
|
-
else
|
|
43
|
-
echo "Updated CLAUDE.md: $OLD_VERSION -> $NEW_VERSION"
|
|
44
|
-
fi
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
### If User Chooses GLOBAL:
|
|
48
|
-
|
|
49
|
-
```bash
|
|
50
|
-
# Extract old version before download
|
|
51
|
-
OLD_VERSION=$(grep -m1 "^# oh-my-claudecode" ~/.claude/CLAUDE.md 2>/dev/null | grep -oE 'v[0-9]+\.[0-9]+\.[0-9]+' || echo "none")
|
|
52
|
-
|
|
53
|
-
# Download fresh CLAUDE.md to global config
|
|
54
|
-
curl -fsSL "https://raw.githubusercontent.com/Yeachan-Heo/oh-my-claudecode/main/docs/CLAUDE.md" -o ~/.claude/CLAUDE.md && \
|
|
55
|
-
echo "Downloaded CLAUDE.md to ~/.claude/CLAUDE.md"
|
|
56
|
-
|
|
57
|
-
# Extract new version and report
|
|
58
|
-
NEW_VERSION=$(grep -m1 "^# oh-my-claudecode" ~/.claude/CLAUDE.md 2>/dev/null | grep -oE 'v[0-9]+\.[0-9]+\.[0-9]+' || echo "unknown")
|
|
59
|
-
if [ "$OLD_VERSION" = "none" ]; then
|
|
60
|
-
echo "Installed CLAUDE.md: $NEW_VERSION"
|
|
61
|
-
elif [ "$OLD_VERSION" = "$NEW_VERSION" ]; then
|
|
62
|
-
echo "CLAUDE.md unchanged: $NEW_VERSION"
|
|
63
|
-
else
|
|
64
|
-
echo "Updated CLAUDE.md: $OLD_VERSION -> $NEW_VERSION"
|
|
65
|
-
fi
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
## Step 3: Setup HUD Statusline
|
|
69
|
-
|
|
70
|
-
The HUD shows real-time status in Claude Code's status bar. **Invoke the hud skill** to set up and configure:
|
|
71
|
-
|
|
72
|
-
Use the Skill tool to invoke: `hud` with args: `setup`
|
|
73
|
-
|
|
74
|
-
This will:
|
|
75
|
-
1. Install the HUD wrapper script to `~/.claude/hud/omc-hud.mjs`
|
|
76
|
-
2. Configure `statusLine` in `~/.claude/settings.json`
|
|
77
|
-
3. Report status and prompt to restart if needed
|
|
78
|
-
|
|
79
|
-
## Step 3.5: Clear Stale Plugin Cache
|
|
80
|
-
|
|
81
|
-
Clear old cached plugin versions to avoid conflicts:
|
|
82
|
-
|
|
83
|
-
```bash
|
|
84
|
-
# Clear stale plugin cache versions
|
|
85
|
-
CACHE_DIR="$HOME/.claude/plugins/cache/omc/oh-my-claudecode"
|
|
86
|
-
if [ -d "$CACHE_DIR" ]; then
|
|
87
|
-
LATEST=$(ls -1 "$CACHE_DIR" | sort -V | tail -1)
|
|
88
|
-
CLEARED=0
|
|
89
|
-
for dir in "$CACHE_DIR"/*; do
|
|
90
|
-
if [ "$(basename "$dir")" != "$LATEST" ]; then
|
|
91
|
-
rm -rf "$dir"
|
|
92
|
-
CLEARED=$((CLEARED + 1))
|
|
93
|
-
fi
|
|
94
|
-
done
|
|
95
|
-
[ $CLEARED -gt 0 ] && echo "Cleared $CLEARED stale cache version(s)" || echo "Cache is clean"
|
|
96
|
-
else
|
|
97
|
-
echo "No cache directory found (normal for new installs)"
|
|
98
|
-
fi
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
## Step 3.6: Check for Updates
|
|
102
|
-
|
|
103
|
-
Notify user if a newer version is available:
|
|
104
|
-
|
|
105
|
-
```bash
|
|
106
|
-
# Detect installed version
|
|
107
|
-
INSTALLED_VERSION=""
|
|
108
|
-
|
|
109
|
-
# Try cache directory first
|
|
110
|
-
if [ -d "$HOME/.claude/plugins/cache/omc/oh-my-claudecode" ]; then
|
|
111
|
-
INSTALLED_VERSION=$(ls -1 "$HOME/.claude/plugins/cache/omc/oh-my-claudecode" | sort -V | tail -1)
|
|
112
|
-
fi
|
|
113
|
-
|
|
114
|
-
# Try .omc-version.json second
|
|
115
|
-
if [ -z "$INSTALLED_VERSION" ] && [ -f ".omc-version.json" ]; then
|
|
116
|
-
INSTALLED_VERSION=$(grep -oE '"version":\s*"[^"]+' .omc-version.json | cut -d'"' -f4)
|
|
117
|
-
fi
|
|
118
|
-
|
|
119
|
-
# Try CLAUDE.md header third (local first, then global)
|
|
120
|
-
if [ -z "$INSTALLED_VERSION" ]; then
|
|
121
|
-
if [ -f ".claude/CLAUDE.md" ]; then
|
|
122
|
-
INSTALLED_VERSION=$(grep -m1 "^# oh-my-claudecode" .claude/CLAUDE.md 2>/dev/null | grep -oE 'v[0-9]+\.[0-9]+\.[0-9]+' | sed 's/^v//')
|
|
123
|
-
elif [ -f "$HOME/.claude/CLAUDE.md" ]; then
|
|
124
|
-
INSTALLED_VERSION=$(grep -m1 "^# oh-my-claudecode" "$HOME/.claude/CLAUDE.md" 2>/dev/null | grep -oE 'v[0-9]+\.[0-9]+\.[0-9]+' | sed 's/^v//')
|
|
125
|
-
fi
|
|
126
|
-
fi
|
|
127
|
-
|
|
128
|
-
# Check npm for latest version
|
|
129
|
-
LATEST_VERSION=$(npm view oh-my-claude-sisyphus version 2>/dev/null)
|
|
130
|
-
|
|
131
|
-
if [ -n "$INSTALLED_VERSION" ] && [ -n "$LATEST_VERSION" ]; then
|
|
132
|
-
# Simple version comparison (assumes semantic versioning)
|
|
133
|
-
if [ "$INSTALLED_VERSION" != "$LATEST_VERSION" ]; then
|
|
134
|
-
echo ""
|
|
135
|
-
echo "UPDATE AVAILABLE:"
|
|
136
|
-
echo " Installed: v$INSTALLED_VERSION"
|
|
137
|
-
echo " Latest: v$LATEST_VERSION"
|
|
138
|
-
echo ""
|
|
139
|
-
echo "To update, run: claude /install-plugin oh-my-claudecode"
|
|
140
|
-
else
|
|
141
|
-
echo "You're on the latest version: v$INSTALLED_VERSION"
|
|
142
|
-
fi
|
|
143
|
-
elif [ -n "$LATEST_VERSION" ]; then
|
|
144
|
-
echo "Latest version available: v$LATEST_VERSION"
|
|
145
|
-
fi
|
|
146
|
-
```
|
|
147
|
-
|
|
148
|
-
## Step 4: Verify Plugin Installation
|
|
149
|
-
|
|
150
|
-
```bash
|
|
151
|
-
grep -q "oh-my-claudecode" ~/.claude/settings.json && echo "Plugin verified" || echo "Plugin NOT found - run: claude /install-plugin oh-my-claudecode"
|
|
152
|
-
```
|
|
153
|
-
|
|
154
|
-
## Step 5: Offer MCP Server Configuration
|
|
155
|
-
|
|
156
|
-
MCP servers extend Claude Code with additional tools (web search, GitHub, etc.).
|
|
157
|
-
|
|
158
|
-
Ask user: "Would you like to configure MCP servers for enhanced capabilities? (Context7, Exa search, GitHub, etc.)"
|
|
159
|
-
|
|
160
|
-
If yes, invoke the mcp-setup skill:
|
|
161
|
-
```
|
|
162
|
-
/oh-my-claudecode:mcp-setup
|
|
163
|
-
```
|
|
164
|
-
|
|
165
|
-
If no, skip to next step.
|
|
166
|
-
|
|
167
|
-
## Step 6: Detect Upgrade from 2.x
|
|
168
|
-
|
|
169
|
-
Check if user has existing configuration:
|
|
170
|
-
```bash
|
|
171
|
-
# Check for existing 2.x artifacts
|
|
172
|
-
ls ~/.claude/commands/ralph-loop.md 2>/dev/null || ls ~/.claude/commands/ultrawork.md 2>/dev/null
|
|
173
|
-
```
|
|
174
|
-
|
|
175
|
-
If found, this is an upgrade from 2.x.
|
|
176
|
-
|
|
177
|
-
## Step 7: Show Welcome Message
|
|
178
|
-
|
|
179
|
-
### For New Users:
|
|
180
|
-
|
|
181
|
-
```
|
|
182
|
-
OMC Setup Complete!
|
|
183
|
-
|
|
184
|
-
You don't need to learn any commands. I now have intelligent behaviors that activate automatically.
|
|
185
|
-
|
|
186
|
-
WHAT HAPPENS AUTOMATICALLY:
|
|
187
|
-
- Complex tasks -> I parallelize and delegate to specialists
|
|
188
|
-
- "plan this" -> I start a planning interview
|
|
189
|
-
- "don't stop until done" -> I persist until verified complete
|
|
190
|
-
- "stop" or "cancel" -> I intelligently stop current operation
|
|
191
|
-
|
|
192
|
-
MAGIC KEYWORDS (optional power-user shortcuts):
|
|
193
|
-
Just include these words naturally in your request:
|
|
194
|
-
|
|
195
|
-
| Keyword | Effect | Example |
|
|
196
|
-
|---------|--------|---------|
|
|
197
|
-
| ralph | Persistence mode | "ralph: fix the auth bug" |
|
|
198
|
-
| ralplan | Iterative planning | "ralplan this feature" |
|
|
199
|
-
| ulw | Max parallelism | "ulw refactor the API" |
|
|
200
|
-
| plan | Planning interview | "plan the new endpoints" |
|
|
201
|
-
|
|
202
|
-
Combine them: "ralph ulw: migrate the database"
|
|
203
|
-
|
|
204
|
-
MCP SERVERS:
|
|
205
|
-
Run /oh-my-claudecode:mcp-setup to add tools like web search, GitHub, etc.
|
|
206
|
-
|
|
207
|
-
HUD STATUSLINE:
|
|
208
|
-
The status bar now shows OMC state. Restart Claude Code to see it.
|
|
209
|
-
|
|
210
|
-
That's it! Just use Claude Code normally.
|
|
211
|
-
```
|
|
212
|
-
|
|
213
|
-
### For Users Upgrading from 2.x:
|
|
214
|
-
|
|
215
|
-
```
|
|
216
|
-
OMC Setup Complete! (Upgraded from 2.x)
|
|
217
|
-
|
|
218
|
-
GOOD NEWS: Your existing commands still work!
|
|
219
|
-
- /ralph, /ultrawork, /planner, etc. all still function
|
|
220
|
-
|
|
221
|
-
WHAT'S NEW in 3.0:
|
|
222
|
-
You no longer NEED those commands. Everything is automatic now:
|
|
223
|
-
- Just say "don't stop until done" instead of /ralph
|
|
224
|
-
- Just say "fast" or "parallel" instead of /ultrawork
|
|
225
|
-
- Just say "plan this" instead of /planner
|
|
226
|
-
- Just say "stop" instead of /cancel-ralph
|
|
227
|
-
|
|
228
|
-
MAGIC KEYWORDS (power-user shortcuts):
|
|
229
|
-
| Keyword | Same as old... | Example |
|
|
230
|
-
|---------|----------------|---------|
|
|
231
|
-
| ralph | /ralph | "ralph: fix the bug" |
|
|
232
|
-
| ralplan | /ralplan | "ralplan this feature" |
|
|
233
|
-
| ulw | /ultrawork | "ulw refactor API" |
|
|
234
|
-
| plan | /planner | "plan the endpoints" |
|
|
235
|
-
|
|
236
|
-
HUD STATUSLINE:
|
|
237
|
-
The status bar now shows OMC state. Restart Claude Code to see it.
|
|
238
|
-
|
|
239
|
-
Your workflow won't break - it just got easier!
|
|
240
|
-
```
|
|
241
|
-
|
|
242
|
-
## Fallback
|
|
243
|
-
|
|
244
|
-
If curl fails, tell user to manually download from:
|
|
245
|
-
https://raw.githubusercontent.com/Yeachan-Heo/oh-my-claudecode/main/docs/CLAUDE.md
|