@oh-my-pi/cli 0.1.0 → 0.2.0

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 (78) hide show
  1. package/.github/icon.png +0 -0
  2. package/.github/logo.png +0 -0
  3. package/.github/workflows/publish.yml +1 -1
  4. package/LICENSE +21 -0
  5. package/README.md +131 -145
  6. package/biome.json +1 -1
  7. package/dist/cli.js +2032 -1136
  8. package/dist/commands/create.d.ts.map +1 -1
  9. package/dist/commands/doctor.d.ts +1 -0
  10. package/dist/commands/doctor.d.ts.map +1 -1
  11. package/dist/commands/enable.d.ts +1 -0
  12. package/dist/commands/enable.d.ts.map +1 -1
  13. package/dist/commands/info.d.ts +1 -0
  14. package/dist/commands/info.d.ts.map +1 -1
  15. package/dist/commands/init.d.ts.map +1 -1
  16. package/dist/commands/install.d.ts +1 -0
  17. package/dist/commands/install.d.ts.map +1 -1
  18. package/dist/commands/link.d.ts +2 -0
  19. package/dist/commands/link.d.ts.map +1 -1
  20. package/dist/commands/list.d.ts +1 -0
  21. package/dist/commands/list.d.ts.map +1 -1
  22. package/dist/commands/outdated.d.ts +1 -0
  23. package/dist/commands/outdated.d.ts.map +1 -1
  24. package/dist/commands/search.d.ts.map +1 -1
  25. package/dist/commands/uninstall.d.ts +1 -0
  26. package/dist/commands/uninstall.d.ts.map +1 -1
  27. package/dist/commands/update.d.ts +1 -0
  28. package/dist/commands/update.d.ts.map +1 -1
  29. package/dist/commands/why.d.ts +1 -0
  30. package/dist/commands/why.d.ts.map +1 -1
  31. package/dist/conflicts.d.ts +9 -1
  32. package/dist/conflicts.d.ts.map +1 -1
  33. package/dist/errors.d.ts +8 -0
  34. package/dist/errors.d.ts.map +1 -0
  35. package/dist/index.d.ts +19 -19
  36. package/dist/index.d.ts.map +1 -1
  37. package/dist/lock.d.ts +3 -0
  38. package/dist/lock.d.ts.map +1 -0
  39. package/dist/lockfile.d.ts +52 -0
  40. package/dist/lockfile.d.ts.map +1 -0
  41. package/dist/manifest.d.ts +5 -0
  42. package/dist/manifest.d.ts.map +1 -1
  43. package/dist/migrate.d.ts.map +1 -1
  44. package/dist/npm.d.ts +14 -2
  45. package/dist/npm.d.ts.map +1 -1
  46. package/dist/paths.d.ts +34 -2
  47. package/dist/paths.d.ts.map +1 -1
  48. package/dist/symlinks.d.ts +10 -4
  49. package/dist/symlinks.d.ts.map +1 -1
  50. package/package.json +7 -2
  51. package/plugins/metal-theme/package.json +6 -1
  52. package/plugins/subagents/package.json +6 -1
  53. package/src/cli.ts +69 -43
  54. package/src/commands/create.ts +51 -1
  55. package/src/commands/doctor.ts +95 -7
  56. package/src/commands/enable.ts +25 -8
  57. package/src/commands/info.ts +41 -5
  58. package/src/commands/init.ts +20 -2
  59. package/src/commands/install.ts +266 -52
  60. package/src/commands/link.ts +60 -9
  61. package/src/commands/list.ts +10 -5
  62. package/src/commands/outdated.ts +17 -6
  63. package/src/commands/search.ts +20 -3
  64. package/src/commands/uninstall.ts +57 -6
  65. package/src/commands/update.ts +67 -9
  66. package/src/commands/why.ts +47 -16
  67. package/src/conflicts.ts +33 -1
  68. package/src/errors.ts +22 -0
  69. package/src/index.ts +19 -25
  70. package/src/lock.ts +46 -0
  71. package/src/lockfile.ts +132 -0
  72. package/src/manifest.ts +143 -35
  73. package/src/migrate.ts +14 -3
  74. package/src/npm.ts +74 -18
  75. package/src/paths.ts +77 -9
  76. package/src/symlinks.ts +134 -17
  77. package/tsconfig.json +7 -3
  78. package/CHECK.md +0 -352
