Skip to Content
Apps & PortalsCLICLI — Command Reference

CLI — Command Reference

All slash commands available in lm. Natural language queries are also supported — see Workflows for examples.

Notation:

  • <required> — required argument
  • [optional] — optional argument
  • --flag — option flag

Meta Commands

/help [command]

Show help. With no argument, lists all commands. With a command name, shows detailed help for that command.

lm › /help Available commands: Tenant context /use, /tenants Queue & approvals /queue, /approve, /reject, /bulk-approve Agents /run, /agents, /pause, /resume, /retry Activity /activity, /stream, /log Knowledge base /upload, /kb Platform /status, /cost, /impersonate Session /clear, /history, /reconnect, /exit Type /help <command> for details.

/clear

Clear the terminal screen. Alias: Ctrl+L.

/history

Show recent command history for this session.

lm › /history 1 /use acme-corp 2 /queue --status pending 3 /approve 1234 4 /run blog-writer --brief "Why local SEO matters"

/reconnect

Re-establish the API connection (useful after network drops).

/exit

Exit the REPL. Alias: Ctrl+D, /quit.


Tenant Context

/use <tenant>

Set the active tenant for the session. All subsequent tenant-scoped commands operate against this tenant without needing --tenant.

lm › /use acme Switching to tenant: Acme Corp (acme-corp) Plan: Pro · Assigned reviewer: moble@leadmetrics.io lm [Acme Corp] ›

Accepts tenant name (fuzzy match), refId, or tenantId. If the query matches multiple tenants, a picker is shown:

lm › /use corp Multiple matches: 1. Acme Corp (acme-corp) 2. Globex Corporation (globex-corp) 3. Initech Corp (initech-corp) Select › _

/tenants [--search <query>] [--plan <tier>]

List all tenants assigned to you. Super admins see all tenants.

lm › /tenants Tenant Plan Pending Blocked Agents ────────────────────────────────────────────────────────── Acme Corp Pro 3 0 2 running Globex Corporation Agency 7 ⚠ 1 ⚠ 0 Initech Corp Free 0 0 0 Umbrella Ltd Enterprise 1 0 4 running 4 tenants · 11 pending approvals · 1 blocked lm ›

Flags:

  • --search <query> — filter by name
  • --plan <free|pro|agency|enterprise> — filter by plan
  • --output table|json — output format

Queue & Approvals

/queue [--status <status>] [--type <type>] [--tenant <id>]

Show the activity queue. Defaults to the current tenant if set; shows all assigned tenants if no context.

lm [Acme Corp] › /queue Pending Approvals (3) ──────────────────────────────────────────────────────────────────── ID Type Title Risk Age ────────────────────────────────────────────────────────────────── A-1234 blog_post "Why Local SEO Matters" low 2h A-1235 blog_post "Top 5 Plumbing Tips" low 2h A-1236 social_post LinkedIn — Q2 Campaign medium 45m Running (2) ──────────────────────────────────────────────────────────────────── A-1237 keyword-researcher Finding keyword clusters… 3m A-1238 blog-writer Writing "GBP Optimisation"… 8m lm [Acme Corp] ›

Flags:

  • --status pending|running|blocked|completed|failed — filter by status
  • --type blog_post|social_post|backlink|report|... — filter by content type
  • --agent <role> — filter by agent role
  • --all — show across all tenants (ignores current context)
  • --limit <n> — number of results (default 20)

/approve <id> [--note <text>]

Approve an activity or approval item. The id can be the short ID shown in /queue.

lm [Acme Corp] › /approve A-1234 Approving: "Why Local SEO Matters" (blog_post) ✅ Approved. Next activity queued: Publish to WordPress. lm [Acme Corp] ›

With a note:

lm [Acme Corp] › /approve A-1234 --note "Great post, approved as-is"

/reject <id> --reason <text>

Reject an activity. The reason is appended to the agent’s prompt on retry.

lm [Acme Corp] › /reject A-1235 --reason "Title too generic — needs a local angle for Brisbane" Rejecting: "Top 5 Plumbing Tips" (blog_post) Reason: "Title too generic — needs a local angle for Brisbane" ↩ Rejected. Activity re-queued to blog-writer with feedback. lm [Acme Corp] ›

/bulk-approve [--filter <expr>] [--dry-run]

Approve multiple items at once. Always shows a preview before executing.

lm [Acme Corp] › /bulk-approve --filter "type=blog_post AND risk=low" Preview — 2 items will be approved: A-1234 "Why Local SEO Matters" low risk A-1235 "Top 5 Plumbing Tips" low risk Confirm? [y/N] › y ✅ Approved 2 items. lm [Acme Corp] ›

With --dry-run, shows the preview without executing.

Filter expressions support: type, risk, agent, age (e.g. age>2h).


Agents

/run <agent> [options]

Trigger an agent task. The agent name is the queue name without the agent__ prefix.

