Skip to content

CAMEL-23226: Enhance Shell with rich prompt, banner, and auto-suggestions#22170

Open
gnodet wants to merge 6 commits intomainfrom
CAMEL-23226-shell-improvements
Open

CAMEL-23226: Enhance Shell with rich prompt, banner, and auto-suggestions#22170
gnodet wants to merge 6 commits intomainfrom
CAMEL-23226-shell-improvements

Conversation

@gnodet
Copy link
Contributor

@gnodet gnodet commented Mar 21, 2026

JIRA: CAMEL-23226

Summary

Builds on top of PR #22166 (Shell alias persistence) to add visual and UX enhancements to the JLine 4 shell:

  • Rich prompt: Shows Camel version with colors — camel in Camel orange (RGB), version in green: camel 4.19.0>
  • Welcome banner: Prints Apache Camel JBang Shell v4.19.0 with styled colors on startup, plus help hint
  • Right-side prompt: Shows abbreviated current working directory (~/work/my-project) in dim text
  • Fish-style auto-suggestions: Enables JLine's AutosuggestionWidgets for ghost-text history suggestions (press right-arrow to accept)
  • NO_COLOR support: All color output respects NO_COLOR / FORCE_COLOR environment variables per https://no-color.org/

Uses JLine's AttributedStringBuilder with foregroundRgb() for true-color terminal support. No Jansi dependency needed.

Test plan

  • Run camel shell and verify colored prompt with version number
  • Verify welcome banner appears on startup
  • Verify right-side prompt shows current directory
  • Type a previously-entered command prefix and verify auto-suggestion ghost text appears
  • Set NO_COLOR=1 and verify all output is plain text
  • Verify exit and Ctrl-C still quit cleanly

@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.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 21, 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]

gnodet and others added 5 commits March 23, 2026 11:28
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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>
…port

- Add DefaultAliasManager with persistence at ~/.camel-jbang-aliases
  for persistent alias/unalias commands
- Add init script support via ~/.camel-jbang-init file
- Remove scriptCommands(true) which requires a scriptRunner to function

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ions

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
JLine 4.0.8 includes jline/jline3#1708 which fixes PicocliCommandRegistry
to use picocli's AutoComplete for proper tab completion of options, option
values, positional parameters, and nested subcommands.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@gnodet gnodet force-pushed the CAMEL-23226-shell-improvements branch from f496204 to 43c312b Compare March 23, 2026 10:28
- Restore HELP_COLORS variable for colored help output
- Restore OTHERS_GROUP_NAME and COMPLETION_STYLE_GROUP variables
- Use EnvironmentHelper.isColorEnabled() instead of duplicated logic
- Use ShellBuilder import instead of FQCN where possible
- Add TODO for replacing AutosuggestionWidgets with CommandTailTipWidgets
  (needs ShellBuilder to expose CommandDispatcher in onReaderReady callback)

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

1 participant