feat: add remote gateway client config

This commit is contained in:
Peter Steinberger
2026-01-01 20:10:50 +01:00
parent a72fdf7c26
commit bd7cd33b02
18 changed files with 516 additions and 45 deletions

View File

@@ -524,6 +524,22 @@ Auth and Tailscale:
- `gateway.tailscale.mode: "funnel"` exposes the dashboard publicly; requires auth.
- `gateway.tailscale.resetOnExit` resets Serve/Funnel config on shutdown.
Remote client defaults (CLI):
- `gateway.remote.url` sets the default Gateway WebSocket URL for CLI calls when `gateway.mode = "remote"`.
- `gateway.remote.token` supplies the token for remote calls (leave unset for no auth).
```json5
{
gateway: {
mode: "remote",
remote: {
url: "ws://gateway.tailnet:18789",
token: "your-token"
}
}
}
```
### `hooks` (Gateway webhooks)
Enable a simple HTTP webhook surface on the Gateway HTTP server.

View File

@@ -27,6 +27,24 @@ With the tunnel up:
- `clawdis health` and `clawdis status --deep` now reach the remote gateway via `ws://127.0.0.1:18789`.
- `clawdis gateway {status,health,send,agent,call}` can also target the forwarded URL via `--url` when needed.
## CLI remote defaults
You can persist a remote target so CLI commands use it by default:
```json5
{
gateway: {
mode: "remote",
remote: {
url: "ws://127.0.0.1:18789",
token: "your-token"
}
}
}
```
When the gateway is loopback-only, keep the URL at `ws://127.0.0.1:18789` and open the SSH tunnel first.
## Chat UI over SSH
WebChat no longer uses a separate HTTP port. The SwiftUI chat UI connects directly to the Gateway WebSocket.

View File

@@ -10,7 +10,7 @@ read_when:
Goal: interactive wizards for first-run onboarding **and** ongoing reconfiguration.
Uses `@clack/prompts` for arrow-key selection and step UX.
Scope: **Local gateway only**. Remote mode is **info-only** (no config writes).
Scope: local gateway setup plus **remote gateway client config** (no remote-side installs).
## Entry points
@@ -47,7 +47,7 @@ Reset uses `trash` (never `rm`).
1) **Mode**
- Local (full wizard)
- Remote (info-only; no config writes)
- Remote (configure client connection only)
2) **Model/Auth (local only)**
- Anthropic OAuth (recommended)
@@ -91,15 +91,13 @@ Reset uses `trash` (never `rm`).
- Summary + next steps
- Reminder: iOS/Android/macOS node apps add canvas/camera/screen/system features.
## Remote mode (info-only)
## Remote mode (client config)
- Explain where gateway runs.
- Show required steps on gateway host:
- `clawdis setup`
- `clawdis gateway-daemon ...`
- OAuth file: `~/.clawdis/credentials/oauth.json`
- Workspace: `~/clawd`
- No local config changes.
- Optional Bonjour discovery (macOS: `dns-sd`, Linux: `avahi-browse`)
- Save `gateway.remote.url` (+ optional `gateway.remote.token`)
- Token optional; omit for no-auth gateways
- Provide SSH tunnel hint when the gateway is loopback-only
- No remote installs or daemon changes from this machine
## Config writes
@@ -111,6 +109,7 @@ Wizard writes:
- `skills.entries.<key>.env` / `.apiKey` (if set in skills step)
- `telegram.botToken`, `discord.token`, `signal.*` (if set in providers step)
- `wizard.lastRunAt`, `wizard.lastRunVersion`, `wizard.lastRunCommit`, `wizard.lastRunCommand`, `wizard.lastRunMode`
- `gateway.remote.url`, `gateway.remote.token` (remote mode)
WhatsApp login writes credentials to `~/.clawdis/credentials/creds.json`.