lm [Acme Corp] › /run keyword-researcher Starting keyword-researcher for Acme Corp… Activity ID: A-1240 🤖 Keyword Researcher — Finding keyword clusters ───────────────────────────────────────────────── Analysing domain: acmecorp.com.au Industry: Plumbing (local service) Pulling seed keywords from GSC… ✅ 32 terms Expanding via SEMrush… ✅ ▌ Clustering keywords into topic groups… [Ctrl+C to detach — activity continues in background]

Flags (vary by agent — --help lists agent-specific flags):

  • --brief <text> — pass a brief/context string to the agent
  • --input <file> — read input from a JSON file
  • --no-stream — don’t stream output; show a spinner and result when done
  • --detach — enqueue and return immediately (do not stream)
  • --dry-run — validate inputs and show the resolved prompt without running

Available agents (matches queue names):

AgentAlias
client-researcherresearch
competitor-researchercompetitors
context-file-writercontext
strategy-writerstrategy
deliverable-plannerplan
keyword-researcherkeywords
content-brief-writerbrief
blog-writerblog
social-post-writersocial
gbp-post-writergbp
email-writeremail
site-auditoraudit
backlink-researcherbacklinks
report-writerreport
anomaly-detectoranomaly

/agents [--tenant <id>] [--all]

Show agent queue status across all relevant queues.

lm [Acme Corp] › /agents Agent Queue Status — Acme Corp ──────────────────────────────────────────────────────── Queue Running Queued Failed Paused ────────────────────────────────────────────────────────── keyword-researcher 1 0 0 0 blog-writer 1 3 0 0 social-post-writer 0 1 0 0 backlink-researcher 0 0 1 ⚠ 0 1 queue has failures. Use /log A-1239 to investigate.

Flags:

  • --all — show across all assigned tenants
  • --failed — show only queues with failures

/pause <activityId>

Pause a running activity. The agent is signalled to stop after its current step.

lm [Acme Corp] › /pause A-1237 ⏸ Pausing keyword-researcher (A-1237)… Activity will pause after current step completes. Use /resume A-1237 to continue.

/resume <activityId>

Resume a paused activity.

/retry <activityId> [--reason <text>]

Re-trigger a failed activity. Optionally append a note to the prompt.

lm [Acme Corp] › /retry A-1239 --reason "Previous run timed out — retry with extended timeout" ↩ Retrying backlink-researcher (A-1239) New activity ID: A-1241

Activity Detail

/activity <id>

Show full detail for an activity.

lm [Acme Corp] › /activity A-1234 Activity: A-1234 ────────────────────────────────────────────────────────── Type: blog_post Title: "Why Local SEO Matters" Agent: blog-writer Status: awaiting_approval Created: Apr 3, 2026 14:22 Completed: Apr 3, 2026 14:26 (3m 40s) Model: claude-sonnet-4-6 Tokens: 4,812 in / 1,204 out Cost: $0.018 Risk: low Output preview (first 300 chars): ───────────────────────────────────────────────────── "Local SEO is no longer optional for businesses that rely on customers in a specific area. For a plumbing business in Brisbane, ranking on page one for 'plumber near me' can be the difference between…" [/stream A-1234 to view full output] [/approve A-1234] [/reject A-1234]

/stream <activityId>

Stream the full output of an activity — either live (if still running) or replay (if completed).

lm [Acme Corp] › /stream A-1234 Streaming output — "Why Local SEO Matters" ──────────────────────────────────────────────────────── # Why Local SEO Matters for Brisbane Plumbers Local SEO is no longer optional for businesses that rely on customers in a specific area. For a plumbing business in Brisbane, ranking on page one for "plumber near me" can be the difference between a full job schedule and an empty van. ## What Is Local SEO? [End of output — 1,204 tokens · $0.018] [/approve A-1234] [/reject A-1234]

Press Ctrl+C to stop streaming (does not cancel the activity if it’s still running).

/log <activityId>

Show the structured event log for an activity — steps taken, tool calls made, errors encountered.

lm [Acme Corp] › /log A-1234 Activity Log: A-1234 — blog-writer ────────────────────────────────────────────────────────── 14:22:04 queued Enqueued to agent__blog-writer 14:22:05 started Adapter: ClaudeAdapter 14:22:05 skill_loaded client-context-file.md (2,340 chars) 14:22:06 skill_loaded seo-brief.md (890 chars) 14:22:06 rag_query "local SEO for small businesses" → 3 chunks (0.91, 0.87, 0.82) 14:22:06 rag_query "past blog posts about SEO" → 3 chunks (0.89, 0.85) 14:22:07 llm_start claude-sonnet-4-6 · 4,812 input tokens 14:25:44 llm_complete 1,204 output tokens · $0.018 · 3m 37s 14:25:44 validation ✅ word_count: 1,240 (min 800) · sections: 5/5 ✅ 14:25:44 completed status → awaiting_approval

Knowledge Base

/upload <file> [--dataset <name>] [--tenant <id>]

Upload a document to a tenant’s knowledge base dataset.