Binary file
Binary file
@@ -21,7 +21,7 @@ jobs:
21
21
 
22
22
  - uses: actions/setup-node@v4
23
23
  with:
24
- node-version: '20'
24
+ node-version: '24'
25
25
  registry-url: 'https://registry.npmjs.org'
26
26
 
27
27
  - name: Install dependencies
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,10 +1,28 @@
1
- # Oh My Pi (omp)
1
+ <p align="center">
2
+ <img src=".github/logo.png?raw=true" alt="Oh My Pi" height="300">
3
+ </p>
2
4
 
3
- Plugin manager for pi configuration. Like oh-my-zsh, but for pi.
5
+ <p align="center">
6
+ <strong>Plugin manager for <a href="https://github.com/badlogic/pi-mono">pi</a>.</strong>
7
+ </p>
4
8
 
5
- **v1.0 - npm-Native Architecture**
9
+ <p align="center">
10
+ Like oh-my-zsh, but for your AI coding assistant.
11
+ </p>
6
12
 
7
- Plugins are npm packages with an `omp` field in package.json. Discover plugins via npm, install with semver, and enjoy a familiar package management experience.
13
+ <p align="center">
14
+ <a href="https://www.npmjs.com/package/@oh-my-pi/cli"><img src="https://img.shields.io/npm/v/@oh-my-pi/cli?style=flat&colorA=18181B&colorB=F0DB4F" alt="npm version"></a>
15
+ <a href="https://github.com/can1357/oh-my-pi/actions"><img src="https://img.shields.io/github/actions/workflow/status/can1357/oh-my-pi/ci.yml?style=flat&colorA=18181B" alt="CI"></a>
16
+ <a href="https://github.com/can1357/oh-my-pi/blob/main/LICENSE"><img src="https://img.shields.io/github/license/can1357/oh-my-pi?style=flat&colorA=18181B" alt="License"></a>
17
+ </p>
18
+
19
+ ---
20
+
21
+ **Oh My Pi won't make Claude write better code...** but it might make _you_ feel like it does.
22
+
23
+ Install community plugins with a single command. Themes, custom agents, slash commands, tools — all managed through npm, all a `omp install` away.
24
+
25
+ No more copy-pasting prompt files. No more manually symlinking configs. Just vibes.
8
26
 
9
27
  ## Installation
10
28
 
@@ -15,209 +33,177 @@ npm install -g @oh-my-pi/cli
15
33
  ## Quick Start
16
34
 
17
35
  ```bash
36
+ # Initialize a project-local plugin config (optional)
37
+ omp init
38
+
18
39
  # Search for plugins
19
40
  omp search agents
20
41
 
21
42
  # Install a plugin
22
43
  omp install @oh-my-pi/subagents
23
44
 
24
- # List installed plugins
45
+ # See what you've got
25
46
  omp list
26
47
 
27
48
  # Check for updates
28
49
  omp outdated
29
50
 
30
- # Update all plugins
51
+ # Update everything
31
52
  omp update
32
53
  ```
33
54
 
34
- ## Commands
55
+ ## How It Works
35
56
 
36
- ### Core Commands
57
+ omp installs plugins via npm and symlinks their files into your pi configuration directory:
37
58
 
