You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (Jira)" <ji...@apache.org> on 2026/04/19 08:53:00 UTC
[jira] [Updated] (CAMEL-23226) Improve Camel JBang CLI user experience
[ https://issues.apache.org/jira/browse/CAMEL-23226?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Claus Ibsen updated CAMEL-23226:
--------------------------------
Fix Version/s: 4.x
> Improve Camel JBang CLI user experience
> ---------------------------------------
>
> Key: CAMEL-23226
> URL: https://issues.apache.org/jira/browse/CAMEL-23226
> Project: Camel
> Issue Type: Improvement
> Components: camel-jbang
> Reporter: Guillaume Nodet
> Assignee: Guillaume Nodet
> Priority: Major
> Fix For: 4.x
>
>
> This is an umbrella issue to track improvements to the Camel JBang CLI user experience.
> After an in-depth investigation of the camel-jbang module, several areas for improvement were identified:
> h3. 1. Fix exit codes for validation errors (High Impact)
> Many commands return 0 (success) when validation fails instead of returning a non-zero exit code. This breaks scripting and CI/CD usage. Examples include CamelSendAction (invalid header format returns 0), process lookup failures returning 0, and RuntimeExceptions thrown instead of proper error codes.
> h3. 2. Standardize error output to printErr() (Medium Impact)
> Three different error reporting patterns are used inconsistently:
> - {{printer().printErr()}} (correct, formatted, stderr)
> - {{printer().println("ERROR: ...")}} (wrong stream, manual prefix)
> - {{throw new RuntimeException(e)}} (stack trace dumped, poor UX)
> All user-facing errors should use the {{Printer.printErr()}} abstraction.
> h3. 3. Migrate Shell to JLine 4 Shell API (High Impact)
> Camel JBang already depends on JLine 4.0.7 but the Shell command still uses the old JLine 3 pattern (picocli-shell-jline3 bridge, manual REPL loop, ~90 lines of boilerplate). JLine 4 provides a new {{Shell.builder()}} API with {{PicocliCommandRegistry}} that reduces this to ~15 lines and adds:
> - Pipeline support (pipe command output)
> - Alias management
> - Job control (background jobs with &, fg, bg, jobs)
> - Script support (source command)
> - Variable support (set, unset, export)
> - Built-in history, help, and command highlighting
> h3. 4. Additional improvements to consider
> - *NO_COLOR and CI environment detection*: Detect CI and NO_COLOR env vars to auto-disable colors and interactive prompts
> - *Option grouping*: Use picocli @ArgGroup to organize the 60+ run command options into logical groups
> - *Progress indicators*: Add feedback for long-running operations (export, dependency resolution)
> - *Consistent output format*: Support json/output across all commands producing tabular output
> - *Tab completion expansion*: Add completion candidates for component names, running process names, etc.
> - *camel init list*: Make templates discoverable
> - *camel export dry-run*: Preview export without writing files
> - *Confirmation for destructive operations*: clean-dir should prompt for confirmation
--
This message was sent by Atlassian Jira
(v8.20.10#820010)