Keymap configuration

The inputrc must point to a file available via the classloader or the filesystem.

The inputrc only function bindings and the available functions are:

backward-char

forward-char

next-history

previous-history

backward-delete-char

backward-delete-char

backward-word

end-of-line

beginning-of-line

delete-char

delete-char

complete

accept-line

accept-line

kill-line

backward-word

forward-word

backward-kill-word

Note

Extra functions can be added, however this is done by implementing functions of the Term.d project on which
Vert.x Shell is based, for instance the reverse function
can be implemented and then declared in a META-INF/services/io.termd.core.readline.Function to be loaded by the shell.

Base commands

To find out the available commands you can use the help builtin command:

Verticle commands

verticle-ls: list all deployed verticles

verticle-undeploy: undeploy a verticle

verticle-deploy: deploys a verticle with deployment options as JSON string

verticle-factories: list all known verticle factories

File system commands

ls

cd

pwd

Bus commands

bus-tail: display all incoming messages on an event bus address

bus-send: send a message on the event bus

Net commands

net-ls: list all available net servers, including HTTP servers

Shared data commands

local-map-put

local-map-get

local-map-rm

Various commands

echo

sleep

help

exit

logout

Job control

fg

bg

jobs

Note

this command list should evolve in next releases of Vert.x Shell. Other Vert.x project may provide commands to extend
Vert.x Shell, for instance Dropwizard Metrics.

Extending Vert.x Shell

Vert.x Shell can be extended with custom commands in any of the languages supporting code generation.

A command is created by the CommandBuilder.command method: the command process handler is called
by the shell when the command is executed, this handler can be set with the processHandler
method:

Process events

A command can subscribe to a few process events.

Interrupt event

The interruptHandler is called when the process
is interrupted, this event is fired when the user press Ctrl+C during the execution of a command. This handler can
be used for interrupting commands blocking the CLI and gracefully ending the command process:

When no interrupt handler is registered, pressing Ctrl+C will have no effect on the current process and the event
will be delayed and will likely be handled by the shell, like printing a new line on the console.

Suspend/resume events

The suspendHandler is called when the process
is running and the user press Ctrl+Z, the command is suspended:

the command can receive the suspend event when it has registered an handler for this event

the command will not receive anymore data from the standard input

the shell prompt the user for input

the command can receive interrupts event or end events

The resumeHandler is called when the process
is resumed, usually when the user types fg:

the command can receive the resume event when it has registered an handler for this event

the command will receive again data from the standard input when it has registered an stdin handler

Shell server

The Shell service is a convenient facade for starting a preconfigured shell either programmatically or as a Vert.x service.
When more flexibility is needed, a ShellServer can be used instead of the service.

For instance the shell http term can be configured to use an existing router instead of starting its own http server.

Using a shell server requires explicit configuration but provides full flexiblity, a shell server is setup in a few
steps: