CAMEL-23236: Improve beginner UX with interactive init, examples, and doctor command#23160
CAMEL-23236: Improve beginner UX with interactive init, examples, and doctor command#23160davsclaus wants to merge 5 commits into
Conversation
…tor, and contextual help - Add interactive template picker to camel init (--list flag, arrow-key selection) - Add camel run --example for zero-to-running experience with bundled examples - Add camel doctor diagnostic command for environment/dependency checks - Extend did-you-mean suggestions to more commands in CatalogBaseCommand - Add context-aware shell banner (detects route files, shows quick-start hints) - Improve Camel-Kit discoverability (add KIT plugin type) - Include bundled example route files (timer-log, cron-log, rest-api) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Java 17 is still supported, so the doctor command should show OK but recommend upgrading to 21 or 25 for better performance. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
🌟 Thank you for your contribution to the Apache Camel project! 🌟 🐫 Apache Camel Committers, please review the following items:
|
|
🧪 CI tested the following changed modules:
💡 Manual integration tests recommended:
All tested modules (6 modules)
|
davsclaus
left a comment
There was a problem hiding this comment.
Thanks for the work on improving the beginner UX — this is a nice set of features. A few items need attention before this can be merged.
Summary
- FQCN in
Run.java— usesorg.apache.camel.main.util.SuggestSimilarHelperinline instead of importing it. The CI OpenRewrite check will flag this. (CatalogBaseCommand.javacorrectly imports it.) - FQCN in
Doctor.java— usesjava.io.OutputStream.nullOutputStream()inline instead of importingjava.io.OutputStream. - Missing tests — three new features (Doctor command, interactive init picker,
run --example) are added without unit tests. Per project conventions, every PR should include tests for new functionality. At minimum,Doctor,Run.runExample(), andRun.listExamples()should have basic coverage. - Minor:
Shell.countRouteFiles()mixes&&and||without explicit parentheses — correct by Java precedence, but parentheses would improve readability.
This review covers project rules and conventions only. It does not replace specialized review tools such as CodeRabbit, Sourcery, or SonarCloud.
This review was generated by an AI agent and may contain inaccuracies. Please verify all suggestions before applying.
- Fix FQCN: import SuggestSimilarHelper in Run.java - Fix FQCN: import OutputStream in Doctor.java - Add explicit parentheses in Shell.countRouteFiles() - Add unit tests for Doctor command (7 tests) - Add unit tests for Run --example and --example-list (5 tests) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
CAMEL-23236
Claude Code on behalf of Claus Ibsen
Replaces #22211 with a clean rebase and review feedback addressed.
Summary
Improve the beginner UX for Camel JBang by adding several features that help new users get started quickly:
inittemplate picker: Whencamel initis run without arguments in a TTY, presents a numbered menu to pick category (Routes, Kamelets, Pipes), template, and filenamerun --example: Bundled example routes (timer-log, cron-log, rest-api) that users can run immediately without creating filesdoctorcommand: Diagnostic command that checks environment setup (Java version, Maven artifact resolution, Docker/Podman, ports, disk space)Changes from original PR (#22211)
Review feedback addressed
Run.java(importSuggestSimilarHelper) andDoctor.java(importOutputStream)Shell.countRouteFiles()for readabilityDoctorTest(7 tests),RunTest(5 new tests for--exampleand--example-list)Test plan
PluginGetTestpasses with correct plugin count (no KIT)camel-jbang-coretest suite passes (388 tests, 0 failures)DoctorTest— 7 tests covering banner, Java check, Camel version, ports, disk spaceRunTest— 5 new tests for--example-list,--exampleflag parsing, unknown example rejectioncamel init(no args, in TTY) shows interactive template pickercamel run --example timer-logruns bundled examplecamel doctorreports environment diagnostics with correct Java 17 handlingcamel shellshows context-aware banner🤖 Generated with Claude Code