@lobehub/market-cli 0.0.7 → 0.0.9
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/dist/cli.js +21 -2
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -96,6 +96,12 @@ function registerAuthCommand(program2) {
|
|
|
96
96
|
clientSecret: config.clientSecret
|
|
97
97
|
});
|
|
98
98
|
const tokenInfo = await sdk.fetchM2MToken();
|
|
99
|
+
if (!tokenInfo.accessToken) {
|
|
100
|
+
console.error(
|
|
101
|
+
"Authentication failed: no access token received. Please check your client credentials."
|
|
102
|
+
);
|
|
103
|
+
process.exit(1);
|
|
104
|
+
}
|
|
99
105
|
formatOutput(options.output, {
|
|
100
106
|
baseUrl: config.baseUrl,
|
|
101
107
|
clientId: config.clientId,
|
|
@@ -198,7 +204,7 @@ function registerRegisterCommand(program2) {
|
|
|
198
204
|
},
|
|
199
205
|
platform: process.arch,
|
|
200
206
|
source,
|
|
201
|
-
version: "0.0.
|
|
207
|
+
version: "0.0.9"
|
|
202
208
|
});
|
|
203
209
|
await saveCredentials({
|
|
204
210
|
baseUrl: baseURL,
|
|
@@ -258,6 +264,16 @@ function renderTable(columns, rows) {
|
|
|
258
264
|
}
|
|
259
265
|
|
|
260
266
|
// src/commands/skills.ts
|
|
267
|
+
var SELF_SKILL_IDENTIFIER = "lobehub-skills-search-engine";
|
|
268
|
+
var SELF_SKILL_INSTALL_ERROR = `"${SELF_SKILL_IDENTIFIER}" is the skill that powers this CLI itself and cannot be installed via this command.
|
|
269
|
+
|
|
270
|
+
Install it manually:
|
|
271
|
+
|
|
272
|
+
SKILL_DIR=~/.claude/skills/${SELF_SKILL_IDENTIFIER} # adjust path for your agent
|
|
273
|
+
mkdir -p "$SKILL_DIR/references"
|
|
274
|
+
curl -s https://market.lobehub.com/s/skills > "$SKILL_DIR/SKILL.md"
|
|
275
|
+
curl -s https://market.lobehub.com/s/skills/references/skills-search > "$SKILL_DIR/references/skills-search.md"
|
|
276
|
+
curl -s https://market.lobehub.com/s/skills/references/skills-install > "$SKILL_DIR/references/skills-install.md"`;
|
|
261
277
|
function createSDK() {
|
|
262
278
|
const config = resolveConfig();
|
|
263
279
|
if (!config.clientId || !config.clientSecret) {
|
|
@@ -327,6 +343,9 @@ Showing ${start}-${end} of ${result.totalCount} results`);
|
|
|
327
343
|
});
|
|
328
344
|
skills.command("install <identifier>").description("Download a skill package").option("--version <version>", "Specific version to download").option("--output <path>", "Output file path (defaults to current directory)").action(async (identifier, options) => {
|
|
329
345
|
try {
|
|
346
|
+
if (identifier === SELF_SKILL_IDENTIFIER) {
|
|
347
|
+
throw new Error(SELF_SKILL_INSTALL_ERROR);
|
|
348
|
+
}
|
|
330
349
|
const sdk = createSDK();
|
|
331
350
|
console.log(
|
|
332
351
|
`Downloading skill: ${identifier}${options.version ? `@${options.version}` : ""}...`
|
|
@@ -347,7 +366,7 @@ Showing ${start}-${end} of ${result.totalCount} results`);
|
|
|
347
366
|
|
|
348
367
|
// src/cli.ts
|
|
349
368
|
var program = new Command();
|
|
350
|
-
program.name("lobehub-market").description("LobeHub Market CLI - Device registration and auth management").version("0.0.
|
|
369
|
+
program.name("lobehub-market").description("LobeHub Market CLI - Device registration and auth management").version("0.0.9");
|
|
351
370
|
registerRegisterCommand(program);
|
|
352
371
|
registerAuthCommand(program);
|
|
353
372
|
registerSkillsCommand(program);
|