Skip to content

builtin

Class info

Re-exported classes

Class Module Description
EnvCommand slashed.builtin.system Show or set environment variables.
ExecCommand slashed.builtin.system Execute a system command and capture its output.
ExitCommand slashed.builtin.help_cmd Exit the chat session.
HelpCommand slashed.builtin.help_cmd Display help information about commands.
KillCommand slashed.builtin.system Kill a running process.
ProcessesCommand slashed.builtin.system List running processes.
RunCommand slashed.builtin.system Launch a system command asynchronously.
SystemInfoCommand slashed.builtin.system Show system information.

🛈 DocStrings

Built-in commands for Slashed.

get_builtin_commands

get_builtin_commands(*, enable_help: bool = True, enable_exit: bool = True) -> list[BaseCommand]

Get list of built-in commands.

Source code in src/slashed/builtin/__init__.py
def get_builtin_commands(
    *,
    enable_help: bool = True,
    enable_exit: bool = True,
) -> list[BaseCommand]:
    """Get list of built-in commands."""
    commands: list[Any] = []
    if enable_help:
        commands.append(HelpCommand())
    if enable_exit:
        commands.append(ExitCommand())
    return commands

get_system_commands

get_system_commands(
    *,
    enable_exec: bool = True,
    enable_run: bool = True,
    enable_processes: bool = True,
    enable_sysinfo: bool = True,
    enable_kill: bool = True,
    enable_env: bool = True,
) -> list[BaseCommand]

Get system execution commands.

Source code in src/slashed/builtin/__init__.py
def get_system_commands(
    *,
    enable_exec: bool = True,
    enable_run: bool = True,
    enable_processes: bool = True,
    enable_sysinfo: bool = True,
    enable_kill: bool = True,
    enable_env: bool = True,
) -> list[BaseCommand]:
    """Get system execution commands."""
    commands: list[Any] = []
    if enable_exec:
        commands.append(ExecCommand())
    if enable_run:
        commands.append(RunCommand())
    if enable_processes:
        commands.append(ProcessesCommand())
    if enable_sysinfo:
        commands.append(SystemInfoCommand())
    if enable_kill:
        commands.append(KillCommand())
    if enable_env:
        commands.append(EnvCommand())
    return commands