Quickstart
Install the mog CLI, authenticate, and install your first skill in under 5 minutes.
Fastest path — one command from the terminal
In your project directory, run:
npx mogmd@latest setup
The CLI starts device login (same flow as mog auth): it prints a short code and https://mog.md/device, opens your browser when possible, then waits until you approve. After you’re signed in, it saves credentials, installs mogmd globally when you used npx, and creates mog.lock.json (same as mog init). Then try:
mog search "react testing"
Shortcut — token from the website
If you’re already signed in on mog.md, open Install CLI on the home page and copy the command — it includes a one-time --token:
npx mogmd@latest setup --token "mog_setup_…"
This skips the device-code step and exchanges the token immediately.
CI, agents, and non-interactive use
Set MOG_TOKEN (from the dashboard or a prior login) and run setup in JSON mode so the CLI never waits for a browser:
export MOG_TOKEN="…"
npx mogmd@latest setup --json
Without MOG_TOKEN, mog setup --json exits with an error — use a token or run setup interactively without --json.
Manual install (global CLI)
Prefer a global install or you’re not using npx for setup:
Step 1 — Install the CLI
mog is published to npm:
npm install -g mogmd
Verify:
mog --version
# 0.1.6
Step 2 — Authenticate
mog uses a device code flow (RFC 8628) so you can sign in from any machine with a browser, even when the CLI runs headless.
mog auth
The CLI prints a short code and URL:
To authenticate, visit:
https://mog.md/device
Enter code: XKCD-7Z4B
Waiting for approval...
Open mog.md/device (the CLI tries to open it automatically), sign in with GitHub or Google, and enter the code. The CLI polls until approved:
✓ Authenticated!
✓ You are now signed in to mog.md
Your token is stored in:
- macOS / Linux:
~/.config/mog/credentials.json - Windows:
%USERPROFILE%\.config\mog\credentials.json
If MOG_TOKEN is set, the CLI uses it for API calls (and mog auth --status reports it). Env takes precedence over the file.
Check auth any time:
mog auth --status
Step 3 — Initialize the project
mog init
Step 1 — Search for a skill
mog search "react testing"
# 3 results
# acme/react-testing-skill@1.2.0 Free
# skill cursor, claude-code by Acme Corp ✓
# Comprehensive React testing patterns including RTL, Vitest, and MSW
# Install with: mog install <vendor>/<package>
Filter your search:
# Only free packages
mog search --free
# Only skills compatible with Cursor
mog search --target cursor
# Sort by newest
mog search "testing" --sort recent
# Get JSON output (for scripting)
mog search "testing" --json
Step 2 — Install a package
Free packages
mog install acme/react-testing-skill
The CLI auto-detects your environment by looking for marker directories (.cursor/, .claude/, .windsurf/, .gemini/, .codex/, .openclaw/) and installs to the right location. Use --target to override.
Wire the skill into your editor
Installing drops files into the right directory, but your AI assistant still needs to be told about them. Add --wire to handle this automatically:
mog install acme/react-testing-skill --wire
For Cursor, this creates a .cursor/rules/{slug}.mdc rule that points to the skill. For Claude Code, it appends a reference to AGENTS.md. Without --wire, the CLI prints the exact content you'd need to add manually.
Paid packages
For paid packages, purchase first then install:
# Buy first
mog buy acme/premium-skill
# Then install
mog install acme/premium-skill
Or combine both steps with --auto-buy:
mog install acme/premium-skill --auto-buy
Add --max-price <cents> to set a ceiling. If the package costs more, the purchase is blocked and an approval URL is returned:
mog install acme/expensive-skill --auto-buy --max-price 500
Preflight (dry run)
See exactly what would happen before committing:
mog install acme/react-testing-skill --preflight
# Preflight plan:
# Package: acme/react-testing-skill@1.2.0
# Target: cursor
# Install to: /my-project/.cursor/skills/react-testing-skill/
# SHA-256: a3f8...
# Price: Free
Step 3 — Manage installed packages
List installed
mog ls
# 2 installed packages
# acme/react-testing-skill@1.2.0 cursor
# /my-project/.cursor/skills/react-testing-skill/
# Installed: 1/15/2026
Update
# Check for updates (dry run)
mog update --dry-run
# Apply updates (patch and minor only by default)
mog update
Uninstall
mog uninstall acme/react-testing-skill
Alternative path: Agent network quickstart
If you're building an agent that needs to discover businesses and call tools programmatically — rather than installing packages — use the @mog/sdk instead of the CLI.
Step 1 — Get a token
Generate an API token from your dashboard with read and purchase scopes, or authenticate via the device code flow and export MOG_TOKEN.
Step 2 — Install the SDK
npm install @mog/sdk
Step 3 — Discover and call a service
import { MogClient } from '@mog/sdk'
const mog = new MogClient({ token: process.env.MOG_TOKEN! })
// Find a verified service that can search flights
const { services } = await mog.discover({
tool: 'search_flights',
verified: true,
sort: 'trusted',
})
// Call a tool directly (metered, deducted from wallet)
const result = await mog.callTool('acme', 'travel-agent', {
tool: 'search_flights',
input: { origin: 'SFO', destination: 'NRT' },
maxCostCents: 10,
})
Step 4 — Open a session for multi-turn conversations
const { session } = await mog.openSession({
vendor: 'acme',
slug: 'travel-agent',
intent: 'book_travel',
context: { destination: 'Tokyo', budgetCents: 150000 },
})
await mog.send(session.id, {
type: 'quote.request',
payload: { dates: '2026-04-01/2026-04-10' },
})
const { messages } = await mog.history(session.id)
See Agent network for the full guide and SDK reference for every method.
Useful commands
mog doctor # check project health and wiring
mog explain acme/my-skill # view package metadata and install paths
mog ls --check-updates # list installed packages and check for updates
Next steps
- Full CLI reference — all commands, flags, and exit codes
- Agent network — discover, message, and pay any business
- SDK reference — TypeScript client for the agent network API
- MCP servers — install and auto-configure MCP server packages
- Spend policies — set up safe autonomous purchasing for agents
- Package format — publish your own skills
- Selling on mog — monetize your work