Package org.jline.shell
Clean shell API for building interactive command-line applications with JLine.
This package provides the core abstractions for commands, command groups, command dispatching, pipelines, and job management.
Architecture
jline-terminal ^ jline-reader ^ jline-shell (this module) ^ jline-console
Core Types
Command- a single executable commandCommandGroup- a named group of commandsCommandDispatcher- resolves and executes commandsCommandSession- execution context (terminal, I/O, variables)Shell- the REPL loopPipeline- parsed pipeline of commandsJob- job control
Quick Start
Shell shell = Shell.builder()
.prompt("myapp> ")
.groups(myGroup)
.build();
shell.run();
- Since:
- 4.0
-
Interface Summary Interface Description AliasManager Manages command aliases for the shell.Command Represents a single executable command in the shell.CommandDispatcher Central dispatcher that aggregatesCommandGroups and handles command resolution, execution, and completion.CommandGroup A named group ofCommands for organization and discovery.Job Represents a job in the shell's job control system.JobListener Listener for job status changes.JobManager Manages jobs in the shell's job control system.LineExpander Expands variables and other expressions in a command line before parsing.Pipeline Represents a pipeline of commands connected by operators such as pipes, redirections, and conditional connectors.Pipeline.Stage A single stage in a pipeline, consisting of a command line and the operator that follows it.ScriptRunner Executes a script file line by line through aCommandDispatcher. -
Class Summary Class Description ArgumentDescription Describes a command argument with a name and optional description.CommandDescription Describes a command for help display and widget integration.CommandDescription.Builder Builder forCommandDescriptioninstances.CommandLine Represents a parsed command line with its components.CommandSession Encapsulates the execution context for a command, including the terminal, I/O streams, session variables, working directory, and job state.PipelineBuilder Fluent builder for constructingPipelineinstances programmatically.Shell An interactive shell that runs a read-eval-print loop (REPL) using aCommandDispatcherfor command execution.ShellBuilder Builder for creatingShellinstances. -
Enum Summary Enum Description CommandLine.Type The type of description that should be displayed.Job.Status Job lifecycle status.Pipeline.Operator Operators that connect commands in a pipeline. -
Exception Summary Exception Description ExitShellException This exception is thrown by commands (e.g.UnknownCommandException This exception is thrown by anCommandDispatcherwhen it failed to find a requested command.