oh-my-opencode-slim 0.1.0 → 0.2.1

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.
Files changed (49) hide show
  1. package/README.md +159 -61
  2. package/dist/agents/index.d.ts +46 -3
  3. package/dist/cli/config-manager.d.ts +10 -0
  4. package/dist/cli/index.d.ts +2 -0
  5. package/dist/cli/index.js +546 -0
  6. package/dist/cli/install.d.ts +2 -0
  7. package/dist/cli/types.d.ts +24 -0
  8. package/dist/config/constants.d.ts +6 -0
  9. package/dist/config/index.d.ts +1 -0
  10. package/dist/config/schema.d.ts +9 -2
  11. package/dist/index.d.ts +4 -3
  12. package/dist/index.js +2238 -52
  13. package/dist/mcp/context7.d.ts +6 -0
  14. package/dist/mcp/grep-app.d.ts +6 -0
  15. package/dist/mcp/index.d.ts +6 -0
  16. package/dist/mcp/types.d.ts +5 -0
  17. package/dist/mcp/websearch.d.ts +6 -0
  18. package/dist/shared/index.d.ts +1 -0
  19. package/dist/shared/zip-extractor.d.ts +1 -0
  20. package/dist/tools/ast-grep/cli.d.ts +15 -0
  21. package/dist/tools/ast-grep/constants.d.ts +25 -0
  22. package/dist/tools/ast-grep/downloader.d.ts +5 -0
  23. package/dist/tools/ast-grep/index.d.ts +10 -0
  24. package/dist/tools/ast-grep/napi.d.ts +13 -0
  25. package/dist/tools/ast-grep/tools.d.ts +3 -0
  26. package/dist/tools/ast-grep/types.d.ts +30 -0
  27. package/dist/tools/ast-grep/utils.d.ts +4 -0
  28. package/dist/tools/grep/cli.d.ts +3 -0
  29. package/dist/tools/grep/constants.d.ts +17 -0
  30. package/dist/tools/grep/downloader.d.ts +3 -0
  31. package/dist/tools/grep/index.d.ts +5 -0
  32. package/dist/tools/grep/tools.d.ts +2 -0
  33. package/dist/tools/grep/types.d.ts +35 -0
  34. package/dist/tools/grep/utils.d.ts +2 -0
  35. package/dist/tools/index.d.ts +4 -0
  36. package/dist/tools/lsp/client.d.ts +52 -0
  37. package/dist/tools/lsp/config.d.ts +4 -0
  38. package/dist/tools/lsp/constants.d.ts +8 -0
  39. package/dist/tools/lsp/index.d.ts +3 -0
  40. package/dist/tools/lsp/tools.d.ts +5 -0
  41. package/dist/tools/lsp/types.d.ts +109 -0
  42. package/dist/tools/lsp/utils.d.ts +21 -0
  43. package/dist/tools/quota/api.d.ts +5 -0
  44. package/dist/tools/quota/command.d.ts +1 -0
  45. package/dist/tools/quota/index.d.ts +21 -0
  46. package/dist/tools/quota/types.d.ts +41 -0
  47. package/dist/utils/index.d.ts +1 -0
  48. package/dist/utils/polling.d.ts +21 -0
  49. package/package.json +13 -6
package/README.md CHANGED
@@ -1,8 +1,16 @@
1
+ <div align="center">
2
+
1
3
  # oh-my-opencode-slim
2
4
 
