@lpm-registry/cli 0.11.0 → 0.13.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 (2) hide show
  1. package/README.md +30 -404
  2. package/package.json +6 -6
package/README.md CHANGED
@@ -1,364 +1,44 @@
1
- # LPM CLI
1
+ # LPM — The Package Manager for Modern Software
2
2
 
3
- The command-line interface for the Licensed Package Manager (LPM). Ships with a native Rust binary for fast installs — 9x faster than pnpm, 24x faster than npm.
4
-
5
- ## Installation
3
+ Fast, secure, all-in-one. Written in Rust.
6
4
 
7
5
  ```bash
8
- # npm (recommended — auto-downloads native binary)
9
6
  npm install -g @lpm-registry/cli
10
-
11
- # curl (standalone, no Node required)
12
- curl -fsSL https://raw.githubusercontent.com/lpm-dev/rust-client/main/install.sh | sh
13
- ```
14
-
15
- ## Command Shortcuts
16
-
17
- LPM provides convenient aliases for common commands:
18
-
19
- | Shortcut | Full Command | Description |
20
- | ----------------------- | ---------------- | ---------------- |
21
- | `lpm i` | `lpm install` | Install packages |
22
- | `lpm p` | `lpm publish` | Publish package |
23
- | `lpm l` | `lpm login` | Log in |
24
- | `lpm lo` | `lpm logout` | Log out |
25
- | `lpm set <key> <value>` | `lpm config set` | Set config |
26
-
27
- ## Package Name Format
28
-
29
- LPM uses the `@lpm.dev` scope for all packages with dot notation:
30
-
31
- ```
32
- @lpm.dev/owner.package-name
33
- ```
34
-
35
- Examples:
36
-
37
- - `@lpm.dev/tolgaergin.my-utils` (personal package)
38
- - `@lpm.dev/acme-corp.design-system` (org package)
39
-
40
- ## Commands
41
-
42
- ### Authentication
43
-
44
- #### Login
45
-
46
- Authenticate with the registry. Opens your browser for secure OAuth login.
47
-
48
- ```bash
49
- lpm login
50
- ```
51
-
52
- #### Logout
53
-
54
- Clear stored authentication token. Optionally revoke on server and clear cache.
55
-
56
- ```bash
57
- lpm logout
58
- lpm logout --revoke # Also revoke token on server
59
- lpm logout --clear-cache # Also clear local package cache
60
- ```
61
-
62
- #### Check Identity
63
-
64
- See who you are logged in as and check plan status.
65
-
66
- ```bash
67
- lpm whoami
68
- ```
69
-
70
- ### Project Setup
71
-
72
- #### Generate .npmrc Token (Local Dev)
73
-
74
- Generate a 30-day read-only token for your project. Makes `npm install` work with LPM packages.
75
-
76
- By default, LPM is configured as your default registry — all packages (LPM + npm) are fetched through LPM for faster, edge-cached installs.
77
-
78
- ```bash
79
- lpm npmrc # 30-day token, proxy mode (default)
80
- lpm npmrc --days 7 # 7-day token
81
- lpm npmrc --days 90 # 90-day token
82
- lpm npmrc --scoped # Only route @lpm.dev packages through LPM
83
7
  ```
84
8
 
85
- Automatically adds `.npmrc` to `.gitignore` to prevent token leaks.
86
-
87
- #### Setup .npmrc (CI/CD)
88
-
89
- Configure `.npmrc` for CI/CD environments.
9
+ <details>
10
+ <summary>Other install methods</summary>
90
11
 
91
12
  ```bash
92
- lpm setup # Writes ${LPM_TOKEN} placeholder (proxy mode)
93
- lpm setup --oidc # OIDC — no secrets needed (GitHub Actions, GitLab CI)
94
- lpm setup --scoped # Only route @lpm.dev packages through LPM
13
+ brew tap lpm-dev/lpm && brew install lpm # Homebrew
14
+ curl -fsSL https://lpm.dev/install.sh | sh # Standalone
15
+ cargo install --git https://github.com/lpm-dev/rust-client lpm-cli # Source
95
16
  ```
