Repository navigation
CAMEL-27048: camel-jbang - camel cmd creates only its own command, not all commands and plugins - #30201
Conversation
…t all commands and plugins cmd was one of the commands that consume plugins, so camel cmd created all the commands of the CLI and loaded every plugin (the TUI, Jackson, Citrus, Kubernetes). No plugin adds to cmd, and its subcommands do not use plugins, so it now creates only itself, as the other commands do. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>
oscerd
left a comment
There was a problem hiding this comment.
Follows straight on from the short-command work, and the reasoning is right.
cmd sat in PLUGIN_CONSUMING_BUILTINS next to shell, run and export, so running it triggered full command creation and plugin discovery, which pulls in the TUI with TamboUI, Jackson, Citrus and Kubernetes: 3277 classes against 1486 for camel ps. But cmd only dispatches to its own fixed subcommands (send, reset-stats, route-structure, stop-route, ...), none of which a plugin extends.
I checked that last point rather than take it on faith: nothing under the jbang plugin modules registers a command under cmd; the plugins contribute their own top-level commands (generate, kubernetes, mcp, and so on), which is exactly what the updated javadoc says. So dropping cmd from the set is safe, shell stays in because it genuinely dispatches to plugin-provided commands, and camel cmd, which you note AI agents run a lot, stops paying for a plugin scan it never used. Good, focused win.
Claude Code on behalf of oscerd
|
🧪 CI tested the following changed modules:
🔬 Scalpel shadow comparison — Scalpel: 5 of 726 tested, 8 compile-only — current: 5 all testedMaveniverse Scalpel detected 5 affected modules (current approach: 5). Skip-tests mode would test 5 modules (1 direct + 5 downstream), skip tests for 8 (generated code, meta-modules) Modules Scalpel would test (5)
Modules with tests skipped (8)
💡 Manual integration tests recommended:
All tested modules (14 modules, 2m 33s total)Total reactor time: 2m 33s
Top 20 slowest modules:
|
|
🌟 Thank you for your contribution to the Apache Camel project! 🌟 🐫 Apache Camel Committers, please review the following items:
|
CAMEL-27048 (#30201), the base of this branch, is on main now. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>
CAMEL-27048
camel cmd ...(send, reset-stats, route-structure, stop-route, ...) is one of the commands that AI agents run most, but it was one of the slowest short commands.cmdwas inPluginHelper.PLUGIN_CONSUMING_BUILTINS(with shell, run and export), so the CLI created all its commands and loaded every plugin for it: the TUI with TamboUI, Jackson, Citrus and Kubernetes, 3277 classes against 1486 forcamel ps.No plugin adds anything under
cmd: the plugins add their own top-level command (tui, validate, mcp, kubernetes, edit, generate, test, self-update), and thecmdsubcommands do not use plugins. Socmdis no longer a plugin-consuming command, andcamel cmd ...creates only thecmdcommand, as the other commands of the CLI do.shell,runandexportstay as they are.Measured
JDK 25, macOS (Apple M4 Pro), through
camel.sh(with its CDS archive), against a running integration, median of 12 runs:camel cmd reset-stats cmdtestcamel cmd route-structure cmdtestTests
CamelJBangMainOnlyCommandTest.cmdCreatesOnlyItself(new):camel cmd reset-stats --helpcreates onlycmd, with its subcommands;onlyCommand("cmd", ...)iscmd.PluginHelperTest:cmdno longer triggers plugin discovery.CamelJBangMainOnlyCommandTest,PluginHelperTest,PluginFilteringTest,CliRunnerTest,NoTerminalTest,CamelJBangMainArgumentFileTest,CliHelpGoldenTest: 103 run, 0 failures.camel run --background, thencmd reset-stats,cmd route-structure,cmd send --endpoint=log:x,cmd stop-route,cmd start-routeall exit 0 and do what they say.Related: #30199 (CAMEL-27045), the other startup work for the short commands.
Claude Code on behalf of davsclaus
🤖 Generated with Claude Code
https://claude.ai/code/session_012nJsFsjqqFiwroeHRWaKbS