system
Class info¶
Classes¶
| Name | Children | Inherits |
|---|---|---|
| EnvCommand slashed.builtin.system Show or set environment variables. |
||
| ExecCommand slashed.builtin.system Execute a system command and capture its output. |
||
| 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¶
System command implementations.
EnvCommand
¶
Bases: SlashedCommand
Show or set environment variables.
Usage
/env [name] [value]
Without arguments: show all environment variables With name: show specific variable With name and value: set variable
Source code in src/slashed/builtin/system.py
execute_command
async
¶
execute_command(
ctx: CommandContext[Any], name: str | None = None, value: str | None = None
) -> None
Manage environment variables.
Source code in src/slashed/builtin/system.py
ExecCommand
¶
Bases: SlashedCommand
Execute a system command and capture its output.
Usage
/exec
Waits for the command and prints its output, without blocking the event loop.
Arguments are passed through unchanged (/exec git -C dir status).
Source code in src/slashed/builtin/system.py
timeout
class-attribute
instance-attribute
¶
Seconds after which the process is killed (None: no limit).
execute_command
async
¶
execute_command(ctx: CommandContext[Any], command: str, *args: str) -> None
Execute system command and wait for it.
Source code in src/slashed/builtin/system.py
get_completer
¶
get_completer() -> PathCompleter
KillCommand
¶
Bases: SlashedCommand
Kill a running process.
Usage
/kill
Kill process by PID or name. Numbers are treated as PIDs, anything else as process name.
Examples:
/kill 1234 # Kill by PID /kill notepad.exe # Kill all processes with this name
Source code in src/slashed/builtin/system.py
execute_command
async
¶
execute_command(ctx: CommandContext[Any], target: str) -> None
Kill a process by PID or name.
Source code in src/slashed/builtin/system.py
ProcessesCommand
¶
Bases: SlashedCommand
List running processes.
Usage
/ps [--filter_by
Shows PID, name, memory usage and status for each process. Optionally filter by process name.
Source code in src/slashed/builtin/system.py
execute_command
async
¶
execute_command(ctx: CommandContext[Any], *, filter_by: str | None = None) -> None
List running processes.
Source code in src/slashed/builtin/system.py
RunCommand
¶
Bases: SlashedCommand
Launch a system command asynchronously.
Usage
/run
The command runs in the background without blocking.
Source code in src/slashed/builtin/system.py
execute_command
async
¶
execute_command(ctx: CommandContext[Any], command: str, *args: str) -> None
Launch system command asynchronously.
Source code in src/slashed/builtin/system.py
get_completer
¶
get_completer() -> PathCompleter
SystemInfoCommand
¶
Bases: SlashedCommand
Show system information.
Usage
/sysinfo
Displays
- OS information
- CPU usage
- Memory usage
- Disk usage
- Network interfaces
Requires
psutil package
Source code in src/slashed/builtin/system.py
execute_command
async
¶
execute_command(ctx: CommandContext[Any]) -> None
Show system information.