Skip to content

CAMEL-23224: Switch JBang shell to JLine 4 PicocliCommandRegistry#22184

Closed
gnodet wants to merge 2 commits intomainfrom
Guillaume-Nodet/jbang-improvements
Closed

CAMEL-23224: Switch JBang shell to JLine 4 PicocliCommandRegistry#22184
gnodet wants to merge 2 commits intomainfrom
Guillaume-Nodet/jbang-improvements

Conversation

@gnodet
Copy link
Contributor

@gnodet gnodet commented Mar 23, 2026

Summary

  • Replace picocli-shell-jline3 with JLine 4's built-in jline-picocli module (PicocliCommandRegistry) which provides proper argument completion via picocli's AutoComplete
  • Simplify Shell.java from ~140 lines of manual JLine setup to ~20 lines using JLine 4's Shell.builder() API
  • Bump JLine version to 4.0.8

Before

The camel shell REPL only completed command names — no completion for options, option values, or positional parameters.

After

Full argument completion powered by picocli's AutoComplete.complete(): options, option values, positional parameters, completion candidates, and nested subcommands all complete properly.

Note: This PR overlaps with #22161 and #22170 which also migrate to JLine 4's Shell.builder(). The unique contribution here is the picocli argument completion fix (via jline/jline3#1708, included in JLine 4.0.8). Consider cherry-picking the completion fix into #22170 and closing this PR.

Test plan

  • camel-jbang-core compiles with JLine 4.0.8 release
  • Manual testing of camel shell with tab completion for command arguments

- Replace picocli-shell-jline3 with JLine 4's built-in jline-picocli
  module which provides PicocliCommandRegistry with proper argument
  completion via picocli's AutoComplete
- Simplify Shell.java using JLine 4's Shell.builder() API
- Bump JLine version to 4.0.8-1-SNAPSHOT (pending JLine release)

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.

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

gnodet commented Mar 23, 2026

Claude Code on behalf of Guillaume Nodet

Closing — the completion fix (JLine 4.0.8 bump) has been merged into #22170 which is the superset PR.

@gnodet gnodet closed this Mar 23, 2026
@gnodet gnodet deleted the Guillaume-Nodet/jbang-improvements branch March 23, 2026 09:51
@github-actions
Copy link
Contributor

github-actions bot commented Mar 23, 2026

🧪 CI tested the following changed modules:

  • dsl/camel-jbang/camel-jbang-core
  • parent

ℹ️ Dependent modules were not tested because the total number of affected modules exceeded the threshold (50). Use the test-dependents label to force testing all dependents.

Build reactor — dependencies compiled but only changed modules were tested (4 modules)
  • Camel :: JBang :: Core
  • Camel :: JBang :: Core [jar]
  • Camel :: Parent
  • Camel :: Parent [pom]

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants