Learn Domains CLI
Use Learn Domains CLI when you want your coding agent to pull website priorities directly into your workflow. It can read Mission Briefs, list opportunities, check credits, and create content drafts. Costly actions still use your Learn Domains credits. The CLI cannot publish content for you.
Who it is for
Operators who already work in a terminal or coding agent and want website growth priorities without leaving that flow. The CLI is a thin client over the Learn Domains REST API.
Access policy
Generate your first Mission Brief before creating a token. Trial accounts may use read scopes only; write scopes unlock on a paid plan. Costly CLI commands (mission-brief generate, analyst ask, content drafts) consume Mission Fuel credits and are blocked on trial.
Create an API token
- 1Sign in at app.learn.domains.
- 2Open Settings → Manage API tokens.
- 3Name the token, choose scopes, and optionally pin it to one website.
- 4Copy the token immediately. It is shown once.
Install and login
The CLI package lives in the Learn Domains repo as @learndomains/cli. It is in beta for active accounts while npm publishing is finalized.
- From the repo: cd packages/learn-domains-cli && npm install && npm run build && npm link
- Or set LEARN_DOMAINS_TOKEN and LEARN_DOMAINS_API_BASE for one-off scripts
- learn-domains login: validates via /api/v1/me and saves ~/.config/learn-domains/config.json
Common commands
- learn-domains whoami
- learn-domains websites list
- learn-domains credits balance
- learn-domains mission-brief latest --website yourdomain.com
- learn-domains mission-brief generate --website yourdomain.com --yes
- learn-domains opportunities list --website yourdomain.com --limit 10
- learn-domains opportunities list --website yourdomain.com --type decay
- learn-domains growth-orders track --website yourdomain.com --opportunity <uuid>
- learn-domains status --website yourdomain.com
- learn-domains analyst ask --website yourdomain.com "What should I fix next?"
- learn-domains content drafts list --website yourdomain.com
- learn-domains content drafts create --website yourdomain.com --topic "Comparison page"
- learn-domains knowledge import-github --website yourdomain.com
- learn-domains knowledge bulk --website yourdomain.com --dir ./vault
- learn-domains knowledge sync init
- learn-domains knowledge sync run
- learn-domains knowledge import-drive --website yourdomain.com --folder <id>
- learn-domains knowledge import-slack --website yourdomain.com --channel <id>
- learn-domains signal status --website yourdomain.com
- learn-domains signal journeys --website yourdomain.com
- learn-domains signal sessions --website yourdomain.com
- learn-domains signal session --website yourdomain.com --session <id>
- learn-domains signal track goal --website yourdomain.com --name signup
- learn-domains signal track revenue --website yourdomain.com --amount 99 --order-id ord_123
JSON mode and agent workflows
Pass --json on any command for compact JSON output. This is the preferred mode for Cursor, Claude Code, and Codex so your agent can parse priorities without scraping terminal text.
Security: tokens are hashed server-side. Revoke a token instantly from Settings. Scope tokens narrowly. Website-scoped tokens cannot access other sites.
Use with Cursor
In Cursor, add your API token via `learn-domains login` or `LEARN_DOMAINS_TOKEN`. Then ask your agent to run `learn-domains mission-brief latest --website yourdomain.com --json` and paste the result into your task list.
Use with Claude Code
Claude Code can run the same commands in your repo terminal. Prefer `--json` so the agent parses priorities without scraping formatted text.
Use with Codex
Point Codex at the CLI docs and your saved token. Start with read-only commands (whoami, websites list, credits balance) before costly actions.
What the CLI cannot do
- Publish content for you
- Bypass signup, billing, or plan limits
- Replace the Learn Domains web app for account setup
- Run expensive AI work without credits
Credits and publishing
Mission Brief generation, AI Analyst questions, and content draft creation use your Learn Domains credits through the same reservation pipeline as the web app. The CLI creates drafts only. Publishing always requires manual review in Learn Domains.