Files
openclaw/docs/start/onboarding.md

103 lines
3.1 KiB
Markdown
Raw Normal View History

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** firstrun 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** (Gatewaydriven)
5) **Permissions** (TCC prompts)
6) **CLI helper** (optional)
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
Gateway auth tip:
2026-01-08 23:06:56 +01:00
- If you only use Clawdbot locally (loopback), auth can be **Off**.
- Use a **token** for multimachine access or nonloopback binds.
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 (Gatewaydriven)
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 Gatewayside 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-08 23:06:56 +01:00
## 5) CLI helper (optional)
2025-12-14 03:59:24 +00:00
2026-01-08 23:06:56 +01:00
The app can symlink the bundled `clawdbot` CLI into `/usr/local/bin` and
`/opt/homebrew/bin` so terminal workflows 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 firstrun 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
2026-01-08 23:06:56 +01:00
On the first agent run, Clawdbot bootstraps a workspace (default `~/clawd`):
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
2026-01-08 23:06:56 +01:00
## Optional: Gmail hooks (manual)
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.
2026-01-08 23:06:56 +01:00
## Remote mode notes
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-08 23:06:56 +01:00
- `~/.clawdbot/credentials/oauth.json`
- `~/.clawdbot/agents/<agentId>/agent/auth-profiles.json`
2026-01-08 23:06:56 +01:00
on the gateway host.