38
- | Command | Description |
39
- |----------------------|--------------------------------------------------------|
40
- | `omp install [pkg...]` | Install plugin(s). No args = install from plugins.json |
41
- | `omp uninstall <pkg>` | Remove plugin and its symlinks |
42
- | `omp update [pkg]` | Update to latest within semver range |
43
- | `omp list` | Show installed plugins |
44
- | `omp link <path>` | Symlink local plugin (dev mode) |
59
+ ```
60
+ ~/.pi/
61
+ ├── agent/ # Where plugin files get symlinked
62
+ │ ├── agents/ # Agent definitions (.md)
63
+ │ ├── commands/ # Slash commands (.md)
64
+ │ ├── tools/ # Custom tools (.ts)
65
+ │ └── themes/ # Theme files (.json)
66
+ └── plugins/ # Plugin storage
67
+ ├── package.json # Installed plugins manifest
68
+ └── node_modules/ # Actual plugin packages
69
+ ```
70
+
71
+ Plugins declare which files to install via the `omp.install` field in their `package.json`. omp creates symlinks from the plugin's files into the appropriate `~/.pi/agent/` subdirectories.
45
72
 
46
- ### Discovery & Info
73
+ ## Global vs Local Plugins
47
74
 
48
- | Command | Description |
49
- |------------------------|--------------------------------------------|
50
- | `omp search <query>` | Search npm for omp-plugin keyword |
51
- | `omp info <pkg>` | Show plugin details before install |
52
- | `omp outdated` | List plugins with newer versions |
75
+ omp supports both global and project-local plugin configurations:
53
76
 
54
- ### Maintenance
77
+ | Scope | Config Location | Agent Directory | Use Case |
78
+ |-------|-----------------|-----------------|----------|
79
+ | Global | `~/.pi/plugins/` | `~/.pi/agent/` | Personal defaults |
80
+ | Local | `.pi/` | `.pi/agent/` | Project-specific plugins |
55
81
 
56
- | Command | Description |
57
- |--------------------------|------------------------------------------|
58
- | `omp init` | Create .pi/plugins.json in current project |
59
- | `omp doctor` | Check for broken symlinks, conflicts |
60
- | `omp why <file>` | Show which plugin installed a file |
61
- | `omp enable/disable <pkg>` | Toggle plugin without uninstall |
82
+ ```bash
83
+ # Explicit scope
84
+ omp install -g @oh-my-pi/subagents # Global
85
+ omp install -l @oh-my-pi/subagents # Local
62
86
 
63
- ### Plugin Development
87
+ # Auto-detect: uses local if .pi/plugins.json exists, otherwise global
88
+ omp install @oh-my-pi/subagents
89
+ ```
64
90
 
65
- | Command | Description |
66
- |--------------------|--------------------------------|
67
- | `omp create <name>`| Scaffold new plugin from template |
68
- | `omp link <path>` | Symlink local plugin for dev |
91
+ Initialize a project-local config with `omp init`.
69
92
 
70
- ### Flags
93
+ ## Commands
71
94
 
72
- - `--global / -g`: Install to ~/.pi (default)
73
- - `--save / -S`: Add to plugins.json
74
- - `--json`: Machine-readable output
75
- - `--force`: Overwrite conflicts
95
+ | Command | Alias | Description |
96
+ |---------|-------|-------------|
97
+ | `omp install [pkg...]` | `i` | Install plugin(s). No args = install from plugins.json |
98
+ | `omp uninstall <pkg>` | `rm` | Remove plugin and its symlinks |
99
+ | `omp update [pkg]` | `up` | Update to latest within semver range |
100
+ | `omp list` | `ls` | Show installed plugins |
101
+ | `omp search <query>` | | Search npm for plugins |
102
+ | `omp info <pkg>` | | Show plugin details before install |
103
+ | `omp outdated` | | List plugins with newer versions |
104
+ | `omp doctor` | | Check for broken symlinks, conflicts |
105
+ | `omp link <path>` | | Symlink local plugin (dev mode) |
106
+ | `omp create <name>` | | Scaffold new plugin from template |
107
+ | `omp init` | | Create .pi/plugins.json in current project |
108
+ | `omp why <file>` | | Show which plugin installed a file |
109
+ | `omp enable <name>` | | Enable a disabled plugin |
110
+ | `omp disable <name>` | | Disable plugin without uninstalling |
111
+ | `omp migrate` | | Migrate from legacy manifest.json format |
112
+
113
+ Most commands accept `-g`/`--global` or `-l`/`--local` flags to override scope auto-detection.
76
114
 
