feat: add JSON output format#26
Conversation
📝 WalkthroughWalkthroughThis PR adds machine-readable JSON output to the CLI tool. A new persistent ChangesJSON Output Feature
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
87b1d18 to
3c2bdef
Compare
Summary
Adds a machine-readable JSON output mode via the global
--formatflag while preserving existing text output as the default.Supported commands:
blogwatcher-cli add ... --format jsonblogwatcher-cli remove ... --yes --format jsonblogwatcher-cli blogs --format jsonblogwatcher-cli scan --format jsonblogwatcher-cli articles --format jsonblogwatcher-cli read <id> --format jsonblogwatcher-cli unread <id> --format jsonblogwatcher-cli read-all --yes --format jsonblogwatcher-cli import subscriptions.opml --format jsonThis makes the CLI easier to use from scripts and agent/tool integrations without parsing human-oriented terminal output.
Notes
--format textis the default.BLOGWATCHER_FORMAT=jsonworks via the existing viper env binding.remove,read-all) require--yesin JSON mode to avoid interactive/non-JSON prompts.Testing
go test ./...