Optional
args?: string[]The arguments required by the command.
Optional
callback?: Awaitable<void>A callback function that is called when execution of the command is complete.
Optional
description?: stringThe description of the command.
The handler function that is called when the command is executed.
The command arguments
The command being executed.
The name of the command.
Optional
onThe error handler function that is called when an error occurs during command execution.
The command arguments
The command being executed.
Optional
usage?: stringThe usage instructions for the command.
Optional
waitSpecifies whether the command should wait for execution to complete before returning.
The Command
interface defines the properties and methods required for a command in a terminal.
const command: Command = {
name: 'ls',
description: 'List files and directories',
usage: 'ls [options] [path]',
args: ['options', 'path'],
waitForExecution: true,
handler: (args, command) => {
// Command execution logic
},
onError: (args, command) => {
// Error handling logic
},
};
Generated using TypeDoc
Represents a command that can be executed in a terminal.