docs: baked a lot of API docs

This commit is contained in:
Zef Hemel
2026-08-06 14:48:21 +02:00
parent 9b4de31ca3
commit 754e8525b9
36 changed files with 4888 additions and 49 deletions
+30 -1
View File
@@ -7,4 +7,33 @@ references:
The Shell API provides functions for running shell commands and interacting with processes.
${spacelua.renderApiDocumentation("shell")}
<!--#lua spacelua.renderApiDocumentation("shell") -->
## shell.run
`shell.run(command, arguments, stdin?)`
Runs a shell command on the server and returns its output.
**Parameters:**
- `command` (`string`) — Executable name.
- `arguments` (`table`) — Command arguments.
- `stdin?` (`string`) — Text supplied on standard input.
**Returns:**
- `table` — stdout, stderr, and numeric exit code.
**Examples:**
```lua
local result = shell.run("ls", {"-l"})
print(result.stdout)
```
```lua
local result = shell.run("cat", {}, "hello")
print(result.stdout)
```
<!--/lua-->