@anytio/pspm 0.0.3 → 0.0.5

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 CHANGED
@@ -69,43 +69,58 @@ pspm publish --bump patch # Auto-bump version (major, minor, patch)
69
69
  pspm unpublish <spec> --force # Remove a published skill version
70
70
  ```
71
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
+
72
97
  ### Configuration
73
98
 
74
99
  ```bash
75
- pspm config list # List all profiles
76
100
  pspm config show # Show resolved configuration
77
- pspm config add <name> # Create a new profile
78
- pspm config use <name> # Set the default profile
79
- pspm config set <profile> <key> <value> # Set a profile field
80
- pspm config delete <name> # Delete a profile
81
101
  pspm config init # Create .pspmrc in current directory
82
102
  ```
83
103
 
84
104
  ## Configuration
85
105
 
86
- ### User Config (`~/.pspm/config.json`)
106
+ PSPM uses a simple npm-like INI configuration format.
87
107
 
88
- ```json
89
- {
90
- "version": 2,
91
- "defaultProfile": "default",
92
- "profiles": {
93
- "default": {
94
- "registryUrl": "https://pspm.dev/api/skills",
95
- "apiKey": "sk_...",
96
- "username": "myuser"
97
- }
98
- }
99
- }
108
+ ### User Config (`~/.pspmrc`)
109
+
110
+ ```ini
111
+ ; PSPM Configuration
112
+ registry = https://pspm.dev
113
+ authToken = sk_...
114
+ username = myuser
100
115
  ```
101
116
 
102
117
  ### Project Config (`.pspmrc`)
103
118
 
104
- ```json
105
- {
106
- "profile": "production",
107
- "registryUrl": "https://custom-registry.example.com/api/skills"
108
- }
119
+ Project-specific configuration (optional):
120
+
121
+ ```ini
122
+ ; Project-specific PSPM configuration
123
+ registry = https://custom-registry.example.com
109
124
  ```
110
125
 
111
126
  ### Lockfile (`skill-lock.json`)
@@ -113,7 +128,7 @@ pspm config init # Create .pspmrc in current directory
113
128
  ```json
114
129
  {
115
130
  "lockfileVersion": 1,
116
- "registryUrl": "https://pspm.dev/api/skills",
131
+ "registryUrl": "https://pspm.dev",
117
132
  "skills": {
118
133
  "@user/username/skillname": {
119
134
  "version": "1.0.0",
@@ -124,15 +139,46 @@ pspm config init # Create .pspmrc in current directory
124
139
  }
125
140
  ```
126
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
+
127
151
  ## Environment Variables
128
152
 
129
153
  | Variable | Description |
130
154
  |----------|-------------|
131
- | `PSPM_PROFILE` | Select active profile |
132
155
  | `PSPM_REGISTRY_URL` | Override registry URL |
133
156
  | `PSPM_API_KEY` | Override API key |
134
157
  | `PSPM_DEBUG` | Enable debug logging |
135
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
+
136
182
  ## Directory Structure
137
183
 
138
184
  ```
@@ -145,8 +191,8 @@ project/
145
191
  ├── SKILL.md
146
192
  └── ...
147
193
 
148
- ~/.pspm/
149
- └── config.json # User config
194
+ ~/
195
+ └── .pspmrc # User config
150
196
  ```
151
197
 
152
198
  ## Creating a Skill
@@ -195,19 +241,23 @@ export PSPM_REGISTRY_URL=https://registry.example.com/api/skills
195
241
  pspm install --frozen-lockfile
196
242
  ```
197
243
 
198
- ## Multi-Registry Setup
244
+ ## Using Different Registries
245
+
246
+ Use environment variables to switch between registries:
199
247
 
200
248
  ```bash
201
- # Create profiles for different registries
202
- pspm config add production --registry-url https://prod.example.com/api/skills
203
- pspm config add staging --registry-url https://staging.example.com/api/skills
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
+ ```
204
255
 
205
- # Login to each
206
- pspm login --api-key sk_prod_xxx --profile production
207
- pspm login --api-key sk_staging_xxx --profile staging
256
+ Or set the registry in your project's `.pspmrc`:
208
257
 
209
- # Use specific profile for operations
210
- pspm add @user/bsheng/skill --profile production
258
+ ```ini
259
+ ; .pspmrc
260
+ registry = https://custom-registry.example.com
211
261
  ```
212
262
 
213
263
  ## License