Skip to content

Open-source Grok Bot alternative with a virtual machine that bots can use

Docs: explain Windows shared terminal time limits

skygunner5915d555905f
diff --git a/apps/docs/content/docs/computers/lend-to-your-server.mdx b/apps/docs/content/docs/computers/lend-to-your-server.mdx
index 915bdfef67..4fd2ea0b86 100644
--- a/apps/docs/content/docs/computers/lend-to-your-server.mdx
+++ b/apps/docs/content/docs/computers/lend-to-your-server.mdx
@@ -59,6 +59,29 @@ use your computer; one a routine, a webhook or another bot started is told why i
A bot does not need its **Works on** set to anything for this: it reaches your computer through its shared-computer
tools, whatever its Works on is. Ask it in plain words: "open Notepad on my PC".
+### Time-limit a terminal command on Windows
+
+With terminal access enabled, a bot can use `list_shared_computers` to find the PC, then call `shared_computer`
+with `action: "run_command"`. Set `timeout_seconds` to `30` for a 30-second limit. The timeout accepts whole seconds
+from 1 to 900 and defaults to 120 on current versions of the app and server.
+
+For example, run a Python test from the shared project folder with this tool input. Replace `<computer ID>` with the
+ID returned by `list_shared_computers`.
+
+```json
+{
+ "computer_id": "<computer ID>",
+ "action": "run_command",
+ "command": "python -m unittest; exit $LASTEXITCODE",
+ "timeout_seconds": 30
+}
+```
+
+`exit $LASTEXITCODE` passes Python's exit code through PowerShell. The result combines standard output and standard
+error in `output`, up to 256 KB. At the time limit, MausBot asks Windows to stop the command and its current process
+tree. The tool returns an error result with `exitCode: null`, a `stopped` explanation and the output captured so far.
+Detached jobs and children whose parent has already exited can outlive that stop.
+
## Turn it off
- Turn the switch off, in any of the places above. It stops at once.