fix: Make CLI help consistent for native and Unity commands#1146
Conversation
Expose command help for first-party tools and native subcommands before Unity project resolution, so users can rely on `uloop <command> --help` for the current CLI surface. Keep first-party option discovery anchored to the embedded schema so stale project caches cannot re-expose removed flags such as `--wait-for-domain-reload`, and update docs to describe the public `--no-wait-for-domain-reload` form.
The main help now matches the CLI behavior added for first-party Unity tools, so users are no longer pointed only at native command help when `uloop <command> --help` works for both command families.
Move completion-only probes out of the main help, keep command list summaries concise, and make project-scoped command help expose the shared project path option. Also let --help win after other command options and report unknown leading flags as global option errors.
📝 WalkthroughWalkthroughThis PR refactors the CLI help system by introducing unified command help routing, generalizing help-request detection across commands, integrating tool help resolution, adding global options to help outputs, validating unknown global options, and providing comprehensive test coverage for the new behavior. ChangesCLI Help System Refactor
🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
🚥 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 docstrings
🧪 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 |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
Packages/src/Cli~/internal/cli/skills_display.go (1)
67-76: ⚡ Quick winGenerate the skill target flag list from shared config.
This hardcodes the same target set that
printSkillsTargetGuidancealready duplicates below, so the next target change can easily leave help output inconsistent again. Prefer rendering these flags fromdefaultSkillTargetIDs/targetConfigsvia a shared helper.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@Packages/src/Cli`~/internal/cli/skills_display.go around lines 67 - 76, The help output currently hardcodes the skill target flags (the writeLine calls) causing duplication with printSkillsTargetGuidance; replace the hardcoded flag lines by rendering them from the shared config (defaultSkillTargetIDs/targetConfigs) via the same helper used by printSkillsTargetGuidance (or introduce a small helper like renderSkillTargetFlags) so both places derive flags from the same source; update the section that writes "Options:" to call that helper and remove the duplicated literal writeLine entries so changes to defaultSkillTargetIDs/targetConfigs automatically update the help output.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@Packages/src/Cli`~/internal/cli/skills_display.go:
- Around line 67-76: The help output currently hardcodes the skill target flags
(the writeLine calls) causing duplication with printSkillsTargetGuidance;
replace the hardcoded flag lines by rendering them from the shared config
(defaultSkillTargetIDs/targetConfigs) via the same helper used by
printSkillsTargetGuidance (or introduce a small helper like
renderSkillTargetFlags) so both places derive flags from the same source; update
the section that writes "Options:" to call that helper and remove the duplicated
literal writeLine entries so changes to defaultSkillTargetIDs/targetConfigs
automatically update the help output.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: d43ae29b-125a-4544-ac5f-dbb94c1c15a1
⛔ Files ignored due to path filters (3)
Packages/src/Cli~/dist/darwin-amd64/uloopis excluded by!**/dist/**and included by nonePackages/src/Cli~/dist/darwin-arm64/uloopis excluded by!**/dist/**and included by nonePackages/src/Cli~/dist/windows-amd64/uloop.exeis excluded by!**/dist/**,!**/*.exeand included by none
📒 Files selected for processing (16)
Packages/src/Cli~/internal/cli/command_help.goPackages/src/Cli~/internal/cli/completion.goPackages/src/Cli~/internal/cli/completion_test.goPackages/src/Cli~/internal/cli/error_envelope.goPackages/src/Cli~/internal/cli/help_test.goPackages/src/Cli~/internal/cli/launch.goPackages/src/Cli~/internal/cli/run.goPackages/src/Cli~/internal/cli/run_help.goPackages/src/Cli~/internal/cli/skills.goPackages/src/Cli~/internal/cli/skills_display.goPackages/src/Cli~/internal/cli/tools.goPackages/src/Cli~/internal/cli/tools_test.goPackages/src/Cli~/internal/cli/uninstall.goPackages/src/Cli~/internal/cli/update.goREADME.mdREADME_ja.md
There was a problem hiding this comment.
1 issue found across 19 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="Packages/src/Cli~/internal/cli/help_test.go">
<violation number="1" location="Packages/src/Cli~/internal/cli/help_test.go:251">
P1: The removed-flag assertion uses a substring that also matches `--no-wait-for-domain-reload`, making the test produce false failures.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
Re-trigger cubic
Summary
User Impact
<command> --helpfor both built-in CLI commands and Unity tools without needing Unity project resolution first.--wait-for-domain-reloadno longer appear through stale cache data, reducing confusing guidance.Changes
Verification
scripts/check-go-cli.sh~/.codex/skills/codex-review/scripts/codex-review v3-beta --parallel-tests "scripts/check-go-cli.sh"