fix(cmd): hide usage help when command errors occur#120
fix(cmd): hide usage help when command errors occur#120bmahabirbu merged 1 commit intoopenkaiden:mainfrom
Conversation
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 0 minutes and 52 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
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 |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
feloy
left a comment
There was a problem hiding this comment.
a little change in the comments, otherwise LGTM. Thanks
You will also need to sign-off the commit
pkg/cmd/init.go
Outdated
| // Silence Cobra's error and usage output when JSON mode is enabled | ||
| // This prevents "Error: ..." and usage info from being printed | ||
| // Silence Cobra's error output when JSON mode is enabled | ||
| // This prevents "Error: ..." prefix from being printed |
There was a problem hiding this comment.
It's not really the prefix being hidden, but the complete error message: cobra by default write the error returned by the command to stderr. In JSON, we don't to pollute the stream, because we are writing the error in the json
There was a problem hiding this comment.
That makes sense thanks!!
36cdb48 to
c75d637
Compare
Set SilenceUsage on the root command so Cobra never prints usage/help text alongside error messages. Previously this was only done for JSON output mode, leaving text-mode errors cluttered with the full help. Closes kortex-hub#102 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Brian <bmahabir@bu.edu>
c75d637 to
21ab24d
Compare
Add AgentLister optional runtime interface so the info command discovers agents generically instead of coupling to the Podman config package. Remove the SilenceErrors block that is no longer needed since openkaiden#120. Document the info command in the README and AgentLister in skills/CLAUDE.md. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary
SilenceUsage: trueon the root command so Cobra never prints usage/help text alongside error messagesSilenceUsagelines that were only active in JSON modeSilenceErrorsin JSON mode to suppress theError:prefix for clean JSON outputBefore:
After:
Closes #102
Test plan
make test)--helpflag still shows usage as expected🤖 Generated with Claude Code