lm [Acme Corp] › /upload ./brand-guidelines.pdf --dataset client-documents Uploading brand-guidelines.pdf to Client Documents (Acme Corp)… ✅ Uploaded (2.1 MB) ⏳ Indexing… ██████████░░░░░░ 62% 18 / 29 chunks embedded ✅ Indexed — 29 chunks added to client_documents collection.

Supported file types: pdf, docx, txt, md, csv.

Flags:

  • --dataset <name> — dataset slug: client-documents, website-content, published-content, competitor-research. Defaults to client-documents.
  • --no-parse — upload without triggering ingestion immediately
  • --parser docling|builtin — parser engine (default: builtin)

/kb [--tenant <id>]

Show knowledge base status for the current tenant.

lm [Acme Corp] › /kb Knowledge Base — Acme Corp ──────────────────────────────────────────────────────────────────── Dataset Files Chunks Last Updated Status ────────────────────────────────────────────────────────────────── Client Documents 3 29 Apr 3, 2026 ✅ indexed Website Content 142p 1,840 Apr 1, 2026 ✅ weekly crawl Published Content 24 312 Apr 3, 2026 ✅ auto Competitor Research 18 210 Mar 28, 2026 ✅ local Total: 2,391 chunks · 4.2 MB in Qdrant

Platform & Monitoring

/status [--all]

Platform-wide overview. Defaults to current tenant; --all shows across all assigned tenants.

lm › /status --all Leadmetrics Platform Status — Apr 3, 2026 14:30 ──────────────────────────────────────────────────────────────────── Tenant Pending Running Blocked This Month Cost ────────────────────────────────────────────────────────────────── Acme Corp 3 2 0 $28.40 Globex Corporation 7 ⚠ 0 1 ⚠ $142.10 Initech Corp 0 0 0 $4.20 Umbrella Ltd 1 4 0 $310.80 Platform totals · 11 pending · 6 running · 1 blocked · $485.50/month Infrastructure API ✅ healthy (45ms) PostgreSQL ✅ healthy MongoDB ✅ healthy Redis ✅ healthy BullMQ: 12 active workers Qdrant ✅ healthy Ollama ✅ healthy gemma3:4b loaded

/cost [--tenant <id>] [--period <month>]

Show cost breakdown for a tenant or the platform.

lm [Acme Corp] › /cost Cost Usage — Acme Corp — April 2026 ──────────────────────────────────────────────────────────────────── Agent Runs Avg Cost Total ────────────────────────────────────────────────────────────────── blog-writer 8 $0.018 $0.144 keyword-researcher 2 $0.045 $0.090 strategy-writer 1 $0.70 $0.700 social-post-writer 12 $0.008 $0.096 ────────────────────────────────────────────────────────────────── Total $1.030 Credit balance: 840 / 1,000 credits · Resets May 1, 2026

Flags:

  • --period <YYYY-MM> — specific month (default: current)
  • --breakdown tokens|runs|agent — sort/group by
  • --all — platform-wide totals

/impersonate <tenant>

Get a short-lived impersonation token that lets you act as the tenant admin. All actions taken during impersonation are flagged in the audit log.

lm › /impersonate acme-corp ⚠ You are about to impersonate Acme Corp (acme-corp). All actions will be logged with your identity as the actor. Confirm? [y/N] › y ✅ Impersonation active for 30 minutes. Opening DM Portal as Acme Corp admin… [Token copied to clipboard — paste into browser for web access] [Use /end-impersonate to stop]

/end-impersonate

Revoke the active impersonation token.


Natural Language Queries

Any input that does not start with / is treated as a natural language query. The CLI sends it to the API’s NL query endpoint which interprets intent and either:

  1. Executes a known action (with confirmation for destructive operations)
  2. Returns information as a formatted response
  3. Asks a clarifying question if intent is ambiguous
lm [Acme Corp] › show me all pending approvals older than 4 hours Searching pending approvals for Acme Corp older than 4h… 3 results: ──────────────────────────────────────────────────────── A-1230 blog_post "GBP Optimisation Guide" 6h ago low risk A-1231 blog_post "Emergency Plumber Tips" 5h ago low risk A-1232 social_post Facebook — April Week 1 4h ago medium risk [/approve A-1230] [/approve A-1231] [/approve A-1232] Or: /bulk-approve --filter "age>4h"
lm › which tenants haven't had any activity this week? Checking activity across all assigned tenants (Apr 1–3)… 2 tenants with no activity: Initech Corp — last activity: Mar 28 Vandelay Industries — last activity: Mar 15 ⚠ (2+ weeks)
lm [Acme Corp] › run keyword research Starting keyword-researcher for Acme Corp. Using client context file as input. Confirm? [y/N] › y → /run keyword-researcher [executing]

Destructive operations always require explicit confirmation, even when triggered via natural language.


Output Formats

Most commands support --output to change display format:

/tenants --output table # default — coloured ASCII table /tenants --output json # raw JSON (for piping / scripting) /tenants --output csv # CSV (for spreadsheets) /queue --output minimal # compact single-line per item

© 2026 Leadmetrics — Internal use only