LocalCommandRegistry class
An extensible registry of local : commands.
Third-party packages register custom LocalCommands to extend the interactive experience. The built-in set is installed by LocalCommandRegistry.withDefaults.
- Available extensions
Constructors
- LocalCommandRegistry()
- Creates an empty registry.
- LocalCommandRegistry.withDefaults()
-
Creates a registry pre-populated with the browser-safe built-in commands
(
:help,:info,:tree,:tunnel, …).factory - LocalCommandRegistry.withLocalDefaults()
-
Creates a registry with the subset of built-ins that need no Hub
connection, for local mode (
omnyshell local).factory
Properties
-
commands
→ List<
LocalCommand> -
The registered commands (de-duplicated, sorted by name).
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
addAiCommand(
{String? home, bool color = false}) → void -
Available on LocalCommandRegistry, provided by the AiCommands extension
-
addAiCommand(
{required AiConfig config, required Client httpClient, AgentStyle style = const AgentStyle(), void onModeChanged(AgentMode mode)?, void onLanguageChanged(String? language)?}) → void -
Available on LocalCommandRegistry, provided by the AiWebCommands extension
Registers a live:aicommand usingconfigandhttpClient. -
addFileTransferCommands(
) → void -
Available on LocalCommandRegistry, provided by the FileTransferCommands extension
Adds:download,:uploadand:driveto this registry. -
addIdeCommand(
) → void -
Available on LocalCommandRegistry, provided by the IdeCommands extension
Adds the:idecommand (alias:edit) to this registry. -
dispose(
) → Future< void> - Disposes every registered command (de-duplicated), releasing resources such as open HTTP clients/sockets so they cannot keep the process alive after the interactive session ends. Errors from individual commands are ignored so one failure does not block the rest.
-
handle(
String line, LocalCommandContext context) → Future< bool> -
Handles a local-command
line, returningtrueif a command ran. -
isLocalCommand(
String line) → bool -
Whether
lineis a local command (begins with:). -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
register(
LocalCommand command) → void -
Registers
commandunder its name and aliases. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited