Install & initialize

Create a Molar account, install the CLI, and scaffold your first project with npx molar-agent init.

Install & initialize

This guide gets you from zero to a scaffolded Molar project connected to your workspace.

Prerequisites

  • Node.js 22+ for the npm bootstrap and full CLI
  • A GitHub account (optional now; required for PR gating later)
  • Your app's URL for Cartographer crawl (optional at signup; add anytime)

Step 1 — Create an account

Human signup (default)

  1. Go to app.molar.it and sign up.
  2. Complete onboarding — create a project and optionally enter your app URL.
  3. Invite teammates from Settings → Members.

Agent self-serve (coding agents)

If an AI agent is setting up Molar without a pre-existing account, use Agent self-serve signup. The agent registers via API or molar agent signup, your team receives a 6-digit verification email, and full MCP scopes unlock after verify. If signup returns 503, use human signup + a dashboard PAT instead. Humans still own billing and org settings at app.molar.it.

Step 2 — Install the CLI

npx molar-agent init

molar-agent is the zero-dependency bootstrap: it ships init and task-oriented docs, then delegates other commands when the full molar CLI is installed.

MethodCommand
Bootstrapnpx molar-agent init --json
npmnpm install -g @molar/cli

Verify: molar version and molar doctor.

Note:

molar doctor checks for the Guard runner (@molar/guard-runner / molar-guard binary). Local molar run needs it. Cloud runs from the dashboard do not require a local runner.

Step 3 — Initialize a project

npx molar-agent init --json
# or: molar init [path] --json

Creates:

.molar/
  scenarios/
  config.toml
  .gitignore
.molar.md
.cursorrules
AGENTS.md

Idempotent — existing files are left untouched. Agents should prefer --json ({ ok, created, skipped, next_steps }).

Step 4 — Connect to Molar Cloud

  1. Settings → API Tokens → create a PAT.
  2. Export locally:
export MOLAR_API_URL=https://api.molar.it
export MOLAR_TOKEN=molar_pat_xxxxxxxx

Or molar login (validates GET /api/v1/me and writes ~/.config/molar/config.toml):

molar login --api-url https://api.molar.it --token molar_pat_xxxx --json

Confirm with molar whoami --json or molar agent init --json.

Note:

Agent self-discovery: molar docs --json returns TesterArmy-style task routing. Failures always include error.hint.

Step 5 — Connect your app

  1. Open app.molar.it.
  2. Ensure your Cartographer project has your app URL (set during onboarding or in the Cartographer dashboard).
  3. Use Scouts or MCP to discover flows, then approve them as scenarios under Scenarios.

What's next