@lpm-registry/cli 0.46.0 → 0.47.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/bin/lpm.js +250 -241
- package/lib/commands/npmrc.js +169 -169
- package/lib/commands/setup.js +192 -188
- package/package.json +6 -6
package/bin/lpm.js
CHANGED
|
@@ -17,331 +17,340 @@
|
|
|
17
17
|
* 3. Fall through to JS CLI implementation
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
|
-
import { execFileSync } from "node:child_process"
|
|
21
|
-
import fs from "node:fs"
|
|
22
|
-
import { createRequire } from "node:module"
|
|
23
|
-
import os from "node:os"
|
|
24
|
-
import path from "node:path"
|
|
25
|
-
import { fileURLToPath } from "node:url"
|
|
20
|
+
import { execFileSync } from "node:child_process";
|
|
21
|
+
import fs from "node:fs";
|
|
22
|
+
import { createRequire } from "node:module";
|
|
23
|
+
import os from "node:os";
|
|
24
|
+
import path from "node:path";
|
|
25
|
+
import { fileURLToPath } from "node:url";
|
|
26
26
|
|
|
27
|
-
const __dirname = path.dirname(fileURLToPath(import.meta.url))
|
|
28
|
-
const require = createRequire(import.meta.url)
|
|
27
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
28
|
+
const require = createRequire(import.meta.url);
|
|
29
29
|
|
|
30
30
|
// ─── Try native binary (Tier 1: platform package) ──────────────────
|
|
31
31
|
|
|
32
32
|
const PLATFORMS = {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}
|
|
33
|
+
"darwin-arm64": { pkg: "@lpm-registry/cli-darwin-arm64", binary: "lpm" },
|
|
34
|
+
"darwin-x64": { pkg: "@lpm-registry/cli-darwin-x64", binary: "lpm" },
|
|
35
|
+
"linux-x64": { pkg: "@lpm-registry/cli-linux-x64", binary: "lpm" },
|
|
36
|
+
"linux-arm64": { pkg: "@lpm-registry/cli-linux-arm64", binary: "lpm" },
|
|
37
|
+
"win32-x64": { pkg: "@lpm-registry/cli-win32-x64", binary: "lpm.exe" },
|
|
38
|
+
};
|
|
39
39
|
|
|
40
40
|
// Allow override via environment variable (for debugging / custom builds)
|
|
41
|
-
const envBinary = process.env.LPM_BINARY_PATH
|
|
41
|
+
const envBinary = process.env.LPM_BINARY_PATH;
|
|
42
42
|
if (envBinary && fs.existsSync(envBinary)) {
|
|
43
|
-
|
|
43
|
+
runBinary(envBinary);
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
// Try platform package from optionalDependencies
|
|
47
|
-
const platform = `${process.platform}-${os.arch()}
|
|
48
|
-
const platformInfo = PLATFORMS[platform]
|
|
47
|
+
const platform = `${process.platform}-${os.arch()}`;
|
|
48
|
+
const platformInfo = PLATFORMS[platform];
|
|
49
49
|
|
|
50
50
|
if (platformInfo) {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
51
|
+
try {
|
|
52
|
+
const pkgJsonPath = require.resolve(`${platformInfo.pkg}/package.json`);
|
|
53
|
+
const binaryPath = path.join(
|
|
54
|
+
path.dirname(pkgJsonPath),
|
|
55
|
+
platformInfo.binary,
|
|
56
|
+
);
|
|
57
|
+
if (fs.existsSync(binaryPath)) {
|
|
58
|
+
runBinary(binaryPath);
|
|
59
|
+
}
|
|
60
|
+
} catch {
|
|
61
|
+
// Package not installed
|
|
62
|
+
}
|
|
60
63
|
}
|
|
61
64
|
|
|
62
65
|
// ─── Try native binary (Tier 2: downloaded by postinstall) ─────────
|
|
63
66
|
|
|
64
67
|
const legacyBinaryName =
|
|
65
|
-
|
|
66
|
-
const legacyBinaryPath = path.join(__dirname, legacyBinaryName)
|
|
68
|
+
process.platform === "win32" ? "lpm-bin.exe" : "lpm-bin";
|
|
69
|
+
const legacyBinaryPath = path.join(__dirname, legacyBinaryName);
|
|
67
70
|
|
|
68
71
|
if (fs.existsSync(legacyBinaryPath)) {
|
|
69
|
-
|
|
72
|
+
runBinary(legacyBinaryPath);
|
|
70
73
|
}
|
|
71
74
|
|
|
72
75
|
// ─── JS CLI fallback (Tier 3) ──────────────────────────────────────
|
|
73
76
|
|
|
74
|
-
import { Command } from "commander"
|
|
75
|
-
import updateNotifier from "update-notifier"
|
|
76
|
-
import { add } from "../lib/commands/add.js"
|
|
77
|
-
import { audit } from "../lib/commands/audit.js"
|
|
78
|
-
import { cache } from "../lib/commands/cache.js"
|
|
79
|
-
import { checkName } from "../lib/commands/check-name.js"
|
|
80
|
-
import { config } from "../lib/commands/config.js"
|
|
81
|
-
import { doctor } from "../lib/commands/doctor.js"
|
|
82
|
-
import { info } from "../lib/commands/info.js"
|
|
83
|
-
import { init } from "../lib/commands/init.js"
|
|
84
|
-
import { install } from "../lib/commands/install.js"
|
|
85
|
-
import { login } from "../lib/commands/login.js"
|
|
86
|
-
import { logout } from "../lib/commands/logout.js"
|
|
87
|
-
import { marketplaceCompare } from "../lib/commands/marketplace-compare.js"
|
|
88
|
-
import { marketplaceEarnings } from "../lib/commands/marketplace-earnings.js"
|
|
89
|
-
import { mcpRemove, mcpSetup, mcpStatus } from "../lib/commands/mcp-setup.js"
|
|
90
|
-
import { npmrc } from "../lib/commands/npmrc.js"
|
|
91
|
-
import { openDashboard } from "../lib/commands/open.js"
|
|
92
|
-
import { outdated } from "../lib/commands/outdated.js"
|
|
93
|
-
import { poolStats } from "../lib/commands/pool-stats.js"
|
|
94
|
-
import { publish } from "../lib/commands/publish.js"
|
|
95
|
-
import { quality } from "../lib/commands/quality.js"
|
|
96
|
-
import { remove } from "../lib/commands/remove.js"
|
|
97
|
-
import { run } from "../lib/commands/run.js"
|
|
98
|
-
import { search } from "../lib/commands/search.js"
|
|
99
|
-
import { setup } from "../lib/commands/setup.js"
|
|
77
|
+
import { Command } from "commander";
|
|
78
|
+
import updateNotifier from "update-notifier";
|
|
79
|
+
import { add } from "../lib/commands/add.js";
|
|
80
|
+
import { audit } from "../lib/commands/audit.js";
|
|
81
|
+
import { cache } from "../lib/commands/cache.js";
|
|
82
|
+
import { checkName } from "../lib/commands/check-name.js";
|
|
83
|
+
import { config } from "../lib/commands/config.js";
|
|
84
|
+
import { doctor } from "../lib/commands/doctor.js";
|
|
85
|
+
import { info } from "../lib/commands/info.js";
|
|
86
|
+
import { init } from "../lib/commands/init.js";
|
|
87
|
+
import { install } from "../lib/commands/install.js";
|
|
88
|
+
import { login } from "../lib/commands/login.js";
|
|
89
|
+
import { logout } from "../lib/commands/logout.js";
|
|
90
|
+
import { marketplaceCompare } from "../lib/commands/marketplace-compare.js";
|
|
91
|
+
import { marketplaceEarnings } from "../lib/commands/marketplace-earnings.js";
|
|
92
|
+
import { mcpRemove, mcpSetup, mcpStatus } from "../lib/commands/mcp-setup.js";
|
|
93
|
+
import { npmrc } from "../lib/commands/npmrc.js";
|
|
94
|
+
import { openDashboard } from "../lib/commands/open.js";
|
|
95
|
+
import { outdated } from "../lib/commands/outdated.js";
|
|
96
|
+
import { poolStats } from "../lib/commands/pool-stats.js";
|
|
97
|
+
import { publish } from "../lib/commands/publish.js";
|
|
98
|
+
import { quality } from "../lib/commands/quality.js";
|
|
99
|
+
import { remove } from "../lib/commands/remove.js";
|
|
100
|
+
import { run } from "../lib/commands/run.js";
|
|
101
|
+
import { search } from "../lib/commands/search.js";
|
|
102
|
+
import { setup } from "../lib/commands/setup.js";
|
|
100
103
|
import {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
} from "../lib/commands/skills.js"
|
|
106
|
-
import { rotateToken } from "../lib/commands/token-rotate.js"
|
|
107
|
-
import { uninstall } from "../lib/commands/uninstall.js"
|
|
108
|
-
import { whoami } from "../lib/commands/whoami.js"
|
|
104
|
+
skillsClean,
|
|
105
|
+
skillsInstall,
|
|
106
|
+
skillsList,
|
|
107
|
+
skillsValidate,
|
|
108
|
+
} from "../lib/commands/skills.js";
|
|
109
|
+
import { rotateToken } from "../lib/commands/token-rotate.js";
|
|
110
|
+
import { uninstall } from "../lib/commands/uninstall.js";
|
|
111
|
+
import { whoami } from "../lib/commands/whoami.js";
|
|
109
112
|
|
|
110
113
|
// Load package.json
|
|
111
114
|
const pkg = JSON.parse(
|
|
112
|
-
|
|
113
|
-
)
|
|
115
|
+
fs.readFileSync(path.join(__dirname, "../package.json"), "utf-8"),
|
|
116
|
+
);
|
|
114
117
|
|
|
115
118
|
// Check for updates
|
|
116
|
-
updateNotifier({ pkg }).notify()
|
|
119
|
+
updateNotifier({ pkg }).notify();
|
|
117
120
|
|
|
118
|
-
const program = new Command()
|
|
121
|
+
const program = new Command();
|
|
119
122
|
|
|
120
123
|
program
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
+
.name("lpm")
|
|
125
|
+
.description("CLI for Licensed Package Manager")
|
|
126
|
+
.version(pkg.version);
|
|
124
127
|
|
|
125
128
|
// Authentication
|
|
126
129
|
program
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
130
|
+
.command("login")
|
|
131
|
+
.alias("l")
|
|
132
|
+
.description("Authenticate with the registry")
|
|
133
|
+
.action(login);
|
|
131
134
|
program
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
135
|
+
.command("logout")
|
|
136
|
+
.alias("lo")
|
|
137
|
+
.description("Clear stored authentication token")
|
|
138
|
+
.option("--revoke", "Also revoke the token on the server")
|
|
139
|
+
.option("--clear-cache", "Clear local package cache")
|
|
140
|
+
.action(logout);
|
|
138
141
|
program
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
142
|
+
.command("whoami")
|
|
143
|
+
.description("Check current authenticated user")
|
|
144
|
+
.option("--json", "Output in JSON format")
|
|
145
|
+
.action(whoami);
|
|
143
146
|
|
|
144
147
|
// Package Management
|
|
145
148
|
program
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
+
.command("init")
|
|
150
|
+
.description("Interactively create a package.json for LPM")
|
|
151
|
+
.action(init);
|
|
149
152
|
program
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
153
|
+
.command("install [packages...]")
|
|
154
|
+
.alias("i")
|
|
155
|
+
.description("Install packages")
|
|
156
|
+
.option("--json", "Machine-readable JSON output")
|
|
157
|
+
.option("--no-skills", "Skip fetching Agent Skills")
|
|
158
|
+
.option("--pm <manager>", "Package manager to use")
|
|
159
|
+
.action(install);
|
|
157
160
|
program
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
161
|
+
.command("uninstall <packages...>")
|
|
162
|
+
.aliases(["un", "unlink"])
|
|
163
|
+
.description("Uninstall packages")
|
|
164
|
+
.option("--pm <manager>", "Package manager to use")
|
|
165
|
+
.action(uninstall);
|
|
163
166
|
program
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
167
|
+
.command("publish")
|
|
168
|
+
.alias("p")
|
|
169
|
+
.description("Publish a package to the registry")
|
|
170
|
+
.option("--check", "Quality check only")
|
|
171
|
+
.option("--min-score <score>", "Minimum quality score")
|
|
172
|
+
.option("--provenance", "Force OIDC provenance")
|
|
173
|
+
.option("--dry-run", "Preview without publishing")
|
|
174
|
+
.action(publish);
|
|
172
175
|
program
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
176
|
+
.command("add <package>")
|
|
177
|
+
.description("Extract package source code")
|
|
178
|
+
.option("-p, --path <path>", "Target directory")
|
|
179
|
+
.option("-f, --force", "Overwrite existing files")
|
|
180
|
+
.option("-y, --yes", "Accept defaults")
|
|
181
|
+
.option("--alias <alias>", "Import alias prefix")
|
|
182
|
+
.option("--target <name>", "Swift SPM target")
|
|
183
|
+
.option("--json", "JSON output")
|
|
184
|
+
.option("--dry-run", "Preview only")
|
|
185
|
+
.action(add);
|
|
183
186
|
program
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
187
|
+
.command("remove <package>")
|
|
188
|
+
.alias("rm")
|
|
189
|
+
.description("Remove a previously added package")
|
|
190
|
+
.action(remove);
|
|
188
191
|
|
|
189
192
|
// Discovery
|
|
190
193
|
program
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
194
|
+
.command("search <query>")
|
|
195
|
+
.description("Search packages")
|
|
196
|
+
.option("--limit <n>", "Max results", "20")
|
|
197
|
+
.option("--json", "JSON output")
|
|
198
|
+
.action((q, o) => search(q, { ...o, limit: parseInt(o.limit, 10) }));
|
|
196
199
|
program
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
200
|
+
.command("info <package>")
|
|
201
|
+
.description("Package info")
|
|
202
|
+
.option("--json", "JSON output")
|
|
203
|
+
.option("-a, --all-versions", "Show all versions")
|
|
204
|
+
.action(info);
|
|
202
205
|
program
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
206
|
+
.command("check-name <name>")
|
|
207
|
+
.description("Check name availability")
|
|
208
|
+
.option("--json", "JSON output")
|
|
209
|
+
.action(checkName);
|
|
207
210
|
program
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
211
|
+
.command("quality <package>")
|
|
212
|
+
.description("Quality report")
|
|
213
|
+
.option("--json", "JSON output")
|
|
214
|
+
.action(quality);
|
|
212
215
|
|
|
213
216
|
// Maintenance
|
|
214
217
|
program
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
218
|
+
.command("audit [action]")
|
|
219
|
+
.description("Security audit")
|
|
220
|
+
.option("--json", "JSON output")
|
|
221
|
+
.option("--level <level>", "Minimum severity")
|
|
222
|
+
.action(audit);
|
|
220
223
|
program
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
program.command("doctor").description("Health check").action(doctor)
|
|
224
|
+
.command("outdated")
|
|
225
|
+
.description("Check outdated deps")
|
|
226
|
+
.option("--json", "JSON output")
|
|
227
|
+
.option("--all", "Show all deps")
|
|
228
|
+
.action(outdated);
|
|
229
|
+
program.command("doctor").description("Health check").action(doctor);
|
|
227
230
|
|
|
228
231
|
// Configuration
|
|
232
|
+
const setupCommand = program
|
|
233
|
+
.command("setup")
|
|
234
|
+
.description("Configure .npmrc for CI or local development")
|
|
235
|
+
.action(() => setupCommand.help());
|
|
236
|
+
setupCommand
|
|
237
|
+
.command("ci")
|
|
238
|
+
.description("Generate .npmrc for CI/CD")
|
|
239
|
+
.option("-r, --registry <url>", "Custom registry URL")
|
|
240
|
+
.option("--oidc", "Exchange OIDC token")
|
|
241
|
+
.option("--proxy", "Route all npm traffic through lpm.dev")
|
|
242
|
+
.option("--scoped", "Scoped registry only")
|
|
243
|
+
.action(setup);
|
|
244
|
+
setupCommand
|
|
245
|
+
.command("local")
|
|
246
|
+
.description("Generate read-only .npmrc token for local development")
|
|
247
|
+
.option("-d, --days <number>", "Token expiry days")
|
|
248
|
+
.option("--proxy", "Route all npm traffic through lpm.dev")
|
|
249
|
+
.option("--scoped", "Scoped registry only")
|
|
250
|
+
.action(npmrc);
|
|
229
251
|
program
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
.option("--oidc", "Exchange OIDC token")
|
|
234
|
-
.option("--scoped", "Scoped registry only")
|
|
235
|
-
.action(setup)
|
|
236
|
-
program
|
|
237
|
-
.command("npmrc")
|
|
238
|
-
.description("Generate read-only .npmrc token")
|
|
239
|
-
.option("-d, --days <number>", "Token expiry days")
|
|
240
|
-
.option("--scoped", "Scoped registry only")
|
|
241
|
-
.action(npmrc)
|
|
242
|
-
program
|
|
243
|
-
.command("config [action] [key] [value]")
|
|
244
|
-
.description("Manage CLI config")
|
|
245
|
-
.action(config)
|
|
252
|
+
.command("config [action] [key] [value]")
|
|
253
|
+
.description("Manage CLI config")
|
|
254
|
+
.action(config);
|
|
246
255
|
program
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
256
|
+
.command("set <key> <value>")
|
|
257
|
+
.description('Shortcut for "lpm config set"')
|
|
258
|
+
.action((k, v) => config("set", k, v));
|
|
250
259
|
program
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
260
|
+
.command("cache <action>")
|
|
261
|
+
.description("Manage local cache")
|
|
262
|
+
.action(cache);
|
|
254
263
|
|
|
255
264
|
// Utility
|
|
256
265
|
program
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
266
|
+
.command("open")
|
|
267
|
+
.description("Open dashboard in browser")
|
|
268
|
+
.action(openDashboard);
|
|
260
269
|
program
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
270
|
+
.command("run <script>")
|
|
271
|
+
.description("Run npm scripts")
|
|
272
|
+
.allowUnknownOption()
|
|
273
|
+
.action(run);
|
|
265
274
|
|
|
266
275
|
// Subcommands
|
|
267
|
-
const token = program.command("token").description("Token management")
|
|
268
|
-
token.command("rotate").description("Rotate token").action(rotateToken)
|
|
276
|
+
const token = program.command("token").description("Token management");
|
|
277
|
+
token.command("rotate").description("Rotate token").action(rotateToken);
|
|
269
278
|
|
|
270
|
-
const pool = program.command("pool").description("Pool revenue")
|
|
279
|
+
const pool = program.command("pool").description("Pool revenue");
|
|
271
280
|
pool
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
281
|
+
.command("stats")
|
|
282
|
+
.description("Pool earnings")
|
|
283
|
+
.option("--json", "JSON output")
|
|
284
|
+
.action(poolStats);
|
|
276
285
|
|
|
277
|
-
const mcp = program.command("mcp").description("MCP server")
|
|
286
|
+
const mcp = program.command("mcp").description("MCP server");
|
|
278
287
|
mcp
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
288
|
+
.command("setup")
|
|
289
|
+
.description("Configure MCP server")
|
|
290
|
+
.option("--project", "Project-level config")
|
|
291
|
+
.action(mcpSetup);
|
|
283
292
|
mcp
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
293
|
+
.command("remove")
|
|
294
|
+
.description("Remove MCP server")
|
|
295
|
+
.option("--project", "Project-level only")
|
|
296
|
+
.action(mcpRemove);
|
|
288
297
|
mcp
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
298
|
+
.command("status")
|
|
299
|
+
.description("MCP server status")
|
|
300
|
+
.option("--verbose", "Show diagnostics")
|
|
301
|
+
.action(mcpStatus);
|
|
293
302
|
|
|
294
|
-
const skills = program.command("skills").description("Agent Skills")
|
|
303
|
+
const skills = program.command("skills").description("Agent Skills");
|
|
295
304
|
skills
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
305
|
+
.command("validate")
|
|
306
|
+
.description("Validate skills files")
|
|
307
|
+
.option("--json", "JSON output")
|
|
308
|
+
.action(skillsValidate);
|
|
300
309
|
skills
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
310
|
+
.command("install [package]")
|
|
311
|
+
.description("Install skills")
|
|
312
|
+
.option("--json", "JSON output")
|
|
313
|
+
.action(skillsInstall);
|
|
305
314
|
skills
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
315
|
+
.command("list")
|
|
316
|
+
.description("List available skills")
|
|
317
|
+
.option("--json", "JSON output")
|
|
318
|
+
.action(skillsList);
|
|
310
319
|
skills
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
320
|
+
.command("clean")
|
|
321
|
+
.description("Remove installed skills")
|
|
322
|
+
.option("--json", "JSON output")
|
|
323
|
+
.action(skillsClean);
|
|
315
324
|
|
|
316
|
-
const marketplace = program.command("marketplace").description("Marketplace")
|
|
325
|
+
const marketplace = program.command("marketplace").description("Marketplace");
|
|
317
326
|
marketplace
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
327
|
+
.command("compare <input>")
|
|
328
|
+
.description("Find comparable packages")
|
|
329
|
+
.option("--json", "JSON output")
|
|
330
|
+
.option("--category <category>", "Filter by category")
|
|
331
|
+
.option("--limit <n>", "Max results")
|
|
332
|
+
.action(marketplaceCompare);
|
|
324
333
|
marketplace
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
334
|
+
.command("earnings")
|
|
335
|
+
.description("Revenue summary")
|
|
336
|
+
.option("--json", "JSON output")
|
|
337
|
+
.action(marketplaceEarnings);
|
|
329
338
|
|
|
330
|
-
program.parse()
|
|
339
|
+
program.parse();
|
|
331
340
|
|
|
332
341
|
// ─── Helper ────────────────────────────────────────────────────────
|
|
333
342
|
|
|
334
343
|
function runBinary(binaryPath) {
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
344
|
+
try {
|
|
345
|
+
execFileSync(binaryPath, process.argv.slice(2), {
|
|
346
|
+
stdio: "inherit",
|
|
347
|
+
env: process.env,
|
|
348
|
+
});
|
|
349
|
+
process.exit(0);
|
|
350
|
+
} catch (err) {
|
|
351
|
+
if (err.status != null) {
|
|
352
|
+
process.exit(err.status);
|
|
353
|
+
}
|
|
354
|
+
// Binary failed to execute — fall through to JS CLI
|
|
355
|
+
}
|
|
347
356
|
}
|