> For the complete documentation index, see [llms.txt](https://www.openclawbook.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.openclawbook.xyz/en/ch02-getting-started/2.2-onboarding-wizard.md). Agents can also search and read this documentation through its [MCP server](https://www.openclawbook.xyz/~gitbook/mcp).

# 2.2 Onboarding Wizard

> **Generated by**: Claude Opus 4.6 (initial draft) / Claude Opus 5 (`v2026.3.9` revision) **Token usage**: Input \~140,000 tokens, Output \~10,000 tokens (total for this chapter) **Source baseline**: `v2026.3.9` (`v2026.3.8-170-g665f67726`)

***

OpenClaw provides an interactive Onboarding Wizard to help users complete initial configuration. You can start it with a single command:

```bash
openclaw onboard --install-daemon
```

This is the officially recommended configuration path — much safer than manually editing `openclaw.json`, because the wizard automatically handles many easy-to-miss details.

## 2.2.1 Source Code Entry Point for `openclaw onboard` Command

The wizard's source code entry point is located in `src/wizard/onboarding.ts`. Let's start with the imports at the top of the file to understand the modules involved in this wizard:

```typescript
// src/wizard/onboarding.ts (key imports)
import { ensureAuthProfileStore } from "../agents/auth-profiles.js";
import { listChannelPlugins } from "../channels/plugins/index.js";
import { promptAuthChoiceGrouped } from "../commands/auth-choice-prompt.js";
import { applyAuthChoice } from "../commands/auth-choice.js";
import { applyPrimaryModel, promptDefaultModel } from "../commands/model-picker.js";
import { setupChannels } from "../commands/onboard-channels.js";
import { setupInternalHooks } from "../commands/onboard-hooks.js";
import { setupSkills } from "../commands/onboard-skills.js";
import { configureGatewayForOnboarding } from "./onboarding.gateway-config.js";
import { finalizeOnboardingWizard } from "./onboarding.finalize.js";
```

From the import relationships, we can infer the wizard's functional modules:

* **Auth Configuration**: `auth-profiles.js`, `auth-choice-prompt.js`, `auth-choice.js`
* **Model Selection**: `model-picker.js`
* **Channel Configuration**: `onboard-channels.js`
* **Hook Setup**: `onboard-hooks.js`
* **Skill Installation**: `onboard-skills.js`
* **Gateway Configuration**: `onboarding.gateway-config.js`
* **Final Confirmation**: `onboarding.finalize.js`

## 2.2.2 Wizard Workflow

The wizard guides users through configuration in the following order:

### Step One: Security Warning Acknowledgment

The wizard first displays a security warning and requires users to explicitly acknowledge understanding the risks. This code reflects OpenClaw's emphasis on security:

```typescript
// src/wizard/onboarding.ts
async function requireRiskAcknowledgement(params) {
  if (params.opts.acceptRisk === true) return;

  await params.prompter.note(
    [
      "Security warning — please read.",
      "",
      "OpenClaw is a hobby project and still in beta.",
      "This bot can read files and run actions if tools are enabled.",
      "A bad prompt can trick it into doing unsafe things.",
      // ...
      "Run regularly:",
      "openclaw security audit --deep",
      "openclaw security audit --fix",
    ].join("\n"),
    "Security",
  );
}
```

### Step Two: Gateway Configuration

Configure the Gateway's binding address, port, and authentication method. By default, it binds to `127.0.0.1:18789` (accessible only from the local machine). If users need remote access, the wizard will guide them to configure Tailscale or password authentication.

### Step Three: Model Selection (Auth + Model)

This is the most critical step in the wizard. OpenClaw supports multiple model providers, each with different authentication methods:

* **Anthropic**: Recommended to use Claude Pro/Max subscription OAuth, or API Key
* **OpenAI**: Supports ChatGPT/Codex subscription OAuth, or API Key
* **Other providers**: OpenRouter, Google Gemini, local models (Ollama), etc.

The wizard calls `promptAuthChoiceGrouped()` to display a grouped authentication options menu, then uses `applyAuthChoice()` to write the selection to the configuration. Model selection is completed through `promptDefaultModel()`, allowing users to choose a default model from the configured providers.

### Step Four: Channel Connection

`setupChannels()` guides users to connect to messaging platforms:

* WhatsApp: Scan QR code to connect (via Baileys library)
* Telegram: Enter Bot Token
* Discord: Enter Bot Token
* Slack: Enter Bot Token + App Token
* Signal: Configure signal-cli
* Other channels: Configure as needed

### Step Five: Skill Installation

`setupSkills()` lets users select built-in skills to install. OpenClaw has 52 built-in skills, and the wizard displays a recommended skill list.

### Step Six: Final Confirmation and Daemon Installation

`finalizeOnboardingWizard()` completes the configuration write. If the user specified `--install-daemon`, it will also install the system daemon (detailed in the next section).

## 2.2.3 Interactive Prompts Implementation: Clack Prompts Library

The wizard's interactive prompts use the **Clack** library (`@clack/prompts`). Clack is a modern CLI prompt library that provides beautiful terminal UI components.

OpenClaw provides an abstraction layer over Clack, defined in `src/wizard/prompts.ts` and `src/wizard/clack-prompter.ts`. The `WizardPrompter` interface defines all the interactive capabilities the wizard needs:

```typescript
// src/wizard/prompts.ts (simplified illustration)
export interface WizardPrompter {
  note(message: string, title?: string): Promise<void>;
  confirm(options: { message: string; initialValue?: boolean }): Promise<boolean>;
  select<T>(options: {
    message: string;
    options: Array<{ label: string; value: T; hint?: string }>;
  }): Promise<T>;
  text(options: { message: string; placeholder?: string }): Promise<string>;
  // ...
}
```

This abstraction layer allows the wizard to run in different environments — using Clack to render beautiful UI in the terminal, and a mock implementation can be injected for testing.

`WizardCancelledError` is a dedicated error type thrown when users press Ctrl+C to cancel the wizard, ensuring the wizard can exit gracefully without crashing.

## Configuration File Output

After the wizard completes, it generates configuration files in the `~/.openclaw/` directory:

```
~/.openclaw/
├── openclaw.json          # Main configuration (JSON5 format)
├── credentials/           # Channel credentials
│   └── whatsapp/          # WhatsApp session data
├── workspace/             # Workspace
│   ├── AGENTS.md
│   ├── SOUL.md
│   └── TOOLS.md
└── agents/
    └── main/
        ├── sessions/
        │   └── sessions.json
        └── models.json
```

A typical minimal configuration `openclaw.json`:

```json5
{
  agent: {
    model: "anthropic/claude-opus-4-6",
  },
}
```

This seemingly simple configuration is backed by a complex default value system (`src/config/defaults.ts`) that fills in all unspecified configuration items. We'll analyze the configuration system in depth in Chapter 31.
