davsclaus opened a new pull request, #30201: URL: https://github.com/apache/camel/pull/30201
[CAMEL-27048](https://issues.apache.org/jira/browse/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. `cmd` was in `PluginHelper.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 for `camel 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 the `cmd` subcommands do not use plugins. So `cmd` is no longer a plugin-consuming command, and `camel cmd ...` creates only the `cmd` command, as the other commands of the CLI do. `shell`, `run` and `export` stay 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: | command | main | this PR | |---|---|---| | `camel cmd reset-stats cmdtest` | 276 ms | 195 ms | | `camel cmd route-structure cmdtest` | 274 ms | 196 ms | ### Tests - `CamelJBangMainOnlyCommandTest.cmdCreatesOnlyItself` (new): `camel cmd reset-stats --help` creates only `cmd`, with its subcommands; `onlyCommand("cmd", ...)` is `cmd`. - `PluginHelperTest`: `cmd` no longer triggers plugin discovery. - camel-jbang-core: `CamelJBangMainOnlyCommandTest`, `PluginHelperTest`, `PluginFilteringTest`, `CliRunnerTest`, `NoTerminalTest`, `CamelJBangMainArgumentFileTest`, `CliHelpGoldenTest`: 103 run, 0 failures. - Distribution: `camel run --background`, then `cmd reset-stats`, `cmd route-structure`, `cmd send --endpoint=log:x`, `cmd stop-route`, `cmd start-route` all 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.com/claude-code) https://claude.ai/code/session_012nJsFsjqqFiwroeHRWaKbS -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
