Skip to content

CAMEL-21966: Add example usage snippets to camel-jbang CLI help text#22193

Open
gnodet wants to merge 4 commits intomainfrom
CAMEL-21966-jbang-help-examples
Open

CAMEL-21966: Add example usage snippets to camel-jbang CLI help text#22193
gnodet wants to merge 4 commits intomainfrom
CAMEL-21966-jbang-help-examples

Conversation

@gnodet
Copy link
Contributor

@gnodet gnodet commented Mar 23, 2026

JIRA: CAMEL-21966

Summary

  • Added example usage snippets to the --help output of 29 camel-jbang CLI commands using picocli's footer field
  • Covers core commands (run, init, export, debug, explain, harden), process commands (ps, stop, get, top), catalog commands (doc, component, kamelet), action commands (trace, send, log), config, version, and other commands
  • Examples show practical usage patterns directly in the help documentation, similar to tools like oc and kubectl

Test plan

  • Verified compilation succeeds
  • Verified code formatting is clean
  • Manual: run camel <command> --help to see examples in the footer section

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions
Copy link
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 build-all, build-dependents, 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.

@github-actions github-actions bot added the dsl label Mar 23, 2026
- Debug: replace --suspend (non-existent) with --stop-on-exit=false
- SBOMGenerator: replace --output-format with --sbom-output-format

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Contributor

🧪 CI tested the following changed modules:

  • dsl/camel-jbang/camel-jbang-core
All tested modules (26 modules)
  • Camel :: Coverage
  • Camel :: Coverage [pom]
  • Camel :: JBang :: Core
  • Camel :: JBang :: Core [jar]
  • Camel :: JBang :: Integration tests
  • Camel :: JBang :: Integration tests [jar]
  • Camel :: JBang :: MCP
  • Camel :: JBang :: MCP [jar]
  • Camel :: JBang :: Main
  • Camel :: JBang :: Main [jar]
  • Camel :: JBang :: Plugin :: Edit
  • Camel :: JBang :: Plugin :: Edit [jar]
  • Camel :: JBang :: Plugin :: Generate
  • Camel :: JBang :: Plugin :: Generate [jar]
  • Camel :: JBang :: Plugin :: Kubernetes
  • Camel :: JBang :: Plugin :: Kubernetes [jar]
  • Camel :: JBang :: Plugin :: Route Parser
  • Camel :: JBang :: Plugin :: Route Parser [jar]
  • Camel :: JBang :: Plugin :: Testing
  • Camel :: JBang :: Plugin :: Testing [jar]
  • Camel :: JBang :: Plugin :: Validate
  • Camel :: JBang :: Plugin :: Validate [jar]
  • Camel :: Launcher
  • Camel :: Launcher [jar]
  • Camel :: Launcher :: Container
  • Camel :: Launcher :: Container [pom]

- Complete: use 'camel completion' (registered name) instead of 'camel complete'
- CamelLogAction: use 'camel log' (top-level shortcut) instead of 'camel cmd log'
- CamelTraceAction: use 'camel trace' (top-level shortcut) instead of 'camel cmd trace'
- CatalogDoc: use 'camel doc' (top-level shortcut) instead of 'camel catalog doc'

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Contributor

@apupier apupier left a comment

Choose a reason for hiding this comment

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

one example is not working

could you provide a snapshot of how it is rendered in the terminal?

"%nExamples:",
" camel doc kafka",
" camel doc timer",
" camel doc beer-source",
Copy link
Contributor

Choose a reason for hiding this comment

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

by default, I do not have this beer-source part fo the catalog

Camel kamelet: beer-source not found. Did you mean? fhir-source, jira-source

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Claude Code on behalf of Guillaume Nodet

Good catch! Fixed in 4401bb1 — replaced beer-source with aws-s3-source which is a real kamelet available in the default catalog.

…rce in example

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@gnodet
Copy link
Contributor Author

gnodet commented Mar 24, 2026

Claude Code on behalf of Guillaume Nodet

@apupier Here's how the examples render in the terminal:

camel run --help
$ camel run --help
...
      --observe              Enable observability services

Examples:
  camel run hello.java
  camel run hello.yaml
  camel run *
  camel run hello.java --dev
  camel run hello.java --port=8080
  camel run https://gist.github.com/user/123456
camel doc --help
$ camel doc --help
...
      --kamelets-version=<kameletsVersion>
                            Apache Camel Kamelets version
                              Default: 4.18.0

Examples:
  camel doc kafka
  camel doc timer
  camel doc aws-s3-source
  camel doc jsonpath
camel export --help
$ camel export --help
...

Examples:
  camel export hello.java
  camel export --runtime=spring-boot hello.java
  camel export --runtime=quarkus *
  camel export --gav=com.example:myapp:1.0 hello.java
  camel export --dry-run hello.java
camel config set --help (subcommand example)
$ camel config set --help
Usage: camel config set [-h] [--global] <configuration>
Set user configuration value
      <configuration>   Configuration parameter (ex. key=value)
  -h, --help            Display the help and sub-commands
      --global          Use global or local configuration

Examples:
  camel config set camel-version=4.10.0
  camel config set runtime=spring-boot
camel log --help
$ camel log --help
...

Examples:
  camel log hello
  camel log *
  camel log hello --tail=50
camel version list --help
$ camel version list --help
...
      --json                Output in JSON Format

Examples:
  camel version list
  camel version list --runtime=spring-boot
  camel version list --lts

The beer-source example has been replaced with aws-s3-source (a real kamelet in the default catalog).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants