feat: add commands to list the command tree for easier discovery#1585
Open
developerkunal wants to merge 1 commit into
Open
feat: add commands to list the command tree for easier discovery#1585developerkunal wants to merge 1 commit into
commands to list the command tree for easier discovery#1585developerkunal wants to merge 1 commit into
Conversation
Add a top-level `auth0 commands` that prints the full command tree with short descriptions, so the whole CLI surface can be discovered without inspecting each --help page individually. Supports three output shapes: - default nested tree with descriptions - --flat for one runnable command per line, ideal for scanning or intent matching - --json (with optional --detailed) exposing usage, arguments, flags, aliases and whether authentication is required Accepts an optional command path (e.g. `auth0 commands apps`) to scope the output to a single branch, and a --depth flag to limit nesting.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🔧 Changes
Adds a new top-level
auth0 commandscommand that prints the entire CLI command tree along with a short description of what each command does. The goal is to make the whole command surface discoverable in a single place, so you (or an AI agent driving the CLI) can find the right command without inspecting each--helppage individually.It supports three output shapes:
--flat— every runnable command on its own line aspath — description, which is the easiest form to scan or match an intent against.--json— a machine-readable representation. Combined with--detailedit also includes the usage line, positional arguments, local flags (name, shorthand, usage, type, default), aliases, and whether the command requires authentication, which is enough to construct a valid invocation programmatically.Additional behavior:
auth0 commands appsorauth0 commands apps create) to scope the output to a single branch instead of the whole tree.--depthflag limits how many levels are shown.The tree-walking logic runs only when
auth0 commandsis invoked, so there is no impact on the startup or runtime of any other command, and no new dependencies are introduced.📚 References
N/A
🔬 Testing
internal/cli/commands_test.gocovering tree building, depth limiting, detailed output, flat output (including the scoped case), and positional argument extraction that correctly ignores flag values.internal/clitest suite passes.docs/auth0_commands.mdand thedocs/index.mdlisting stay in sync with the new command.Manual checks:
📝 Checklist