Skip to content

feat: add full command reference to root --help - #2

Merged
jschfflr merged 2 commits into
mainfrom
feat/help-command-reference
Feb 24, 2026
Merged

feat: add full command reference to root --help#2
jschfflr merged 2 commits into
mainfrom
feat/help-command-reference

Conversation

@jschfflr

Copy link
Copy Markdown
Contributor

Summary

  • Adds a dynamically generated "All Commands" section to the root --help output
  • Agents and humans can discover every command with args in a single --help call, without drilling into sub-commands
  • Signatures are auto-trimmed with ... and descriptions truncated to fit 78 columns
  • Epilogue only shows at root level — sub-command help pages are unchanged

Test plan

  • uv run qodev-gitlab-cli --help shows "All Commands" at the bottom
  • uv run qodev-gitlab-cli mrs --help shows normal help (no epilogue)
  • uv run qodev-gitlab-cli mrs list --help shows normal help (no epilogue)
  • ruff check passes

🤖 Generated with Claude Code

jschfflr and others added 2 commits February 24, 2026 09:13
Show all commands with their args in a flat "All Commands" section at the
bottom of `--help`, so agents and humans can discover everything in a single
call without drilling into sub-commands.

The reference is generated dynamically by walking registered sub-apps and
inspecting function signatures. Long signatures are trimmed with `...` and
descriptions are truncated to fit 78 columns.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Address review feedback:
- Move command reference logic to help_reference.py
- Use public resolved_commands() API instead of private _commands
- Narrow exception catch to (TypeError, NameError)
- Fix type annotation on _is_bool_type (object, not type | None)
- Remove dead default for col_width param
- Guard against empty name tuple
- Remove redundant dropped truthy check
- Use consistent ellipsis character (unicode)
- Name magic constants

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jschfflr
jschfflr merged commit 5db090b into main Feb 24, 2026
3 checks passed
@jschfflr
jschfflr deleted the feat/help-command-reference branch February 24, 2026 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant