Skip to content

Commit a463940

Browse files
committed
feat: add JSON output support to all CLI commands
- Add --json flag to convert, move, split, join, merge, and index commands - Enable machine-readable output for scripting and automation - Maintain backward compatibility with existing CLI usage - Support both human-readable and JSON output formats
1 parent 5096867 commit a463940

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/cli.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ program
2828
.option('-r, --recursive', 'Process directories recursively')
2929
.option('-d, --dry-run', 'Show what would be changed without making changes')
3030
.option('-v, --verbose', 'Show detailed output with processing information')
31+
.option('--json', 'Output results in JSON format')
3132
.addHelpText(
3233
'after',
3334
`
@@ -58,6 +59,7 @@ program
5859
)
5960
.option('-d, --dry-run', 'Show what would be changed without making changes')
6061
.option('-v, --verbose', 'Show detailed output')
62+
.option('--json', 'Output results in JSON format')
6163
.action(moveCommand);
6264

6365
program
@@ -71,6 +73,7 @@ program
7173
.option('--split-lines <lines>', 'Comma-separated line numbers to split on (for lines strategy)')
7274
.option('-d, --dry-run', 'Show what would be changed without making changes')
7375
.option('-v, --verbose', 'Show detailed output')
76+
.option('--json', 'Output results in JSON format')
7477
.action(splitCommand);
7578

7679
program
@@ -85,6 +88,7 @@ program
8588
)
8689
.option('-d, --dry-run', 'Show what would be changed without making changes')
8790
.option('-v, --verbose', 'Show detailed output')
91+
.option('--json', 'Output results in JSON format')
8892
.action(joinCommand);
8993

9094
program
@@ -96,6 +100,7 @@ program
96100
.option('--create-transclusions', 'Create Obsidian transclusions instead of copying content')
97101
.option('-d, --dry-run', 'Show what would be changed without making changes')
98102
.option('-v, --verbose', 'Show detailed output')
103+
.option('--json', 'Output results in JSON format')
99104
.action(mergeCommand);
100105

101106
program
@@ -117,6 +122,7 @@ program
117122
.option('--boundary <path>', 'Explicit boundary path to limit scanning scope')
118123
.option('-d, --dry-run', 'Show what would be generated without creating files')
119124
.option('-v, --verbose', 'Show detailed output')
125+
.option('--json', 'Output results in JSON format')
120126
.action(indexCommand);
121127

122128
program.parse();

0 commit comments

Comments
 (0)