CAMEL-23638: camel-jbang - Add CLI meta-tools to camel ask#23600
Open
gnodet wants to merge 1 commit into
Open
Conversation
Add 3 CLI meta-tools that give camel ask access to the entire CLI via progressive discovery instead of hardcoded tool definitions: - cli_list_commands: discover commands from auto-generated metadata - cli_command_help: get options/types/defaults for a specific command - cli_exec: execute any CLI command in-process with captured output The existing curated tools are preserved for common operations. The meta-tools serve as an escape hatch for the full 126-command CLI. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
|
🌟 Thank you for your contribution to the Apache Camel project! 🌟 🐫 Apache Camel Committers, please review the following items:
|
Contributor
|
🧪 CI tested the following changed modules:
💡 Manual integration tests recommended:
All tested modules (6 modules)
|
davsclaus
approved these changes
May 28, 2026
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.
CAMEL-23638
Summary
Currently
camel askhas ~26 hardcoded tool definitions. New CLI features (likecamel get error --diagram) are not automatically available to the LLM. This adds 3 CLI meta-tools that give the LLM progressive access to the entire 126-command CLI:cli_list_commands(filter?)— discover available commands from the auto-generatedcamel-jbang-commands-metadata.jsoncli_command_help(command)— get detailed help for a specific command (options, types, defaults, subcommands)cli_exec(command)— execute any CLI command in-process and return captured outputThe existing curated tools are preserved for common operations (they're faster — one tool call vs three). The meta-tools serve as an escape hatch for everything else.
How the LLM uses it
Example flow for
camel get error --diagram:cli_list_commands("error")→ seesget error: Get captured routing errors...cli_command_help("get error")→ sees--diagram,--detail,--last, etc.cli_exec("get error --diagram")→ gets the diagram + error detailsDesign decisions
CamelJBangMain.getCommandLine().execute()in-process (no subprocess)PrinteronCamelJBangMainTest plan
cli_list_commandsreturns all 126 commands from metadatacli_list_commandswith filter narrows results correctlycli_command_help("get error")returns all 16 optionscli_exec("catalog component --filter=kafka")returns outputClaude Code on behalf of Guillaume Nodet