|
|
@@ -49,20 +49,13 @@ Save `screen_dir` and `state_dir` from the response. Tell user to open the URL.
|
|
|
|
|
|
**Launching the server by platform:**
|
|
|
|
|
|
-**Claude Code (macOS / Linux):**
|
|
|
+**Claude Code:**
|
|
|
```bash
|
|
|
-# Default mode works — the script backgrounds the server itself
|
|
|
+# Default mode works — the script backgrounds the server itself.
|
|
|
scripts/start-server.sh --project-dir /path/to/project
|
|
|
```
|
|
|
|
|
|
-**Claude Code (Windows):**
|
|
|
-```bash
|
|
|
-# Windows auto-detects and uses foreground mode, which blocks the tool call.
|
|
|
-# Use run_in_background: true on the Bash tool call so the server survives
|
|
|
-# across conversation turns.
|
|
|
-scripts/start-server.sh --project-dir /path/to/project
|
|
|
-```
|
|
|
-When calling this via the Bash tool, set `run_in_background: true`. Then read `$STATE_DIR/server-info` on the next turn to get the URL and port.
|
|
|
+On Windows, the script auto-detects and switches to foreground mode (which blocks the tool call). Use `run_in_background: true` on the Bash tool call so the server survives across conversation turns, then read `$STATE_DIR/server-info` on the next turn to get the URL and port.
|
|
|
|
|
|
**Codex:**
|
|
|
```bash
|
|
|
@@ -78,6 +71,14 @@ scripts/start-server.sh --project-dir /path/to/project
|
|
|
scripts/start-server.sh --project-dir /path/to/project --foreground
|
|
|
```
|
|
|
|
|
|
+**Copilot CLI:**
|
|
|
+```bash
|
|
|
+# Use --foreground and start the server via the bash tool with mode: "async"
|
|
|
+# so the process survives across turns. Capture the returned shellId for
|
|
|
+# read_bash / stop_bash if you need to interact with it later.
|
|
|
+scripts/start-server.sh --project-dir /path/to/project --foreground
|
|
|
+```
|
|
|
+
|
|
|
**Other environments:** The server must keep running in the background across conversation turns. If your environment reaps detached processes, use `--foreground` and launch the command with your platform's background execution mechanism.
|
|
|
|
|
|
If the URL is unreachable from your browser (common in remote/containerized setups), bind a non-loopback host:
|
|
|
@@ -97,7 +98,7 @@ Use `--url-host` to control what hostname is printed in the returned URL JSON.
|
|
|
- Before each write, check that `$STATE_DIR/server-info` exists. If it doesn't (or `$STATE_DIR/server-stopped` exists), the server has shut down — restart it with `start-server.sh` before continuing. The server auto-exits after 30 minutes of inactivity.
|
|
|
- Use semantic filenames: `platform.html`, `visual-style.html`, `layout.html`
|
|
|
- **Never reuse filenames** — each screen gets a fresh file
|
|
|
- - Use Write tool — **never use cat/heredoc** (dumps noise into terminal)
|
|
|
+ - Use your file-creation tool — **never use cat/heredoc** (dumps noise into terminal)
|
|
|
- Server automatically serves the newest file
|
|
|
|
|
|
2. **Tell user what to expect and end your turn:**
|