77
- ## Plugin Format
115
+ ## Creating Plugins
78
116
 
79
- Plugins are npm packages with an `omp` field in package.json:
117
+ Plugins are npm packages with an `omp` field in `package.json`:
80
118
 
81
119
  ```json
82
120
  {
83
- "name": "@oh-my-pi/subagents",
121
+ "name": "my-cool-plugin",
84
122
  "version": "1.0.0",
85
- "description": "Task delegation agents for pi-agent",
86
- "keywords": ["omp-plugin", "agents"],
123
+ "keywords": ["omp-plugin"],
87
124
  "omp": {
88
125
  "install": [
89
- { "src": "agents/task.md", "dest": "agent/agents/task.md" },
90
- { "src": "tools/task/", "dest": "agent/tools/task/" }
126
+ { "src": "agents/researcher.md", "dest": "agent/agents/researcher.md" },
127
+ { "src": "commands/research.md", "dest": "agent/commands/research.md" },
128
+ { "src": "tools/search/index.ts", "dest": "agent/tools/search/index.ts" },
129
+ { "src": "themes/dark.json", "dest": "agent/themes/dark.json" }
91
130
  ]
92
131
  },
93
- "files": ["agents", "tools"]
132
+ "files": ["agents", "commands", "tools", "themes"]
94
133
  }
95
134
  ```
96
135
 
97
- ### Convention
98
-
99
- - Include `omp-plugin` keyword for discoverability
100
- - No namespace required (but `omp-` prefix is recommended)
101
- - Use semver for versioning
102
-
103
- ## Directory Structure
136
+ ### Plugin Structure
104
137
 
105
- ### Global (default)
106
-
107
- ```
108
- ~/.pi/
109
- ├── plugins/
110
- │ ├── node_modules/ # npm-managed
111
- │ │ ├── @oh-my-pi/subagents/
112
- │ │ └── @oh-my-pi/metal-theme/
113
- │ ├── package.json # Global plugin manifest
114
- │ └── package-lock.json # Lock file
115
- ├── agent/ # Symlink targets
116
- │ ├── agents/
117
- │ ├── tools/
118
- │ ├── themes/
119
- │ └── commands/
120
138
  ```
121
-
122
- ### Project-Local
123
-
124
- ```
125
- .pi/
126
- ├── plugins.json # Project plugin config
127
- ├── plugins-lock.json # Lock file
128
- └── node_modules/ # Project-scoped installs
129
- └── omp-my-plugin/
139
+ my-cool-plugin/
140
+ ├── package.json
141
+ ├── agents/ # Agent definitions
142
+ │ └── researcher.md
143
+ ├── commands/ # Slash commands
144
+ │ └── research.md
145
+ ├── tools/ # Custom tools
146
+ └── search/
147
+ └── index.ts
148
+ └── themes/ # Theme files
149
+ └── dark.json
130
150
  ```
131
151
 
132
- Project plugins.json:
133
- ```json
134
- {
135
- "plugins": {
136
- "@oh-my-pi/subagents": "^2.0.0",
137
- "@oh-my-pi/metal-theme": "^1.0.0"
138
- }
139
- }
140
- ```
152
+ ### Install Mappings
141
153
 
142
- ## Install Flow
154
+ The `omp.install` array maps source files to their destination in the agent directory:
143
155
 
144
- ```bash
145
- omp install @oh-my-pi/subagents
146
- ```
156
+ - `src`: Path relative to the plugin root
157
+ - `dest`: Path relative to the pi config dir (usually starts with `agent/`)
147
158
 
148
- 1. Resolve version from npm registry
149
- 2. Check for conflicts (same dest from different plugins)
150
- 3. `npm install --prefix ~/.pi/plugins omp-subagents`
151
- 4. Read package.json → omp.install
152
- 5. For each {src, dest}: symlink to ~/.pi/{dest}
153
- 6. Recursively process dependencies with omp field
154
- 7. Update package.json
159
+ ### Publishing
155
160
 
