Description
Replace Picocli with Aesh as the CLI framework for the Citrus JBang tool (tools/jbang). This follows the same migration that JBang itself completed, as described in From Picocli to Aesh: How Porting JBang's CLI Made Everything Better.
Motivation
Picocli relies on runtime reflection for command and option discovery, which adds startup overhead — especially under GraalVM native image. Aesh uses compile-time annotation processing to generate command metadata as switch statements, eliminating reflection at startup and classpath scanning.
Key benefits observed in JBang's migration:
- ~5x faster native startup (33ms -> 6ms) and ~2x faster on JDK (228ms -> 109ms)
- Practical tab-completion — fast enough to run per-keypress without perceptible lag
- GraalVM-friendly — no reflection configuration needed for native images
- Zero external dependencies — Aesh relies solely on the JDK
- Alignment with JBang — since Citrus JBang runs on JBang, aligning on the same CLI framework reduces friction
Scope
The tools/jbang module currently uses Picocli 4.7.7 with the following command classes that need porting:
CitrusJBangMain — root command
CitrusCommand — abstract base class (Callable<Integer>)
Init, Inspect, Run, ListTests, Complete — top-level commands
Agent, AgentStart, AgentRun, AgentStop — agent subcommand group
Migration involves:
- Replace
info.picocli:picocli dependency with Aesh
- Port
@Command / @CommandLine.Option / @CommandLine.Parameters annotations to Aesh equivalents (@CommandDefinition, @Option, @Argument)
- Replace
Callable<Integer> pattern with Aesh's command execution model
- Port tab-completion support (
Complete.java currently uses picocli.AutoComplete)
- Update
CitrusJBang.java JBang script directives (//DEPS)
The connectors/citrus-jbang-connector module does not use Picocli directly and should not require changes.
References
Description
Replace Picocli with Aesh as the CLI framework for the Citrus JBang tool (
tools/jbang). This follows the same migration that JBang itself completed, as described in From Picocli to Aesh: How Porting JBang's CLI Made Everything Better.Motivation
Picocli relies on runtime reflection for command and option discovery, which adds startup overhead — especially under GraalVM native image. Aesh uses compile-time annotation processing to generate command metadata as switch statements, eliminating reflection at startup and classpath scanning.
Key benefits observed in JBang's migration:
Scope
The
tools/jbangmodule currently uses Picocli 4.7.7 with the following command classes that need porting:CitrusJBangMain— root commandCitrusCommand— abstract base class (Callable<Integer>)Init,Inspect,Run,ListTests,Complete— top-level commandsAgent,AgentStart,AgentRun,AgentStop— agent subcommand groupMigration involves:
info.picocli:picoclidependency with Aesh@Command/@CommandLine.Option/@CommandLine.Parametersannotations to Aesh equivalents (@CommandDefinition,@Option,@Argument)Callable<Integer>pattern with Aesh's command execution modelComplete.javacurrently usespicocli.AutoComplete)CitrusJBang.javaJBang script directives (//DEPS)The
connectors/citrus-jbang-connectormodule does not use Picocli directly and should not require changes.References