3
- A lightweight, powerful agent orchestration plugin for **OpenCode**. This is a slimmed-down fork of [oh-my-opencode](https://github.com/code-yeongyu/oh-my-opencode), focused on core agent orchestration without the extra bells and whistles.
5
+ **A lightweight, powerful agent orchestration plugin for OpenCode**
6
+
7
+ <img src="img/hero.png" alt="Agent Orchestration - Hub and Spoke Model" width="520">
8
+
9
+ *Transform your AI assistant into a manager capable of delegating complex tasks to specialized sub-agents, running searches in the background, and managing multi-step workflows with ease.*
4
10
 
5
- It transforms your AI assistant into a manager capable of delegating complex tasks to specialized sub-agents, running searches in the background, and managing multi-step workflows with ease.
11
+ </div>
12
+
13
+ > Slimmed-down fork of [oh-my-opencode](https://github.com/code-yeongyu/oh-my-opencode) — focused on core agent orchestration without the extra bells and whistles.
6
14
 
7
15
  ---
8
16
 
@@ -10,86 +18,125 @@ It transforms your AI assistant into a manager capable of delegating complex tas
10
18
 
11
19
  ### For Humans
12
20
 
13
- > **Prerequisite: [Bun](https://bun.sh/) is required**
21
+ Run the interactive installer:
14
22
 
15
- 1. **Install OpenCode** (if not already installed):
16
- ```bash
17
- # Check if installed
18
- opencode --version
19
-
20
- # If not, see: https://opencode.ai/docs
21
- ```
23
+ ```bash
24
+ bunx oh-my-opencode-slim install
25
+ ```
22
26
 
23
- 2. **Add the plugin to your OpenCode config** (`~/.config/opencode/opencode.json`):
24
- ```json
25
- {
26
- "plugin": [
27
- "oh-my-opencode-slim"
28
- ]
29
- }
30
- ```
27
+ Or use non-interactive mode:
31
28
 
32
- 3. **Verify setup**:
33
- ```bash
34
- opencode
35
- ```
29
+ ```bash
30
+ bunx oh-my-opencode-slim install --no-tui --antigravity=yes --openai=yes --cerebras=no
31
+ ```
32
+
33
+ **Alternative: Ask any coding agent**
34
+
35
+ Paste this into Claude Code, AmpCode, Cursor, or any coding agent:
36
+
37
+ ```
38
+ Install and configure by following the instructions here:
39
+ https://raw.githubusercontent.com/alvinunreal/oh-my-opencode-slim/refs/heads/master/README.md
40
+ ```
36
41
 
37
42
  ### For LLM Agents
38
43
 
39
44
  <details>
40
45
  <summary>Instructions for LLM Agents (click to expand)</summary>
41
46
 
42
- If you're an LLM Agent helping set up oh-my-opencode-slim, follow these steps:
47
+ If you're an LLM Agent helping set up oh-my-opencode-slim, follow these steps.
48
+
49
+ ---
43
50
 
44
51
  #### Step 1: Check OpenCode Installation
45
52
 
46
53
  ```bash
47
- if command -v opencode &> /dev/null; then
48
- echo "OpenCode $(opencode --version) is installed"
49
- else
50
- echo "OpenCode is not installed. Please install it first."
51
- echo "Ref: https://opencode.ai/docs"
52
- fi
54
+ opencode --version
53
55
  ```
54
56
 
55
- #### Step 2: Add Plugin to Config
57
+ If not installed, direct the user to https://opencode.ai/docs first.
56
58
 
57
- Edit `~/.config/opencode/opencode.json` and add `"oh-my-opencode-slim"` to the plugin array:
59
+ ---
58
60
 
59
- ```json
60
- {
61
- "plugin": [
62
- "oh-my-opencode-slim"
63
- ]
64
- }
65
- ```
61
+ #### Step 2: Ask About Provider Access
62
+
63
+ Ask these questions **one at a time**, waiting for responses:
64
+
65
+ 1. "Do you have an **Antigravity** subscription?" *(Provides Claude + Gemini via `google/` prefix)*
66
+ 2. "Do you have access to **OpenAI** API?" *(Enables `openai/` models)*
67
+ 3. "Do you have access to **Cerebras** API?" *(Enables `cerebras/` for fast exploration)*
68
+
69
+ ---
70
+
71
+ #### Step 3: Run the Installer
66
72
 
67
- #### Step 3: Verify Setup
73
+ Based on answers, run:
68
74
 
69
75
  ```bash
70
- opencode --version # Should be 1.0.150 or higher
71
- cat ~/.config/opencode/opencode.json # Should contain "oh-my-opencode-slim" in plugin array
76
+ bunx oh-my-opencode-slim install --no-tui --antigravity=<yes|no> --openai=<yes|no> --cerebras=<yes|no>
72
77
  ```
73
78
 
74
- #### Step 4: Configure Authentication
79
+ **Examples:**
80
+ ```bash
81
+ # Antigravity + OpenAI
82
+ bunx oh-my-opencode-slim install --no-tui --antigravity=yes --openai=yes --cerebras=no
75
83
 
76
- Add the Antigravity auth plugin to your config:
77
- ```json
78
- {
79
- "plugin": [
80
- "oh-my-opencode-slim",
81
- "opencode-antigravity-auth@latest"
82
- ]
83
- }
84
+ # OpenAI only
85
+ bunx oh-my-opencode-slim install --no-tui --antigravity=no --openai=yes --cerebras=no
86
+
87
+ # All providers
88
+ bunx oh-my-opencode-slim install --no-tui --antigravity=yes --openai=yes --cerebras=yes
84
89
  ```
85
90
 
86
- Then authenticate:
91
+ The installer automatically:
92
+ - Adds the plugin to `~/.config/opencode/opencode.json`
93
+ - Adds `opencode-antigravity-auth` plugin (if Antigravity enabled)
94
+ - Configures Google provider with model definitions
95
+ - Generates agent model mappings in `~/.config/opencode/oh-my-opencode-slim.json`
96
+
97
+ ---
98
+
99
+ #### Step 4: Authentication
100
+
101
+ After installation, guide the user:
102
+
103
+ **For Antigravity:**
87
104
  ```bash
88
105
  opencode auth login
89
- # Select Provider: Google
90
- # Select Login method: OAuth with Google (Antigravity)
106
+ # Select: Google → OAuth with Google (Antigravity)
91
107
  ```
92
108
 
109
+ **For OpenAI:**
110
+ ```bash
111
+ export OPENAI_API_KEY="sk-..."
112
+ ```
113
+
114
+ **For Cerebras:**
115
+ ```bash
116
+ export CEREBRAS_API_KEY="..."
117
+ ```
118
+
119
+ ---
120
+
121
+ #### Step 5: Verify
122
+
123
+ ```bash
124
+ opencode
125
+ ```
126
+
127
+ ---
128
+
129
+ #### Troubleshooting
130
+
131
+ If the installer fails, check the expected config format:
132
+ ```bash
133
+ bunx oh-my-opencode-slim install --help
134
+ ```
135
+
136
+ Then manually create the config files at:
137
+ - `~/.config/opencode/opencode.json`
138
+ - `~/.config/opencode/oh-my-opencode-slim.json`
139
+
93
140
  </details>
94
141
 
95
142
  ---
@@ -118,14 +165,14 @@ The plugin follows a "Hub and Spoke" model:
118
165
 
119
166
  | Agent | Role | Default Model | Best Used For |
120
167
  | :--- | :--- | :--- | :--- |
121
- | **orchestrator** | Manager | `google/antigravity-claude-opus-4-5-thinking-high` | Planning, task delegation, and overall coordination. |
168
+ | **orchestrator** | Manager | `google/claude-opus-4-5-thinking` | Planning, task delegation, and overall coordination. |
122
169
  | **oracle** | Architect | `openai/gpt-5.2-codex` | Complex debugging, architectural decisions, and code reviews. |
123
170
  | **explore** | Searcher | `cerebras/zai-glm-4.6` | Fast codebase grep, finding patterns, and locating definitions. |
124
171
  | **librarian** | Researcher | `google/gemini-3-flash` | External library docs, GitHub examples, and API research. |
125
172
  | **frontend-ui-ux-engineer** | Designer | `google/gemini-3-flash` | Visual changes, CSS/styling, and React/Vue component polish. |
126
173
  | **document-writer** | Scribe | `google/gemini-3-flash` | Technical documentation, READMEs, and inline code comments. |
127
174
  | **multimodal-looker** | Visionary | `google/gemini-3-flash` | Analyzing screenshots, wireframes, or UI designs. |
128
- | **code-simplicity-reviewer** | Minimalist | `google/antigravity-claude-opus-4-5-thinking-high` | Ruthless code simplification and YAGNI principle enforcement. |
175
+ | **code-simplicity-reviewer** | Minimalist | `google/claude-opus-4-5-thinking` | Ruthless code simplification and YAGNI principle enforcement. |
129
176
 
130
177
  ---
131
178
 
@@ -133,13 +180,64 @@ The plugin follows a "Hub and Spoke" model:
133
180
 
134
181
  ### Background Tasks
135
182
 
136
- The plugin provides three core tools to manage asynchronous work:
183
+ The plugin provides tools to manage asynchronous work:
184
+
185
+ | Tool | Description |
186
+ |------|-------------|
187
+ | `background_task` | Launch an agent in a new session (`sync=true` blocks, `sync=false` runs in background) |
188
+ | `background_output` | Fetch the result of a background task by ID |
189
+ | `background_cancel` | Abort running tasks |
137
190
 
138
- - `background_task`: Launches an agent in a new session.
139
- - `sync=true`: Blocks until the agent finishes (ideal for quick sub-tasks).
140
- - `sync=false`: Runs in the background (ideal for long searches or research).
141
- - `background_output`: Fetches the result of a background task using its ID.
142
- - `background_cancel`: Aborts running tasks if they are no longer needed.
191
+ ### LSP Tools
192
+
193
+ Language Server Protocol integration for code intelligence:
194
+
195
+ | Tool | Description |
196
+ |------|-------------|
197
+ | `lsp_goto_definition` | Jump to symbol definition |
198
+ | `lsp_find_references` | Find all usages of a symbol across the workspace |
199
+ | `lsp_diagnostics` | Get errors/warnings from the language server |
200
+ | `lsp_rename` | Rename a symbol across all files |
201
+
202
+ ### Code Search Tools
203
+
204
+ Fast code search and refactoring:
205
+
206
+ | Tool | Description |
207
+ |------|-------------|
208
+ | `grep` | Fast content search using ripgrep |
209
+ | `ast_grep_search` | AST-aware code pattern matching (25 languages) |
210
+ | `ast_grep_replace` | AST-aware code refactoring with dry-run support |
211
+
212
+ ### Quota Tool
213
+
214
+ For Antigravity users:
215
+
216
+ | Tool | Description |
217
+ |------|-------------|
218
+ | `antigravity_quota` | Check API quota for all Antigravity accounts (compact view with progress bars) |
219
+
220
+ ---
221
+
222
+ ## MCP Servers
223
+
224
+ Built-in Model Context Protocol servers (enabled by default):
225
+
226
+ | MCP | Purpose | URL |
227
+ |-----|---------|-----|
228
+ | `websearch` | Real-time web search via Exa AI | `https://mcp.exa.ai/mcp` |
229
+ | `context7` | Official library documentation | `https://mcp.context7.com/mcp` |
230
+ | `grep_app` | GitHub code search via grep.app | `https://mcp.grep.app` |
231
+
232
+ ### Disabling MCPs
233
+
234
+ You can disable specific MCP servers in your config:
235
+
236
+ ```json
237
+ {
238
+ "disabled_mcps": ["websearch", "grep_app"]
239
+ }
240
+ ```
143
241
 
144
242
  ---
145
243
 
@@ -1,6 +1,49 @@
1
- import type { AgentConfig } from "@opencode-ai/sdk";
2
- import { type PluginConfig } from "../config";
1
+ import type { AgentConfig as SDKAgentConfig } from "@opencode-ai/sdk";
2
+ import { type AgentName, type PluginConfig } from "../config";
3
3
  import { type AgentDefinition } from "./orchestrator";
4
+ import { createOracleAgent } from "./oracle";
5
+ import { createLibrarianAgent } from "./librarian";
6
+ import { createExploreAgent } from "./explore";
7
+ import { createFrontendAgent } from "./frontend";
8
+ import { createDocumentWriterAgent } from "./document-writer";
9
+ import { createMultimodalAgent } from "./multimodal";
10
+ import { createSimplicityReviewerAgent } from "./simplicity-reviewer";
4
11
  export type { AgentDefinition } from "./orchestrator";
12
+ type SubagentName = Exclude<AgentName, "orchestrator">;
13
+ /** Short descriptions for each subagent (used in tool descriptions) */
14
+ export declare const SUBAGENT_INFO: {
15
+ readonly explore: {
16
+ readonly factory: typeof createExploreAgent;
17
+ readonly shortDesc: "codebase grep";
18
+ };
19
+ readonly librarian: {
20
+ readonly factory: typeof createLibrarianAgent;
21
+ readonly shortDesc: "docs/GitHub";
22
+ };
23
+ readonly oracle: {
24
+ readonly factory: typeof createOracleAgent;
25
+ readonly shortDesc: "strategy";
26
+ };
27
+ readonly "frontend-ui-ux-engineer": {
28
+ readonly factory: typeof createFrontendAgent;
29
+ readonly shortDesc: "UI/UX";
30
+ };
31
+ readonly "document-writer": {
32
+ readonly factory: typeof createDocumentWriterAgent;
33
+ readonly shortDesc: "docs";
34
+ };
35
+ readonly "multimodal-looker": {
36
+ readonly factory: typeof createMultimodalAgent;
37
+ readonly shortDesc: "image/visual analysis";
38
+ };
39
+ readonly "code-simplicity-reviewer": {
40
+ readonly factory: typeof createSimplicityReviewerAgent;
41
+ readonly shortDesc: "code review";
42
+ };
43
+ };
44
+ /** Generate agent list string for tool descriptions */
45
+ export declare function getAgentListDescription(): string;
46
+ /** Get list of agent names */
47
+ export declare function getAgentNames(): SubagentName[];
5
48
  export declare function createAgents(config?: PluginConfig): AgentDefinition[];
6
- export declare function getAgentConfigs(config?: PluginConfig): Record<string, AgentConfig>;
49
+ export declare function getAgentConfigs(config?: PluginConfig): Record<string, SDKAgentConfig>;
@@ -0,0 +1,10 @@
1
+ import type { ConfigMergeResult, DetectedConfig, InstallConfig } from "./types";
2
+ export declare function isOpenCodeInstalled(): Promise<boolean>;
3
+ export declare function getOpenCodeVersion(): Promise<string | null>;
4
+ export declare function fetchLatestVersion(packageName: string): Promise<string | null>;
5
+ export declare function addPluginToOpenCodeConfig(): Promise<ConfigMergeResult>;
6
+ export declare function addAuthPlugins(installConfig: InstallConfig): Promise<ConfigMergeResult>;
7
+ export declare function addProviderConfig(installConfig: InstallConfig): ConfigMergeResult;
8
+ export declare function generateLiteConfig(installConfig: InstallConfig): Record<string, unknown>;
9
+ export declare function writeLiteConfig(installConfig: InstallConfig): ConfigMergeResult;
10
+ export declare function detectCurrentConfig(): DetectedConfig;
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env bun
2
+ export {};