Skip to content

CAMEL-27048: camel-jbang - camel cmd creates only its own command, not all commands and plugins - #30201

Merged
davsclaus merged 1 commit into
mainfrom
CAMEL-27048-cmd-only
Nov 16, 2026
Merged

davsclaus merged 1 commit into
mainfrom
CAMEL-27048-cmd-only

Conversation

@davsclaus

Copy link
Copy Markdown
Contributor

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.ai/code/session_012nJsFsjqqFiwroeHRWaKbS

…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 oscerd left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@github-actions

Copy link
Copy Markdown
Contributor

🧪 CI tested the following changed modules:

  • dsl/camel-jbang/camel-jbang-core

🔬 Scalpel shadow comparison — Scalpel: 5 of 726 tested, 8 compile-only — current: 5 all tested

Maveniverse 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)
  • camel-jbang-mcp ← downstream of org.apache.camel:camel-jbang-core
  • camel-jbang-plugin-mcp ← downstream of org.apache.camel:camel-jbang-core
  • camel-jbang-plugin-tui ← downstream of org.apache.camel:camel-jbang-core
  • camel-jbang-plugin-validate ← downstream of org.apache.camel:camel-jbang-core
  • camel-launcher-container ← downstream of org.apache.camel:camel-launcher
Modules with tests skipped (8)
  • camel-jbang-it
  • camel-jbang-main
  • camel-jbang-plugin-edit
  • camel-jbang-plugin-generate
  • camel-jbang-plugin-kubernetes
  • camel-jbang-plugin-test
  • camel-launcher
  • coverage

ℹ️ Shadow mode — Scalpel observes but does not affect test execution. Learn more

⚠️ Some tests are disabled on GitHub Actions (@DisabledIfSystemProperty(named = "ci.env.name")) and require manual verification:

  • dsl/camel-jbang/camel-jbang-core: 2 test(s) disabled on GitHub Actions

💡 Manual integration tests recommended:

You modified dsl/camel-jbang/camel-jbang-core. The related integration tests in dsl/camel-jbang/camel-jbang-it are excluded from CI. Consider running them manually:

mvn verify -f dsl/camel-jbang/camel-jbang-it -Djbang-it-test
All tested modules (14 modules, 2m 33s total)

Total reactor time: 2m 33s

Module Duration Status
Camel :: JBang :: Plugin :: TUI 44.4s SUCCESS
Camel :: JBang :: MCP 43.3s SUCCESS
Camel :: JBang :: Plugin :: Validate 22.4s SUCCESS
Camel :: JBang :: Plugin :: Kubernetes 12.0s SUCCESS
Camel :: JBang :: Plugin :: Testing 11.4s SUCCESS
Camel :: JBang :: Plugin :: Generate 7.7s SUCCESS
Camel :: Coverage 3.2s SUCCESS
Camel :: JBang :: Plugin :: Edit 3.2s SUCCESS
Camel :: JBang :: Plugin :: MCP 2.5s SUCCESS
Camel :: JBang :: Main 1.6s SUCCESS
Camel :: JBang :: Integration tests 0.9s SUCCESS
Camel :: Launcher :: Container 0.5s SUCCESS
Camel :: JBang :: Core n/a
Camel :: Launcher n/a

Top 20 slowest modules:

  • Camel :: JBang :: Plugin :: TUI (44.4s)
  • Camel :: JBang :: MCP (43.3s)
  • Camel :: JBang :: Plugin :: Validate (22.4s)
  • Camel :: JBang :: Plugin :: Kubernetes (12.0s)
  • Camel :: JBang :: Plugin :: Testing (11.4s)
  • Camel :: JBang :: Plugin :: Generate (7.7s)
  • Camel :: Coverage (3.2s)
  • Camel :: JBang :: Plugin :: Edit (3.2s)
  • Camel :: JBang :: Plugin :: MCP (2.5s)
  • Camel :: JBang :: Main (1.6s)
  • Camel :: JBang :: Integration tests (0.9s)
  • Camel :: Launcher :: Container (0.5s)

⚙️ View full build and test results

@github-actions

Copy link
Copy Markdown
Contributor

🌟 Thank you for your contribution to the Apache Camel project! 🌟
🤖 CI automation will test this PR automatically.

🐫 Apache Camel Committers, please review the following items:

  • First-time contributors require MANUAL approval for the GitHub Actions to run
  • You can use the command /component-test (camel-)component-name1 (camel-)component-name2.. to request a test from the test bot although they are normally detected and executed by CI.
  • You can label PRs using skip-tests and test-dependents to fine-tune the checks executed by this PR.
  • Build and test logs are available in the summary page. Only Apache Camel committers have access to the summary.

⚠️ Be careful when sharing logs. Review their contents before sharing them publicly.

@davsclaus davsclaus self-assigned this Nov 16, 2026
@davsclaus
davsclaus merged commit aa87829 into main Nov 16, 2026
6 checks passed
@davsclaus
davsclaus deleted the CAMEL-27048-cmd-only branch November 16, 2026 16:02
davsclaus added a commit that referenced this pull request Nov 16, 2026
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dsl enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants