CAMEL-23236: Improve beginner UX with interactive init, examples, doctor, and contextual help#22211
Open
CAMEL-23236: Improve beginner UX with interactive init, examples, doctor, and contextual help#22211
Conversation
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>
This reverts commit 65d7843.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
|
🌟 Thank you for your contribution to the Apache Camel project! 🌟 🐫 Apache Camel Committers, please review the following items:
|
Contributor
|
🧪 CI tested the following changed modules:
All tested modules (26 modules)
|
1 similar comment
Contributor
|
🧪 CI tested the following changed modules:
All tested modules (26 modules)
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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, andplugin add kit. When routes exist, suggestsrun *andrun * --dev.Interactive
camel initpicker: Whencamel initis 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 messagescamel run --example rest-api— REST API with hello endpointscamel run --example cron-log— scheduled taskcamel run --example-list— shows available examplesExtended "did you mean?" suggestions:
SuggestSimilarHelpernow used inCatalogBaseCommand(when filter returns no results) and inrun --example(when unknown example name given).camel doctorcommand: Diagnostic command checking Java version, JBang, Camel version, Maven Central reachability, Docker status, common port conflicts, and disk space.Camel-Kit discoverability: Added
KITtoPluginTypeenum, tip ininit --helpfooter, and hints in shell banner.Note:
camel docwas already registered as a top-level alias (item 1 from the plan).Test plan
PluginGetTestupdated for new KIT plugin entrymvn formatter:format impsort:sortcamel run --example timer-logcamel doctor