From 5007b9b574cf74dab033e0bf882b2a981581412a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=95=85=E7=92=83?= Date: Fri, 7 Aug 2026 16:35:47 +0800 Subject: [PATCH] feat: change output to json --- packages/commands/src/commands/skill/add.ts | 3 +-- packages/commands/src/commands/skill/list.ts | 3 +-- packages/commands/src/commands/skill/remove.ts | 3 +-- packages/commands/src/commands/skill/update.ts | 3 +-- 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/packages/commands/src/commands/skill/add.ts b/packages/commands/src/commands/skill/add.ts index 073a80a..3182dab 100644 --- a/packages/commands/src/commands/skill/add.ts +++ b/packages/commands/src/commands/skill/add.ts @@ -2,7 +2,6 @@ import { BailianError, ExitCode, defineCommand, - detectOutputFormat, detectInstalledAgents, fetchSkillsIndex, getSkillRegistryBaseUrl, @@ -39,7 +38,7 @@ export default defineCommand({ }, exampleArgs: ["--name all", "--name spark-video,bailian-model-recommend"], async run(ctx) { - const format = detectOutputFormat(ctx.settings.output); + const format = ctx.settings.outputExplicit ? ctx.settings.output : "json"; const requested = parseSkillNames(ctx.flags.name, false); const index = await fetchSkillsIndex(); const remoteNames = Object.keys(index.skills); diff --git a/packages/commands/src/commands/skill/list.ts b/packages/commands/src/commands/skill/list.ts index aa6552c..1a21887 100644 --- a/packages/commands/src/commands/skill/list.ts +++ b/packages/commands/src/commands/skill/list.ts @@ -1,6 +1,5 @@ import { defineCommand, - detectOutputFormat, computeSkillStatuses, fetchSkillsIndex, getSkillRegistryBaseUrl, @@ -24,7 +23,7 @@ export default defineCommand({ "STATUS: installed | outdated | not-installed | missing (lock has it, dir deleted) | untracked (dir exists, not managed)", ], async run(ctx) { - const format = detectOutputFormat(ctx.settings.output); + const format = ctx.settings.outputExplicit ? ctx.settings.output : "json"; // Three-way reconciliation: live remote index × skill-lock.json (installation facts) × disk const index = await fetchSkillsIndex(); const lock = readSkillLock(); diff --git a/packages/commands/src/commands/skill/remove.ts b/packages/commands/src/commands/skill/remove.ts index e51106c..5074962 100644 --- a/packages/commands/src/commands/skill/remove.ts +++ b/packages/commands/src/commands/skill/remove.ts @@ -2,7 +2,6 @@ import { BailianError, ExitCode, defineCommand, - detectOutputFormat, listSkillDirsOnDisk, parseSkillNames, readSkillLock, @@ -34,7 +33,7 @@ export default defineCommand({ exampleArgs: ["--name spark-video", "--name all"], async run(ctx) { // Purely local operation: no remote access, works offline - const format = detectOutputFormat(ctx.settings.output); + const format = ctx.settings.outputExplicit ? ctx.settings.output : "json"; const requested = parseSkillNames(ctx.flags.name, false); const lock = readSkillLock(); const names = requested === "all" ? Object.keys(lock.skills) : requested; diff --git a/packages/commands/src/commands/skill/update.ts b/packages/commands/src/commands/skill/update.ts index 61e1b1f..b41ac01 100644 --- a/packages/commands/src/commands/skill/update.ts +++ b/packages/commands/src/commands/skill/update.ts @@ -2,7 +2,6 @@ import { BailianError, ExitCode, defineCommand, - detectOutputFormat, detectInstalledAgents, fanOutSkillToAgents, fetchSkillsIndex, @@ -40,7 +39,7 @@ export default defineCommand({ }, exampleArgs: ["", "--name spark-video"], async run(ctx) { - const format = detectOutputFormat(ctx.settings.output); + const format = ctx.settings.outputExplicit ? ctx.settings.output : "json"; const requested = parseSkillNames(ctx.flags.name, true); const index = await fetchSkillsIndex(); const lock = readSkillLock();