Two Install Modes
When you run bash scripts/install.sh, an interactive prompt appears with two options. Both auto-detect Node 22, validate disk space (1GB min), install Playwright, run doctor diagnostics, install a background service, and verify /health.
| # | Mode | Command | Time | Onboarding |
|---|---|---|---|---|
| 1 | Mom Setup (Full) | bash scripts/install.sh | ~4 min | Web wizard opens in browser |
| 2 | Quick Install (CLI) | bash scripts/install.sh --quick | ~2 min | Non-interactive CLI in terminal |
Piped/scripted runs default to Full (backward-compatible). Use --dry-run for pre-flight validation. Port conflicts are auto-remapped. After a Quick install, add the portal anytime: npm run build:web.
Step 1: Install ClawMagic
Option A: One-liner (recommended)
curl -fsSL https://clawmagic.ai/install.sh | bash
Auto-installs Node.js if missing, clones the repo to ~/clawmagic, and runs the full installer. Respects CLAWMAGIC_HOME and CLAWMAGIC_BRANCH env vars.
Option B: Manual clone
git clone https://github.com/clawmagic/clawmagic.git ~/clawmagic cd ~/clawmagic bash scripts/install.sh
Step 2: Choose Install Mode
The interactive prompt appears. Press 1 (or Enter) for Mom Setup, or 2 for Quick Install. Pass --quick to skip the prompt.
The installer runs automatically: installs Node.js 20+ (if needed), npm install, builds packages, installs Playwright Chromium, runs doctor checks, installs the gateway daemon (macOS launchd / Linux systemd), and verifies /health.
Step 3a: Mom Setup (Web Portal Wizard)
After install, the browser opens automatically to http://127.0.0.1:18790/. Everything runs locally on your machine.
- Create a portal password — Minimum 10 characters. Hashed with scrypt. Protects your local portal.
- Security acknowledgement — Confirm you understand ClawMagic can run commands on your computer.
- Choose QuickStart or Advanced — QuickStart takes ~5 min (skips optional steps). Advanced gives full control.
- Connect your AI provider — Add an API key for any supported provider (OpenAI, Anthropic, Google, Mistral, and more), select a model, test the connection. 3-category model recommendations: best for general use, best for coding, most affordable.
- Create your agent — Name, primary goal, autonomy preference (ask-first / balanced / autonomous), top 3 tools.
- Security validation — Confirms auth is set up, approvals are enabled. Three-check gate.
- Plugins & channels (Advanced only) — Activate plugins, set heartbeat interval, connect messaging channels (Slack, Discord, Telegram, WhatsApp), GitHub integration.
- Review & go — Confirm settings, then start your agent. Redirected to coaching chat. Agent is live.
Step 3b: Quick Install (CLI Onboarding)
CLI onboarding runs automatically after the health check passes. No browser needed.
node apps/cli/dist/main.js onboard --non-interactive --accept-risk --flow quickstart
Applies safe defaults headlessly. Summary prints in terminal showing the healthcheck URL, service controls, and a reminder to add the web portal later with npm run build:web.
What the Installer Does (39 Items)
The full onboarding covers 8 phases with 39 verified items. All pass on a clean install.
| Phase | Items | Covers |
|---|---|---|
| 1. Installation | 6 | Install script, npm build, Playwright, doctor checks, daemon, Docker |
| 2. Portal Auth | 2 | Password creation (scrypt), session management |
| 3. Onboarding Wizard | 13 | Security ack, provider key, agent persona, plugins, channels, review |
| 4. Post-Wizard | 2 | Coaching chat, shell completions |
| 5. Config & Env | 4 | .env.example, non-interactive mode, CLI reconfigure, upgrade script |
| 6. Security | 2 | Encrypted credential cache, master key backup |
| 7. UX | 4 | Preloaded prompts, setup status page, model recommendations, hosted install URL |
| 8. Audit Hardening | 6 | Step ordering, validate-before-write, provider verification, model guardrail |
Wizard Steps in Detail
The onboarding wizard walks through these steps in order. QuickStart auto-skips optional steps. Step-jumping is blocked server-side.
| Step | QuickStart | Details |
|---|---|---|
| Security Ack | Required | PromptCard confirms risk understanding. Server validates riskAcknowledged. |
| Flow Choice | Required | QuickStart (~5 min) or Advanced (full control). |
| Welcome | Required | Confirm readiness. Shows estimated time and progress bar. |
| Provider Key + Model | Required | Add API key via Secrets. Test connection. Server verifies key server-side. |
| Agent Persona | Required | Name, primary goal, autonomy pref, top 3 tools. Maps to agent contract. |
| Security Validation | Required | Validates auth, approvals enabled, allow_no_auth disabled. |
| Plugins | Skipped | Free plugins pre-checked. Paid toggleable. Server auto-activates free. |
| Heartbeat | Skipped | 6 interval options (5m to daily). Sets autonomous check-in frequency. |
| Google Brain | Skipped | Auto-skipped Phase 1. Users configure from Settings later. |
| Channels | Skipped | Slack, Discord, Telegram, WhatsApp. Inline setup with server-side validation. |
| GitHub | Skipped | Connect/Skip. Server validates PAT before connected mode. |
| Contract Review | Required | Review agent contract. Edit before commit. Confirm all settings. |
| Completion | Required | Applies config, creates backup cron, summary card, What's Next actions. |
Server Provider Install Methods
These are not shown to end users. Hosting partners use these via their own deployment pipeline. See /docs/deployment.
| Method | Command | Use Case |
|---|---|---|
| Pre-built Docker | docker pull ghcr.io/clawmagic/clawmagic:latest | Server providers, production |
| Docker (Local Build) | docker compose up --build -d | Custom images, development |
| npm Global | npm install -g clawmagic | CLI power users, CI/CD |
| Pre-built Tarball | Download from GitHub Releases | Offline/airgapped environments |
| Prebuilt Flag | bash scripts/install.sh --prebuilt | One-command prebuilt setup |
CLI Commands
# Non-interactive onboarding (used by Quick Install) clawmagic onboard --non-interactive --accept-risk --flow quickstart # Full non-interactive with all options clawmagic onboard --non-interactive --accept-risk \ --provider openai --model gpt-4o \ --agent-name "My Agent" --autonomy balanced \ --goal "Help me with daily tasks" \ --heartbeat-interval 30m --json # Reconfigure specific sections clawmagic configure --section provider,security,plugins # Doctor checks with auto-fix clawmagic doctor --fix # Shell completions (bash/zsh/fish) clawmagic completions install # Upgrade to latest version bash scripts/upgrade.sh
Security During Onboarding
- Portal password: Min 10 chars, scrypt hash, rate-limited (10/min), strength meter in web UI.
- Credential cache: Runtime cache encrypted with AES-256-GCM. No plaintext on disk.
- Master key backup: SHA-256 fingerprint (16 hex chars) shown on setup status page. Encrypted backup with user passphrase available.
- Step ordering enforced: Server validates step sequence. 409 on out-of-order attempts. No step-jumping.
- Provider validation: Server-side provider test via
aiFetchModels(). PersistsproviderVerifiedAtwith 10-min recency window. - Model guardrail: On completion, if model is empty, sets to best-effort default. Provider key existence is a hard gate.
After Onboarding
- Coaching chat: Auto-redirect with 8s countdown. "Start Working on My Goal" suggests first task.
- Setup status page:
/app/setup-statuswith animated progress bar, full checklist, READY/ACTION REQUIRED badges, and Fix buttons. - Re-run onboarding: Available from setup status page. Resets wizard state.
- Add portal after Quick install:
npm run build:web, then openhttp://127.0.0.1:18790/.
Environment Variables
The .env.example file contains 33+ CLAWMAGIC_* variables across 8 sections. All are commented with types and defaults. See /docs/environment for the full reference.
# Key environment variables CLAWMAGIC_HOME=~/clawmagic # install directory CLAWMAGIC_ALLOW_NO_AUTH=true # localhost dev only CLAWMAGIC_BRANCH=main # git branch for install