96
17
 
97
- For deployment platforms (Vercel, Netlify), set the `LPM_TOKEN` environment variable.
18
+ </details>
98
19
 
99
- ### Package Management
20
+ ## About This Package
100
21
 
101
- #### Initialize a Package
22
+ This npm package is a thin wrapper that downloads the native Rust binary on `postinstall`. All CLI functionality is provided by the Rust client — see [lpm-dev/rust-client](https://github.com/lpm-dev/rust-client) for full documentation, benchmarks, and the complete command reference.
102
23
 
103
- Scaffold a new package with `package.json` configured for LPM.
24
+ If the native binary isn't available for your platform, the JS fallback CLI activates automatically.
104
25
 
105
- ```bash
106
- lpm init
107
- ```
108
-
109
- #### Publish
110
-
111
- Publish the current package to the registry. Automatically verifies you have the required token scope. Includes a quality score report on every publish.
26
+ ## Quick Start
112
27
 
113
28
  ```bash
114
- lpm publish
115
- lpm publish --check # Run quality checks without publishing
116
- lpm publish --min-score 80 # Block publish if quality score < 80
117
- lpm publish --check --min-score 90 # Check only, fail if below 90 (useful in CI)
29
+ lpm login # Authenticate
30
+ lpm install # Install deps (aliases: i)
31
+ lpm publish # Publish to lpm.dev (aliases: p)
32
+ lpm dev # Zero-config dev server + HTTPS + tunnel
118
33
  ```
119
34
 
120
- | Option | Description |
121
- | ----------------- | ------------------------------------------------------------------- |
122
- | `--check` | Run quality checks and display report, then exit without publishing |
123
- | `--min-score <n>` | Set minimum quality score (0-100) required to publish |
124
-
125
- > **Note:** If `.lpm/skills/` exists in your package but skills aren't included in the tarball, the CLI warns you to add `.lpm` to the `files` field in package.json.
126
-
127
- #### Install
128
-
129
- Install packages from the registry with automatic authentication.
130
-
131
- ```bash
132
- lpm install @lpm.dev/owner.package-name
133
- lpm install @lpm.dev/tolgaergin.utils @lpm.dev/acme.helpers
134
- lpm install # Install all @lpm.dev packages from package.json
135
- lpm install --no-skills # Skip fetching Agent Skills
136
- lpm install --pm pnpm # Use pnpm instead of npm
137
- lpm i # Shortcut
138
- ```
139
-
140
- Agent Skills are fetched by default for packages that include them.
141
-
142
- | Option | Description |
143
- | ------------- | ---------------------------------------- |
144
- | `--no-skills` | Skip fetching Agent Skills after install |
145
- | `--pm <name>` | Package manager: npm (default), pnpm, yarn, bun |
146
-
147
- Set a default package manager: `lpm config set packageManager pnpm`
148
-
149
- #### Uninstall
150
-
151
- Uninstall packages with automatic registry authentication.
152
-
153
- ```bash
154
- lpm uninstall @lpm.dev/owner.package-name
155
- lpm uninstall --pm pnpm # Use pnpm
156
- lpm un # Shortcut
157
- ```
158
-
159
- #### Add (Source Code)
160
-
161
- Download and extract package source code directly into your project.
162
-
163
- ```bash
164
- # JavaScript
165
- lpm add @lpm.dev/owner.component
166
- lpm add @lpm.dev/tolgaergin.button --path ./src/ui/Button
167
- lpm add @lpm.dev/owner.component --force # Overwrite without prompting
168
- lpm add @lpm.dev/owner.component --no-skills # Skip fetching Agent Skills
169
-
170
- # Swift (auto-detects project type)
171
- lpm add @lpm.dev/acme.swift-charts
172
- ```
173
-
174
- Agent Skills are fetched by default for packages that include them.
175
-
176
- For Swift projects, the CLI auto-detects whether you have a `Package.swift` (SPM package) or `.xcodeproj` (Xcode app project):
177
-
178
- - **SPM packages:** Files are copied into the appropriate `Sources/{target}/` directory. SPM auto-discovers new `.swift` files.
179
- - **Xcode app projects:** The CLI scaffolds a local SPM package at `Packages/LPMComponents/`, copies source files, and auto-links the package in your `.xcodeproj` file. Xcode hot-reloads the change — no restart needed.
180
-
181
- ### Package Discovery
182
-
183
- #### Search
184
-
185
- Search for packages in the marketplace.
186
-
187
- ```bash
188
- lpm search <query>
189
- lpm search button --limit 50
190
- lpm search datepicker --json
191
- ```
192
-
193
- #### Info
194
-
195
- Show detailed information about a package.
196
-
197
- ```bash
198
- lpm info @lpm.dev/owner.package
199
- lpm info @lpm.dev/tolgaergin.utils -a # Show all versions
200
- lpm info @lpm.dev/owner.package --all-versions
201
- lpm info @lpm.dev/owner.package --json
202
- ```
203
-
204
- #### Check Name
205
-
206
- Check if a package name is available on the registry.
207
-
208
- ```bash
209
- lpm check-name acme.new-package
210
- lpm check-name acme.new-package --json
211
- ```
212
-
213
- #### Quality
214
-
215
- Show the server-side quality report for a published package. Displays the score, tier, and breakdown of all 28 checks.
216
-
217
- ```bash
218
- lpm quality @lpm.dev/owner.package
219
- lpm quality @lpm.dev/owner.package --json
220
- ```
221
-
222
- ### Skills
223
-
224
- Manage Agent Skills for AI coding assistants.
225
-
226
- #### `lpm skills validate`
227
-
228
- Validate `.lpm/skills/*.md` files in the current directory. Checks file format, frontmatter, content, size limits, and blocked patterns. Shows quality score impact.
229
-
230
- #### `lpm skills install [package]`
231
-
232
- Fetch and install skills from the registry. Without a package argument, installs skills for all `@lpm.dev/*` dependencies in package.json. Saves to `.lpm/skills/{package-name}/` and adds `.lpm/skills/` to `.gitignore`.
233
-
234
- #### `lpm skills list`
235
-
236
- List available skills for all installed `@lpm.dev/*` packages. Shows which packages have skills, how many, and whether they're installed locally.
237
-
238
- #### `lpm skills clean`
239
-
240
- Remove the `.lpm/skills/` directory and all locally installed skills.
241
-
242
- ### Security & Maintenance
243
-
244
- #### Audit
245
-
246
- Scan dependencies for known security vulnerabilities.
247
-
248
- ```bash
249
- lpm audit
250
- lpm audit --level high # Only show high+ severity
251
- lpm audit --json # JSON output for CI
252
- lpm audit fix # Attempt automatic fixes
253
- ```
254
-
255
- #### Outdated
256
-
257
- Check for outdated dependencies.
258
-
259
- ```bash
260
- lpm outdated
261
- lpm outdated --all # Show all deps, not just outdated
262
- lpm outdated --json # JSON output for CI
263
- ```
264
-
265
- #### Doctor
266
-
267
- Check your CLI setup, connection, and configuration.
268
-
269
- ```bash
270
- lpm doctor
271
- ```
272
-
273
- ### Configuration
274
-
275
- #### Config
276
-
277
- Manage CLI configuration values.
278
-
279
- ```bash
280
- lpm config list # Show all config
281
- lpm config get registry # Get specific value
282
- lpm config set registry https://... # Set registry URL
283
- lpm config set timeout 60000 # Set request timeout (ms)
284
- lpm config set retries 5 # Set max retries
285
- lpm config delete <key> # Reset to default
286
- ```
287
-
288
- #### Cache
289
-
290
- Manage local package cache.
291
-
292
- ```bash
293
- lpm cache list # Show cached packages with sizes
294
- lpm cache clean # Clear all cached packages
295
- lpm cache path # Show cache directory location
296
- ```
297
-
298
- ### Utilities
299
-
300
- #### Open Dashboard
301
-
302
- Open the dashboard or package page in your browser.
303
-
304
- ```bash
305
- lpm open
306
- ```
307
-
308
- #### Run npm Scripts
309
-
310
- Forward commands to npm run.
311
-
312
- ```bash
313
- lpm run dev # Same as npm run dev
314
- lpm run build # Same as npm run build
315
- lpm run test -- --watch # Pass arguments through
316
- ```
317
-
318
- #### Token Management
319
-
320
- Rotate your authentication token.
321
-
322
- ```bash
323
- lpm token rotate
324
- ```
325
-
326
- ### Pool Revenue
327
-
328
- #### Pool Stats
329
-
330
- Show your Pool earnings estimate for the current billing period. Displays per-package breakdown with install counts, weighted downloads, share percentage, and estimated earnings.
331
-
332
- ```bash
333
- lpm pool stats
334
- lpm pool stats --json
335
- ```
336
-
337
- ### Marketplace
338
-
339
- #### Compare
340
-
341
- Find comparable packages by name or category. Useful for pricing research and competitive analysis.
342
-
343
- ```bash
344
- lpm marketplace compare "form builder"
345
- lpm marketplace compare ui --category ui-components
346
- lpm marketplace compare auth --limit 5
347
- lpm marketplace compare "form builder" --json
348
- ```
349
-
350
- #### Earnings
351
-
352
- Show your Marketplace revenue summary including total sales, gross revenue, platform fees, and net revenue.
35
+ ## Commands
353
36
 
354
- ```bash
355
- lpm marketplace earnings
356
- lpm marketplace earnings --json
357
- ```
37
+ See the full command reference at [github.com/lpm-dev/rust-client](https://github.com/lpm-dev/rust-client#commands).
358
38
 
359
- ## API Reference
39
+ ## API Exports
360
40
 
361
- The CLI exports utilities for programmatic use:
41
+ This package exports utilities for programmatic use:
362
42
 
363
43
  ```js
364
44
  import {
@@ -370,69 +50,15 @@ import {
370
50
  } from "@lpm-registry/cli";
371
51
  ```
372
52
 
373
- ### Integrity
374
-
375
- | Function | Description |
376
- | ---------------------------------------------- | -------------------------------------------------- |
377
- | `generateIntegrity(buffer, algorithm?)` | Generate an SRI integrity hash (default: `sha512`) |
378
- | `verifyIntegrity(buffer, expected)` | Verify a buffer against an SRI integrity string |
379
- | `verifyIntegrityMultiple(buffer, integrities)` | Verify against multiple integrity strings |
380
- | `parseIntegrity(integrity)` | Parse an SRI string into `{ algorithm, digest }` |
381
-
382
- ### Path Safety
383
-
384
- | Function | Description |
385
- | ----------------------------------------- | ------------------------------------------------------ |
386
- | `validateComponentPath(root, path)` | Validate a component install path stays within project |
387
- | `validateTarballPaths(extractDir, paths)` | Check tarball entries for path traversal attacks |
388
- | `resolveSafePath(base, user)` | Safely resolve a user-provided path |
389
- | `sanitizeFilename(name)` | Strip dangerous characters from a filename |
390
-
391
- ### Quality
392
-
393
- | Function | Description |
394
- | --------------------------------------------------------------------------- | ------------------------------------------------------------ |
395
- | `runQualityChecks({ packageJson, readme, lpmConfig, files, unpackedSize })` | Run all 28 quality checks and return score, checks, and tier |
396
-
397
- ### Package Config
398
-
399
- | Function | Description |
400
- | ------------------------------------ | ---------------------------------------------------------- |
401
- | `parseLpmPackageReference(ref)` | Parse `@lpm.dev/owner.pkg@version?key=val` into components |
402
- | `readLpmConfig(dir)` | Read and validate `lpm.config.json` from a directory |
403
- | `validateLpmConfig(config)` | Validate a parsed config object |
404
- | `filterFiles(files, config, params)` | Filter file rules based on config conditions |
405
-
406
- ### Project Utils
407
-
408
- | Function | Description |
409
- | --------------------------------- | --------------------------------------------------------- |
410
- | `detectFramework()` | Detect the project framework (nextjs, vite, remix, astro) |
411
- | `getDefaultPath(framework, name)` | Get the default component install path for a framework |
412
- | `getUserImportPrefix()` | Get the user's import alias prefix (e.g. `@/`, `~/`) |
413
-
414
- ## Security
415
-
416
- LPM CLI uses secure credential storage:
417
-
418
- - **macOS**: System Keychain
419
- - **Windows**: Windows Credential Manager
420
- - **Linux**: libsecret (GNOME Keyring, KWallet)
421
-
422
- If native keychain is unavailable, credentials are stored in an encrypted file with AES-256-GCM.
423
-
424
- ## Configuration File
425
-
426
- Configuration is stored in:
427
-
428
- - **macOS**: `~/Library/Preferences/lpm-cli-nodejs/`
429
- - **Windows**: `%APPDATA%/lpm-cli-nodejs/Config/`
430
- - **Linux**: `~/.config/lpm-cli-nodejs/`
53
+ | Function | Description |
54
+ | --- | --- |
55
+ | `generateIntegrity(buffer, algorithm?)` | Generate an SRI integrity hash (default: `sha512`) |
56
+ | `verifyIntegrity(buffer, expected)` | Verify a buffer against an SRI integrity string |
57
+ | `runQualityChecks({ packageJson, readme, ... })` | Run all 28 quality checks and return score, tier, and checks |
58
+ | `parseLpmPackageReference(ref)` | Parse `@lpm.dev/owner.pkg@version?key=val` into components |
59
+ | `readLpmConfig(dir)` | Read and validate `lpm.config.json` from a directory |
60
+ | `detectFramework()` | Detect the project framework (nextjs, vite, remix, astro) |
431
61
 
432
- ## Environment Variables
62
+ ## License
433
63
 
434
- | Variable | Description |
435
- | ------------------ | --------------------- |
436
- | `DEBUG=true` | Enable debug output |
437
- | `LPM_REGISTRY_URL` | Override registry URL |
438
- | `LPM_TOKEN` | Override auth token |
64
+ MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lpm-registry/cli",
3
- "version": "0.11.0",
3
+ "version": "0.13.0",
4
4
  "description": "CLI for Licensed Package Manager",
5
5
  "author": "LPM <hello@lpm.dev> (https://lpm.dev)",
6
6
  "repository": {
@@ -61,11 +61,11 @@
61
61
  "xcode": "^3.0.1"
62
62
  },
63
63
  "optionalDependencies": {
64
- "@lpm-registry/cli-darwin-arm64": "0.11.0",
65
- "@lpm-registry/cli-darwin-x64": "0.11.0",
66
- "@lpm-registry/cli-linux-x64": "0.11.0",
67
- "@lpm-registry/cli-linux-arm64": "0.11.0",
68
- "@lpm-registry/cli-win32-x64": "0.11.0",
64
+ "@lpm-registry/cli-darwin-arm64": "0.13.0",
65
+ "@lpm-registry/cli-darwin-x64": "0.13.0",
66
+ "@lpm-registry/cli-linux-x64": "0.13.0",
67
+ "@lpm-registry/cli-linux-arm64": "0.13.0",
68
+ "@lpm-registry/cli-win32-x64": "0.13.0",
69
69
  "keytar": "^7.9.0"
70
70
  },
71
71
  "type": "module",