Skip to content

CAMEL-23226: Migrate Shell to JLine 4 Shell API#22161

Closed
gnodet wants to merge 2 commits intomainfrom
CAMEL-23226-jline4-shell
Closed

CAMEL-23226: Migrate Shell to JLine 4 Shell API#22161
gnodet wants to merge 2 commits intomainfrom
CAMEL-23226-jline4-shell

Conversation

@gnodet
Copy link
Contributor

@gnodet gnodet commented Mar 21, 2026

JIRA: CAMEL-23226

Summary

Migrate the Camel JBang shell command from the old picocli-shell-jline3 bridge pattern to the new JLine 4 Shell builder API.

  • Replace ~90 lines of manual REPL boilerplate with JLine 4's Shell.builder() fluent API
  • Switch from picocli-shell-jline3 to jline-picocli (JLine 4's native picocli integration)
  • Add built-in PosixCommandGroup and InteractiveCommandGroup for POSIX utilities (ls, cat, grep, etc.) and interactive commands
  • Enable history, help, script, and variable commands via the Shell builder
  • Retain camel> prompt, history file at ~/.camel-jbang-history, tab completion with 50 max candidates

Test plan

  • Verify camel shell launches interactive shell with camel> prompt
  • Tab completion works for camel commands
  • History persistence works across sessions
  • Ctrl-C / Ctrl-D exits cleanly

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions github-actions bot added the dsl label Mar 21, 2026
@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.

Add PosixCommandGroup (cd, ls, grep, cat, head, tail, etc.),
InteractiveCommandGroup (nano, less, ttop), and enable
script/variable commands for a richer shell experience.

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

@gnodet
Copy link
Contributor Author

gnodet commented Mar 23, 2026

Claude Code on behalf of Guillaume Nodet

Closing — superseded by #22170 which includes all changes from this PR plus additional enhancements.

@gnodet gnodet closed this Mar 23, 2026
@gnodet gnodet deleted the CAMEL-23226-jline4-shell branch March 23, 2026 09:51
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.

2 participants