@anytio/pspm 0.0.2 → 0.0.4
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/README.md +265 -0
- package/dist/index.js +477 -622
- package/dist/index.js.map +1 -1
- package/package.json +14 -6
package/README.md
ADDED
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
# PSPM - Prompt Skill Package Manager
|
|
2
|
+
|
|
3
|
+
A CLI for managing prompt skills across AI coding agents.
|
|
4
|
+
|
|
5
|
+
## What is PSPM?
|
|
6
|
+
|
|
7
|
+
PSPM (Prompt Skill Package Manager) is a package manager for prompt skills - small, discoverable capabilities packaged as `SKILL.md` files. Think of it as npm for AI agent skills.
|
|
8
|
+
|
|
9
|
+
Skills are designed to work with any AI coding agent that supports the SKILL.md format, including Claude Code, Cursor, Windsurf, and others.
|
|
10
|
+
|
|
11
|
+
## Installation
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npm install -g @anytio/pspm
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Or use with npx:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
npx @anytio/pspm <command>
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Quick Start
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
# Login with your API key
|
|
27
|
+
pspm login --api-key <your-api-key>
|
|
28
|
+
|
|
29
|
+
# Add a skill to your project
|
|
30
|
+
pspm add @user/username/skill-name
|
|
31
|
+
|
|
32
|
+
# List installed skills
|
|
33
|
+
pspm list
|
|
34
|
+
|
|
35
|
+
# Install all skills from lockfile
|
|
36
|
+
pspm install
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Commands
|
|
40
|
+
|
|
41
|
+
### Authentication
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
pspm login --api-key <key> # Authenticate with API key
|
|
45
|
+
pspm logout # Clear stored credentials
|
|
46
|
+
pspm whoami # Show current user info
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### Skill Management
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
pspm add <specifier> # Add and install a skill
|
|
53
|
+
pspm remove <name> # Remove an installed skill (alias: rm)
|
|
54
|
+
pspm list # List installed skills (alias: ls)
|
|
55
|
+
pspm install # Install all skills from lockfile (alias: i)
|
|
56
|
+
pspm update # Update skills to latest compatible versions
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
**Specifier formats:**
|
|
60
|
+
- `@user/username/skillname` - Latest version
|
|
61
|
+
- `@user/username/skillname@2.0.0` - Specific version
|
|
62
|
+
- `@user/username/skillname@^2.0.0` - Semver range
|
|
63
|
+
|
|
64
|
+
### Publishing
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
pspm publish # Publish current directory as a skill
|
|
68
|
+
pspm publish --bump patch # Auto-bump version (major, minor, patch)
|
|
69
|
+
pspm unpublish <spec> --force # Remove a published skill version
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
**Publish Output:**
|
|
73
|
+
|
|
74
|
+
When publishing, PSPM displays detailed package information similar to npm:
|
|
75
|
+
|
|
76
|
+
```
|
|
77
|
+
pspm notice
|
|
78
|
+
pspm notice 📦 my-skill@1.0.0
|
|
79
|
+
pspm notice Tarball Contents
|
|
80
|
+
pspm notice 5.1kB SKILL.md
|
|
81
|
+
pspm notice 1.5kB package.json
|
|
82
|
+
pspm notice Tarball Details
|
|
83
|
+
pspm notice name: my-skill
|
|
84
|
+
pspm notice version: 1.0.0
|
|
85
|
+
pspm notice filename: my-skill-1.0.0.tgz
|
|
86
|
+
pspm notice package size: 2.3kB
|
|
87
|
+
pspm notice unpacked size: 6.6kB
|
|
88
|
+
pspm notice shasum: 4bb744fcfa90b8b033feed3deaeeb00f3a4503e5
|
|
89
|
+
pspm notice integrity: sha512-DqQJaugblfE5A...
|
|
90
|
+
pspm notice total files: 2
|
|
91
|
+
pspm notice
|
|
92
|
+
pspm notice Publishing to https://pspm.dev with tag latest
|
|
93
|
+
+ @user/username/my-skill@1.0.0
|
|
94
|
+
Checksum: abc123...
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### Configuration
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
pspm config show # Show resolved configuration
|
|
101
|
+
pspm config init # Create .pspmrc in current directory
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
## Configuration
|
|
105
|
+
|
|
106
|
+
PSPM uses a simple npm-like INI configuration format.
|
|
107
|
+
|
|
108
|
+
### User Config (`~/.pspmrc`)
|
|
109
|
+
|
|
110
|
+
```ini
|
|
111
|
+
; PSPM Configuration
|
|
112
|
+
registry = https://pspm.dev
|
|
113
|
+
authToken = sk_...
|
|
114
|
+
username = myuser
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### Project Config (`.pspmrc`)
|
|
118
|
+
|
|
119
|
+
Project-specific configuration (optional):
|
|
120
|
+
|
|
121
|
+
```ini
|
|
122
|
+
; Project-specific PSPM configuration
|
|
123
|
+
registry = https://custom-registry.example.com
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### Lockfile (`skill-lock.json`)
|
|
127
|
+
|
|
128
|
+
```json
|
|
129
|
+
{
|
|
130
|
+
"lockfileVersion": 1,
|
|
131
|
+
"registryUrl": "https://pspm.dev",
|
|
132
|
+
"skills": {
|
|
133
|
+
"@user/username/skillname": {
|
|
134
|
+
"version": "1.0.0",
|
|
135
|
+
"resolved": "https://pspm.dev/api/skills/@user/username/skillname/1.0.0/download",
|
|
136
|
+
"integrity": "sha256-..."
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
### Configuration Resolution
|
|
143
|
+
|
|
144
|
+
Configuration is resolved in priority order:
|
|
145
|
+
|
|
146
|
+
1. **Environment Variables** (`PSPM_REGISTRY_URL`, `PSPM_API_KEY`) - Highest
|
|
147
|
+
2. **Project Config** (`.pspmrc` in project directory)
|
|
148
|
+
3. **User Config** (`~/.pspmrc`)
|
|
149
|
+
4. **Defaults** - Lowest
|
|
150
|
+
|
|
151
|
+
## Environment Variables
|
|
152
|
+
|
|
153
|
+
| Variable | Description |
|
|
154
|
+
|----------|-------------|
|
|
155
|
+
| `PSPM_REGISTRY_URL` | Override registry URL |
|
|
156
|
+
| `PSPM_API_KEY` | Override API key |
|
|
157
|
+
| `PSPM_DEBUG` | Enable debug logging |
|
|
158
|
+
|
|
159
|
+
## Error Handling
|
|
160
|
+
|
|
161
|
+
PSPM provides clear, actionable error messages:
|
|
162
|
+
|
|
163
|
+
**Version Conflict:**
|
|
164
|
+
```
|
|
165
|
+
pspm error code E403
|
|
166
|
+
pspm error 403 403 Forbidden - You cannot publish over the previously published versions: 1.0.0.
|
|
167
|
+
Error: [BAD_REQUEST] Version 1.0.0 must be greater than existing version 1.0.0
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
**Validation Errors:**
|
|
171
|
+
```
|
|
172
|
+
Error: Validation failed:
|
|
173
|
+
- name: Skill name must start with a letter and contain only lowercase letters, numbers, and hyphens
|
|
174
|
+
- version: Invalid semver version
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
**Authentication Errors:**
|
|
178
|
+
```
|
|
179
|
+
Error: Not logged in. Run 'pspm login --api-key <key>' first, or set PSPM_API_KEY env var.
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
## Directory Structure
|
|
183
|
+
|
|
184
|
+
```
|
|
185
|
+
project/
|
|
186
|
+
├── .pspmrc # Project config (optional)
|
|
187
|
+
├── skill-lock.json # Lockfile
|
|
188
|
+
└── .skills/ # Installed skills
|
|
189
|
+
└── username/
|
|
190
|
+
└── skillname/
|
|
191
|
+
├── SKILL.md
|
|
192
|
+
└── ...
|
|
193
|
+
|
|
194
|
+
~/
|
|
195
|
+
└── .pspmrc # User config
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
## Creating a Skill
|
|
199
|
+
|
|
200
|
+
A skill is a directory containing at minimum a `package.json` and `SKILL.md`:
|
|
201
|
+
|
|
202
|
+
```
|
|
203
|
+
my-skill/
|
|
204
|
+
├── package.json # Required: name, version
|
|
205
|
+
├── SKILL.md # Required: skill instructions
|
|
206
|
+
├── runtime/ # Optional: runtime files
|
|
207
|
+
├── scripts/ # Optional: scripts
|
|
208
|
+
└── data/ # Optional: data files
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
**package.json:**
|
|
212
|
+
```json
|
|
213
|
+
{
|
|
214
|
+
"name": "@user/myusername/my-skill",
|
|
215
|
+
"version": "1.0.0",
|
|
216
|
+
"description": "A helpful skill for...",
|
|
217
|
+
"files": ["package.json", "SKILL.md", "runtime", "scripts", "data"]
|
|
218
|
+
}
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
**SKILL.md:**
|
|
222
|
+
```markdown
|
|
223
|
+
---
|
|
224
|
+
name: my-skill
|
|
225
|
+
description: A helpful skill that does X
|
|
226
|
+
---
|
|
227
|
+
|
|
228
|
+
# Instructions
|
|
229
|
+
|
|
230
|
+
When activated, this skill helps you...
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
## CI/CD Integration
|
|
234
|
+
|
|
235
|
+
```bash
|
|
236
|
+
# Use environment variables
|
|
237
|
+
export PSPM_API_KEY=sk_ci_key
|
|
238
|
+
export PSPM_REGISTRY_URL=https://registry.example.com/api/skills
|
|
239
|
+
|
|
240
|
+
# Install with frozen lockfile (fails if lockfile is outdated)
|
|
241
|
+
pspm install --frozen-lockfile
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
## Using Different Registries
|
|
245
|
+
|
|
246
|
+
Use environment variables to switch between registries:
|
|
247
|
+
|
|
248
|
+
```bash
|
|
249
|
+
# Development
|
|
250
|
+
PSPM_REGISTRY_URL=https://staging.example.com pspm add @user/bsheng/skill
|
|
251
|
+
|
|
252
|
+
# Production
|
|
253
|
+
PSPM_REGISTRY_URL=https://prod.example.com pspm publish
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
Or set the registry in your project's `.pspmrc`:
|
|
257
|
+
|
|
258
|
+
```ini
|
|
259
|
+
; .pspmrc
|
|
260
|
+
registry = https://custom-registry.example.com
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
## License
|
|
264
|
+
|
|
265
|
+
See LICENSE file.
|