156
- ### Conflict Detection
161
+ 1. Add `omp-plugin` to your `keywords` array (required for `omp search` discovery)
162
+ 2. Include source directories in the `files` array
163
+ 3. Publish to npm: `npm publish`
157
164
 
158
- ```
159
- ⚠ Conflict: omp-dark-theme and omp-nord-theme both install agent/themes/dark.json
160
- Choose: [1] dark-theme [2] nord-theme [3] abort
161
- ```
165
+ Your plugin is now discoverable via `omp search`.
162
166
 
163
- ## Creating Plugins
167
+ ### Development Workflow
164
168
 
165
169
  ```bash
170
+ # Scaffold a new plugin
166
171
  omp create my-plugin
167
- ```
168
-
169
- Creates:
170
- ```
171
- omp-my-plugin/
172
- ├── package.json
173
- ├── README.md
174
- ├── agents/
175
- │ └── example.md
176
- ├── tools/
177
- ├── themes/
178
- └── commands/
179
- ```
180
172
 
181
- ### Publishing
173
+ # Link for local development (changes reflect immediately)
174
+ omp link ./my-plugin
182
175
 
183
- 1. Create a package with an `omp` field in package.json
184
- 2. Add `omp-plugin` to keywords
185
- 3. Publish to npm: `npm publish`
186
- 4. Users install with: `omp install your-package-name`
176
+ # Test your plugin
177
+ omp list
187
178
 
188
- ## Migration from v0.x
179
+ # When ready, publish
180
+ cd my-plugin && npm publish
181
+ ```
189
182
 
190
- If you have plugins installed with the old manifest.json format:
183
+ ## Bundled Plugins
191
184
 
192
- ```bash
193
- omp migrate
194
- ```
185
+ - **[@oh-my-pi/subagents](https://npmjs.com/package/@oh-my-pi/subagents)**: Task delegation with specialized sub-agents (task, planner, explore, reviewer)
186
+ - **[@oh-my-pi/metal-theme](https://npmjs.com/package/@oh-my-pi/metal-theme)**: A metal theme
195
187
 
196
- This will:
197
- 1. Convert manifest.json → package.json format
198
- 2. Move plugins to node_modules structure
199
- 3. Re-create symlinks
200
- 4. Archive old manifest.json
188
+ ## Troubleshooting
201
189
 
202
- ## Bundled Example Plugins
190
+ ```bash
191
+ # Check for broken symlinks and conflicts
192
+ omp doctor
203
193
 
204
- This package includes example plugins in the `plugins/` directory:
194
+ # See which plugin installed a specific file
195
+ omp why ~/.pi/agent/agents/researcher.md
205
196
 
206
- - **@oh-my-pi/subagents** - Task delegation system with specialized subagents
207
- - **@oh-my-pi/metal-theme** - Metal theme for pi
197
+ # Temporarily disable a plugin
198
+ omp disable @oh-my-pi/subagents
208
199
 
209
- Install bundled plugins:
210
- ```bash
211
- # After npm install -g @oh-my-pi/cli
212
- omp install $(npm root -g)/@oh-my-pi/cli/plugins/subagents
213
- omp install $(npm root -g)/@oh-my-pi/cli/plugins/metal-theme
200
+ # Re-enable it later
201
+ omp enable @oh-my-pi/subagents
214
202
  ```
215
203
 
216
- Or link for development:
217
- ```bash
218
- omp link ./plugins/subagents
219
- omp link ./plugins/metal-theme
220
- ```
204
+ ## Credits
205
+
206
+ Built for [pi](https://github.com/badlogic/pi-mono) by [@badlogic](https://github.com/badlogic).
221
207
 
222
208
  ## License
223
209
 
package/biome.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "$schema": "https://biomejs.dev/schemas/2.3.5/schema.json",
2
+ "$schema": "https://biomejs.dev/schemas/2.3.10/schema.json",
3
3
  "linter": {
4
4
  "enabled": true,
5
5
  "rules": {