Skip to content

Commit 5007b9b

Browse files
committed
feat: change output to json
1 parent 8286a74 commit 5007b9b

4 files changed

Lines changed: 4 additions & 8 deletions

File tree

packages/commands/src/commands/skill/add.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import {
22
BailianError,
33
ExitCode,
44
defineCommand,
5-
detectOutputFormat,
65
detectInstalledAgents,
76
fetchSkillsIndex,
87
getSkillRegistryBaseUrl,
@@ -39,7 +38,7 @@ export default defineCommand({
3938
},
4039
exampleArgs: ["--name all", "--name spark-video,bailian-model-recommend"],
4140
async run(ctx) {
42-
const format = detectOutputFormat(ctx.settings.output);
41+
const format = ctx.settings.outputExplicit ? ctx.settings.output : "json";
4342
const requested = parseSkillNames(ctx.flags.name, false);
4443
const index = await fetchSkillsIndex();
4544
const remoteNames = Object.keys(index.skills);

packages/commands/src/commands/skill/list.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import {
22
defineCommand,
3-
detectOutputFormat,
43
computeSkillStatuses,
54
fetchSkillsIndex,
65
getSkillRegistryBaseUrl,
@@ -24,7 +23,7 @@ export default defineCommand({
2423
"STATUS: installed | outdated | not-installed | missing (lock has it, dir deleted) | untracked (dir exists, not managed)",
2524
],
2625
async run(ctx) {
27-
const format = detectOutputFormat(ctx.settings.output);
26+
const format = ctx.settings.outputExplicit ? ctx.settings.output : "json";
2827
// Three-way reconciliation: live remote index × skill-lock.json (installation facts) × disk
2928
const index = await fetchSkillsIndex();
3029
const lock = readSkillLock();

packages/commands/src/commands/skill/remove.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import {
22
BailianError,
33
ExitCode,
44
defineCommand,
5-
detectOutputFormat,
65
listSkillDirsOnDisk,
76
parseSkillNames,
87
readSkillLock,
@@ -34,7 +33,7 @@ export default defineCommand({
3433
exampleArgs: ["--name spark-video", "--name all"],
3534
async run(ctx) {
3635
// Purely local operation: no remote access, works offline
37-
const format = detectOutputFormat(ctx.settings.output);
36+
const format = ctx.settings.outputExplicit ? ctx.settings.output : "json";
3837
const requested = parseSkillNames(ctx.flags.name, false);
3938
const lock = readSkillLock();
4039
const names = requested === "all" ? Object.keys(lock.skills) : requested;

packages/commands/src/commands/skill/update.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import {
22
BailianError,
33
ExitCode,
44
defineCommand,
5-
detectOutputFormat,
65
detectInstalledAgents,
76
fanOutSkillToAgents,
87
fetchSkillsIndex,
@@ -40,7 +39,7 @@ export default defineCommand({
4039
},
4140
exampleArgs: ["", "--name spark-video"],
4241
async run(ctx) {
43-
const format = detectOutputFormat(ctx.settings.output);
42+
const format = ctx.settings.outputExplicit ? ctx.settings.output : "json";
4443
const requested = parseSkillNames(ctx.flags.name, true);
4544
const index = await fetchSkillsIndex();
4645
const lock = readSkillLock();

0 commit comments

Comments
 (0)