2025-12-14 03:59:24 +00:00
|
|
|
|
---
|
2026-01-08 23:06:56 +01:00
|
|
|
|
summary: "First-run onboarding flow for Clawdbot (macOS app)"
|
2025-12-14 03:59:24 +00:00
|
|
|
|
read_when:
|
|
|
|
|
|
- Designing the macOS onboarding assistant
|
2026-01-08 23:06:56 +01:00
|
|
|
|
- Implementing auth or identity setup
|
2025-12-14 03:59:24 +00:00
|
|
|
|
---
|
|
|
|
|
|
# Onboarding (macOS app)
|
|
|
|
|
|
|
2026-01-08 23:06:56 +01:00
|
|
|
|
This doc describes the **current** first‑run onboarding flow. The goal is a
|
|
|
|
|
|
smooth “day 0” experience: pick where the Gateway runs, connect auth, run the
|
|
|
|
|
|
wizard, and let the agent bootstrap itself.
|
2025-12-14 03:59:24 +00:00
|
|
|
|
|
2026-01-08 23:06:56 +01:00
|
|
|
|
## Page order (current)
|
2025-12-14 03:59:24 +00:00
|
|
|
|
|
2026-01-08 23:06:56 +01:00
|
|
|
|
1) Welcome + security notice
|
|
|
|
|
|
2) **Gateway selection** (Local / Remote / Configure later)
|
|
|
|
|
|
3) **Auth (Anthropic OAuth)** — local only
|
|
|
|
|
|
4) **Setup Wizard** (Gateway‑driven)
|
|
|
|
|
|
5) **Permissions** (TCC prompts)
|
2026-01-11 10:15:37 +00:00
|
|
|
|
6) **CLI** (optional)
|
2026-01-08 23:06:56 +01:00
|
|
|
|
7) **Onboarding chat** (dedicated session)
|
|
|
|
|
|
8) Ready
|
2025-12-14 03:59:24 +00:00
|
|
|
|
|
|
|
|
|
|
## 1) Local vs Remote
|
|
|
|
|
|
|
2026-01-08 23:06:56 +01:00
|
|
|
|
Where does the **Gateway** run?
|
2025-12-14 03:59:24 +00:00
|
|
|
|
|
2026-01-08 23:06:56 +01:00
|
|
|
|
- **Local (this Mac):** onboarding can run OAuth flows and write credentials
|
|
|
|
|
|
locally.
|
|
|
|
|
|
- **Remote (over SSH/Tailnet):** onboarding does **not** run OAuth locally;
|
|
|
|
|
|
credentials must exist on the gateway host.
|
|
|
|
|
|
- **Configure later:** skip setup and leave the app unconfigured.
|
2025-12-14 03:59:24 +00:00
|
|
|
|
|
2026-01-02 13:46:48 +01:00
|
|
|
|
Gateway auth tip:
|
2026-01-11 01:51:07 +01:00
|
|
|
|
- The wizard now generates a **token** even for loopback, so local WS clients must authenticate.
|
|
|
|
|
|
- If you disable auth, any local process can connect; use that only on fully trusted machines.
|
2026-01-08 23:06:56 +01:00
|
|
|
|
- Use a **token** for multi‑machine access or non‑loopback binds.
|
2026-01-02 13:46:48 +01:00
|
|
|
|
|
2026-01-08 23:06:56 +01:00
|
|
|
|
## 2) Local-only auth (Anthropic OAuth)
|
2025-12-19 19:20:57 +01:00
|
|
|
|
|
2026-01-08 23:06:56 +01:00
|
|
|
|
The macOS app supports Anthropic OAuth (Claude Pro/Max). The flow:
|
2025-12-14 03:59:24 +00:00
|
|
|
|
|
2026-01-08 23:06:56 +01:00
|
|
|
|
- Opens the browser for OAuth (PKCE)
|
|
|
|
|
|
- Asks the user to paste the `code#state` value
|
|
|
|
|
|
- Writes credentials to `~/.clawdbot/credentials/oauth.json`
|
2025-12-14 03:59:24 +00:00
|
|
|
|
|
2026-01-08 23:06:56 +01:00
|
|
|
|
Other providers (OpenAI, custom APIs) are configured via environment variables
|
|
|
|
|
|
or config files for now.
|
2026-01-08 09:29:29 +01:00
|
|
|
|
|
2026-01-08 23:06:56 +01:00
|
|
|
|
## 3) Setup Wizard (Gateway‑driven)
|
2025-12-14 03:59:24 +00:00
|
|
|
|
|
2026-01-08 23:06:56 +01:00
|
|
|
|
The app can run the same setup wizard as the CLI. This keeps onboarding in sync
|
|
|
|
|
|
with Gateway‑side behavior and avoids duplicating logic in SwiftUI.
|
2025-12-14 03:59:24 +00:00
|
|
|
|
|
2026-01-08 23:06:56 +01:00
|
|
|
|
## 4) Permissions
|
2026-01-05 06:46:20 +01:00
|
|
|
|
|
2026-01-08 23:06:56 +01:00
|
|
|
|
Onboarding requests TCC permissions needed for:
|
2026-01-05 06:46:20 +01:00
|
|
|
|
|
2026-01-08 23:06:56 +01:00
|
|
|
|
- Notifications
|
|
|
|
|
|
- Accessibility
|
|
|
|
|
|
- Screen Recording
|
|
|
|
|
|
- Microphone / Speech Recognition
|
|
|
|
|
|
- Automation (AppleScript)
|
2025-12-14 03:59:24 +00:00
|
|
|
|
|
2026-01-11 10:15:37 +00:00
|
|
|
|
## 5) CLI (optional)
|
2025-12-14 03:59:24 +00:00
|
|
|
|
|
2026-01-11 10:15:37 +00:00
|
|
|
|
The app can install the global `clawdbot` CLI via npm/pnpm/bun so terminal
|
|
|
|
|
|
workflows and launchd tasks work out of the box.
|
2025-12-14 03:59:24 +00:00
|
|
|
|
|
2026-01-08 23:06:56 +01:00
|
|
|
|
## 6) Onboarding chat (dedicated session)
|
2025-12-14 03:59:24 +00:00
|
|
|
|
|
2026-01-08 23:06:56 +01:00
|
|
|
|
After setup, the app opens a dedicated onboarding chat session so the agent can
|
|
|
|
|
|
introduce itself and guide next steps. This keeps first‑run guidance separate
|
|
|
|
|
|
from your normal conversation.
|
2025-12-14 03:59:24 +00:00
|
|
|
|
|
2026-01-08 23:06:56 +01:00
|
|
|
|
## Agent bootstrap ritual
|
2025-12-22 21:02:48 +00:00
|
|
|
|
|
2026-01-08 23:06:56 +01:00
|
|
|
|
On the first agent run, Clawdbot bootstraps a workspace (default `~/clawd`):
|
2025-12-22 21:02:48 +00:00
|
|
|
|
|
2026-01-08 23:06:56 +01:00
|
|
|
|
- Seeds `AGENTS.md`, `BOOTSTRAP.md`, `IDENTITY.md`, `USER.md`
|
|
|
|
|
|
- Runs a short Q&A ritual (one question at a time)
|
|
|
|
|
|
- Writes identity + preferences to `IDENTITY.md`, `USER.md`, `SOUL.md`
|
|
|
|
|
|
- Removes `BOOTSTRAP.md` when finished so it only runs once
|
2025-12-20 16:51:53 +00:00
|
|
|
|
|
2026-01-08 23:06:56 +01:00
|
|
|
|
## Optional: Gmail hooks (manual)
|
2025-12-20 16:51:53 +00:00
|
|
|
|
|
2026-01-08 23:06:56 +01:00
|
|
|
|
Gmail Pub/Sub setup is currently a manual step. Use:
|
2026-01-03 13:18:17 +00:00
|
|
|
|
|
|
|
|
|
|
```bash
|
2026-01-04 14:32:47 +00:00
|
|
|
|
clawdbot hooks gmail setup --account you@gmail.com
|
2026-01-03 13:18:17 +00:00
|
|
|
|
```
|
|
|
|
|
|
|
2026-01-08 23:06:56 +01:00
|
|
|
|
See [/automation/gmail-pubsub](/automation/gmail-pubsub) for details.
|
2025-12-19 18:12:01 +00:00
|
|
|
|
|
2026-01-08 23:06:56 +01:00
|
|
|
|
## Remote mode notes
|
2026-01-01 14:21:22 +00:00
|
|
|
|
|
2026-01-08 23:06:56 +01:00
|
|
|
|
When the Gateway runs on another machine, credentials and workspace files live
|
|
|
|
|
|
**on that host**. If you need OAuth in remote mode, create:
|
2026-01-07 01:21:36 +01:00
|
|
|
|
|
2026-01-08 23:06:56 +01:00
|
|
|
|
- `~/.clawdbot/credentials/oauth.json`
|
|
|
|
|
|
- `~/.clawdbot/agents/<agentId>/agent/auth-profiles.json`
|
2026-01-07 01:21:36 +01:00
|
|
|
|
|
2026-01-08 23:06:56 +01:00
|
|
|
|
on the gateway host.
|