@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.
- package/.github/icon.png +0 -0
- package/.github/logo.png +0 -0
- package/.github/workflows/publish.yml +1 -1
- package/LICENSE +21 -0
- package/README.md +131 -145
- package/biome.json +1 -1
- package/dist/cli.js +2032 -1136
- package/dist/commands/create.d.ts.map +1 -1
- package/dist/commands/doctor.d.ts +1 -0
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/enable.d.ts +1 -0
- package/dist/commands/enable.d.ts.map +1 -1
- package/dist/commands/info.d.ts +1 -0
- package/dist/commands/info.d.ts.map +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/install.d.ts +1 -0
- package/dist/commands/install.d.ts.map +1 -1
- package/dist/commands/link.d.ts +2 -0
- package/dist/commands/link.d.ts.map +1 -1
- package/dist/commands/list.d.ts +1 -0
- package/dist/commands/list.d.ts.map +1 -1
- package/dist/commands/outdated.d.ts +1 -0
- package/dist/commands/outdated.d.ts.map +1 -1
- package/dist/commands/search.d.ts.map +1 -1
- package/dist/commands/uninstall.d.ts +1 -0
- package/dist/commands/uninstall.d.ts.map +1 -1
- package/dist/commands/update.d.ts +1 -0
- package/dist/commands/update.d.ts.map +1 -1
- package/dist/commands/why.d.ts +1 -0
- package/dist/commands/why.d.ts.map +1 -1
- package/dist/conflicts.d.ts +9 -1
- package/dist/conflicts.d.ts.map +1 -1
- package/dist/errors.d.ts +8 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/index.d.ts +19 -19
- package/dist/index.d.ts.map +1 -1
- package/dist/lock.d.ts +3 -0
- package/dist/lock.d.ts.map +1 -0
- package/dist/lockfile.d.ts +52 -0
- package/dist/lockfile.d.ts.map +1 -0
- package/dist/manifest.d.ts +5 -0
- package/dist/manifest.d.ts.map +1 -1
- package/dist/migrate.d.ts.map +1 -1
- package/dist/npm.d.ts +14 -2
- package/dist/npm.d.ts.map +1 -1
- package/dist/paths.d.ts +34 -2
- package/dist/paths.d.ts.map +1 -1
- package/dist/symlinks.d.ts +10 -4
- package/dist/symlinks.d.ts.map +1 -1
- package/package.json +7 -2
- package/plugins/metal-theme/package.json +6 -1
- package/plugins/subagents/package.json +6 -1
- package/src/cli.ts +69 -43
- package/src/commands/create.ts +51 -1
- package/src/commands/doctor.ts +95 -7
- package/src/commands/enable.ts +25 -8
- package/src/commands/info.ts +41 -5
- package/src/commands/init.ts +20 -2
- package/src/commands/install.ts +266 -52
- package/src/commands/link.ts +60 -9
- package/src/commands/list.ts +10 -5
- package/src/commands/outdated.ts +17 -6
- package/src/commands/search.ts +20 -3
- package/src/commands/uninstall.ts +57 -6
- package/src/commands/update.ts +67 -9
- package/src/commands/why.ts +47 -16
- package/src/conflicts.ts +33 -1
- package/src/errors.ts +22 -0
- package/src/index.ts +19 -25
- package/src/lock.ts +46 -0
- package/src/lockfile.ts +132 -0
- package/src/manifest.ts +143 -35
- package/src/migrate.ts +14 -3
- package/src/npm.ts +74 -18
- package/src/paths.ts +77 -9
- package/src/symlinks.ts +134 -17
- package/tsconfig.json +7 -3
- package/CHECK.md +0 -352
package/.github/icon.png
ADDED
|
Binary file
|
package/.github/logo.png
ADDED
|
Binary file
|
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
|
-
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src=".github/logo.png?raw=true" alt="Oh My Pi" height="300">
|
|
3
|
+
</p>
|
|
2
4
|
|
|
3
|
-
|
|
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
|
-
|
|
9
|
+
<p align="center">
|
|
10
|
+
Like oh-my-zsh, but for your AI coding assistant.
|
|
11
|
+
</p>
|
|
6
12
|
|
|
7
|
-
|
|
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
|
-
#
|
|
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
|
|
51
|
+
# Update everything
|
|
31
52
|
omp update
|
|
32
53
|
```
|
|
33
54
|
|
|
34
|
-
##
|
|
55
|
+
## How It Works
|
|
35
56
|
|
|
36
|
-
|
|
57
|
+
omp installs plugins via npm and symlinks their files into your pi configuration directory:
|
|
37
58
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
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
|
-
|
|
73
|
+
## Global vs Local Plugins
|
|
47
74
|
|
|
48
|
-
|
|
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
|
-
|
|
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
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
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
|
-
|
|
87
|
+
# Auto-detect: uses local if .pi/plugins.json exists, otherwise global
|
|
88
|
+
omp install @oh-my-pi/subagents
|
|
89
|
+
```
|
|
64
90
|
|
|
65
|
-
|
|
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
|
-
|
|
93
|
+
## Commands
|
|
71
94
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
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
|
-
##
|
|
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": "
|
|
121
|
+
"name": "my-cool-plugin",
|
|
84
122
|
"version": "1.0.0",
|
|
85
|
-
"
|
|
86
|
-
"keywords": ["omp-plugin", "agents"],
|
|
123
|
+
"keywords": ["omp-plugin"],
|
|
87
124
|
"omp": {
|
|
88
125
|
"install": [
|
|
89
|
-
{ "src": "agents/
|
|
90
|
-
{ "src": "
|
|
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
|
-
###
|
|
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
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
├──
|
|
128
|
-
└──
|
|
129
|
-
|
|
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
|
-
|
|
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
|
-
|
|
154
|
+
The `omp.install` array maps source files to their destination in the agent directory:
|
|
143
155
|
|
|
144
|
-
|
|
145
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
173
|
+
# Link for local development (changes reflect immediately)
|
|
174
|
+
omp link ./my-plugin
|
|
182
175
|
|
|
183
|
-
|
|
184
|
-
|
|
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
|
-
|
|
179
|
+
# When ready, publish
|
|
180
|
+
cd my-plugin && npm publish
|
|
181
|
+
```
|
|
189
182
|
|
|
190
|
-
|
|
183
|
+
## Bundled Plugins
|
|
191
184
|
|
|
192
|
-
|
|
193
|
-
|
|
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
|
-
|
|
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
|
-
|
|
190
|
+
```bash
|
|
191
|
+
# Check for broken symlinks and conflicts
|
|
192
|
+
omp doctor
|
|
203
193
|
|
|
204
|
-
|
|
194
|
+
# See which plugin installed a specific file
|
|
195
|
+
omp why ~/.pi/agent/agents/researcher.md
|
|
205
196
|
|
|
206
|
-
|
|
207
|
-
|
|
197
|
+
# Temporarily disable a plugin
|
|
198
|
+
omp disable @oh-my-pi/subagents
|
|
208
199
|
|
|
209
|
-
|
|
210
|
-
|
|
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
|
-
|
|
217
|
-
|
|
218
|
-
|
|
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