Skip to content

CAMEL-23236: Improve beginner UX with interactive init, examples, doctor, and contextual help#22211

Open
gnodet wants to merge 12 commits intomainfrom
copy-shroud
Open

CAMEL-23236: Improve beginner UX with interactive init, examples, doctor, and contextual help#22211
gnodet wants to merge 12 commits intomainfrom
copy-shroud

Conversation

@gnodet
Copy link
Contributor

@gnodet gnodet commented Mar 24, 2026

Summary

Implements the improvements outlined in CAMEL-23236 to make the Camel JBang CLI more approachable for beginners:

  • Context-aware shell banner: The shell now detects route files in the current directory and shows appropriate quick-start hints. When no routes are found, suggests init, run --example, doc, and plugin add kit. When routes exist, suggests run * and run * --dev.

  • Interactive camel init picker: When camel init is invoked with no arguments in an interactive terminal (TTY, non-CI), shows an interactive template picker that guides users through selecting a category, template, and filename. Non-interactive behavior is unchanged.

  • camel run --example: Zero-to-running experience with built-in examples:

    • camel run --example timer-log — timer that logs messages
    • camel run --example rest-api — REST API with hello endpoints
    • camel run --example cron-log — scheduled task
    • camel run --example-list — shows available examples
  • Extended "did you mean?" suggestions: SuggestSimilarHelper now used in CatalogBaseCommand (when filter returns no results) and in run --example (when unknown example name given).

  • camel doctor command: Diagnostic command checking Java version, JBang, Camel version, Maven Central reachability, Docker status, common port conflicts, and disk space.

  • Camel-Kit discoverability: Added KIT to PluginType enum, tip in init --help footer, and hints in shell banner.

Note: camel doc was already registered as a top-level alias (item 1 from the plan).

Test plan

  • All 311 existing tests pass
  • PluginGetTest updated for new KIT plugin entry
  • Code formatted with mvn formatter:format impsort:sort
  • Manual testing of interactive init picker
  • Manual testing of camel run --example timer-log
  • Manual testing of camel doctor
  • Manual testing of shell banner

gnodet and others added 12 commits March 24, 2026 07:52
The shell now prints a banner on startup that detects route files in the
current directory and shows appropriate quick-start hints for beginners.
When no routes are found, it suggests init, doc, and help commands.
When routes are present, it suggests run and run --dev commands.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When `camel init` is invoked with no arguments in an interactive terminal
(TTY, non-CI), show an interactive template picker that guides the user
through selecting a category, template, and filename. Non-interactive
behavior is unchanged.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Allow running built-in examples without creating any files first:
  camel run --example timer-log
  camel run --example rest-api
  camel run --example cron-log

Use --example-list to show available examples. Examples are bundled
YAML route files extracted to a temp directory at runtime.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- CatalogBaseCommand: when filter returns no results, suggest similar
  names using SuggestSimilarHelper and hint about 'camel doc'
- Run --example: suggest similar example names when unknown example given

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
New `camel doctor` command that checks the environment and reports:
- Java version (21+ required)
- JBang version
- Camel version
- Maven Central reachability
- Docker daemon status
- Common port conflicts (8080, 8443, 9090)
- Disk space in temp directory

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add KIT to PluginType enum so `camel plugin get --all` shows it
- Add tip about camel-kit in `camel init --help` footer
- Add AI scaffold hint and examples hint in shell banner when no routes

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Fix List.of() type inference issue with single String[] element.
Apply code formatter to PluginType.java.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Update expected counts and add assertion for the new KIT plugin.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Doctor: drain docker process output to prevent blocking, use import
  for ServerSocket instead of fully-qualified name
- Init: handle NumberFormatException in interactive picker with better
  error messages
- Shell: add parentheses to boolean logic in countRouteFiles for clarity

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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 24, 2026
@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]

1 similar comment
@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]

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.

1 participant