runner
TDLRunner
Bases: BaseModel
Low-level subprocess runner for the tdl CLI binary.
Methods:
| Name | Description |
|---|---|
run |
Execute a tdl command. |
global_options
global_options: GlobalOptions = Field(
default_factory=GlobalOptions, description="Global options for all tdl commands."
)
run
run(
command: list[str],
options: _BaseOptions | None = None,
positional_args: list[str] | None = None,
timeout: float | None = None,
) -> TDLResult
Execute a tdl command.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
list[str]
|
The command path, e.g. ["chat", "ls"] or ["download"]. |
required |
|
_BaseOptions | None
|
Command-specific options model. |
None
|
|
list[str] | None
|
Positional arguments appended after flags. |
None
|
|
float | None
|
Timeout in seconds for the command. |
None
|
Returns:
| Type | Description |
|---|---|
TDLResult
|
TDLResult with stdout, stderr, and return_code. |
Raises:
| Type | Description |
|---|---|
TDLNotFoundError
|
If the tdl binary is not found. |
TDLCommandError
|
If tdl exits with a non-zero return code. |
TDLTimeoutError
|
If the command exceeds the timeout. |