CLI — Common Workflows
Step-by-step walkthroughs of the most common tasks the DM team does using lm.
1. Morning Queue Review
Start the day by checking everything that needs attention across all tenants.
$ lm
lm › /status --all
Leadmetrics Platform Status — Apr 4, 2026 09:00
──────────────────────────────────────────────────────────────────
Tenant Pending Running Blocked Cost (Apr)
────────────────────────────────────────────────────────────────
Acme Corp 5 0 0 $28.40
Globex Corporation 12 ⚠ 2 1 ⚠ $142.10
Initech Corp 0 0 0 $4.20
lm › /use globex
Switching to Globex Corporation
lm [Globex Corp] › /queue
Pending Approvals (12)
───────────────────────────────────────────────────────────────
ID Type Title Risk Age
─────────────────────────────────────────────────────────────
A-1250 blog_post "B2B Lead Generation 2026" low 18h ⚠
A-1251 blog_post "LinkedIn Strategy Guide" low 18h ⚠
A-1252 blog_post "Email Outreach Templates" low 17h
A-1253 social_post LinkedIn — Week 14 medium 8h
...
lm [Globex Corp] › /bulk-approve --filter "type=blog_post AND risk=low AND age>12h"
Preview — 3 items will be approved:
A-1250 "B2B Lead Generation 2026" low · 18h
A-1251 "LinkedIn Strategy Guide" low · 18h
A-1252 "Email Outreach Templates" low · 17h
Confirm? [y/N] › y
✅ Approved 3 items. Next activities queued: Publish to WordPress (×3)2. Reviewing a Specific Blog Post
When you want to read the content before approving.
lm [Acme Corp] › /queue --type blog_post
Pending blog posts (2)
A-1234 "Why Local SEO Matters" low 2h
A-1235 "Emergency Plumber Brisbane" low 2h
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…
[End of output · 1,240 words · $0.018]
lm [Acme Corp] › /approve A-1234
✅ Approved. Publish to WordPress queued.
lm [Acme Corp] › /reject A-1235 --reason "Tone is too formal — Clearflow uses a friendly, plain-English voice. Rewrite."
↩ Rejected. Re-queued to blog-writer with feedback.3. Onboarding a New Tenant
Run the full setup chain for a new client from the CLI.
lm › /use new-client
⚠ Tenant 'new-client' not found.
Did you mean: newclient-corp, new-horizons?
Select › new-horizons
lm [New Horizons] › /run client-researcher
Starting client-researcher for New Horizons…
Activity ID: A-1260
🤖 Client Researcher
────────────────────────────────────────────────────────
Reading domain: newhorizons.com.au
Crawling homepage, about, services, blog…
Extracting: products, USPs, team, tone of voice…
▌ Analysing competitive landscape…
✅ Complete. Research notes saved.
Next: /run competitor-researcher
lm [New Horizons] › /run competitor-researcher
✅ Complete. 3 competitors analysed.
Next: /run context-file-writer
lm [New Horizons] › /run context-file-writer
✅ Client Context File generated and saved to skills.
Action required: Review and approve the context file in Dashboard → Settings → Skills
before running strategy.Once the context file is approved in the Dashboard:
lm [New Horizons] › /run strategy-writer
✅ Strategy document generated.
Action required: Review and approve in Dashboard → Strategy
lm [New Horizons] › /run deliverable-planner
✅ Deliverable plan created — 6 goals, 8 deliverable types.
Monthly volumes set. Activity Planner will auto-run at month start.4. Investigating a Failed Agent
lm [Acme Corp] › /agents
Agent Queue Status — Acme Corp
backlink-researcher 0 running 0 queued 1 failed ⚠
lm [Acme Corp] › /queue --status failed
Failed (1)
A-1239 backlink-researcher "Find backlink prospects" failed 45m ago
lm [Acme Corp] › /log A-1239
Activity Log: A-1239 — backlink-researcher
─────────────────────────────────────────────────────────────
11:30:12 queued Enqueued to agent__backlink-researcher
11:30:13 started Adapter: ClaudeAdapter
11:30:14 skill_loaded client-context-file.md
11:30:15 tool_call ahrefs.getDomainBacklinks → HTTP 429 Rate limited
11:30:15 tool_call ahrefs.getDomainBacklinks → HTTP 429 Rate limited (retry 1)
11:30:20 tool_call ahrefs.getDomainBacklinks → HTTP 429 Rate limited (retry 2)
11:30:20 failed Error: Ahrefs API rate limit exceeded after 3 retries
lm [Acme Corp] › /retry A-1239 --reason "Ahrefs rate limit should have cleared by now"
✅ Retrying. New activity ID: A-1262.5. Uploading Documents to a Tenant’s Knowledge Base
lm [Acme Corp] › /kb
Client Documents 3 files 29 chunks ✅
Website Content 142 pages 1,840 chunks ✅
lm [Acme Corp] › /upload ~/Downloads/new-brand-brief.pdf
Uploading new-brand-brief.pdf to Client Documents (Acme Corp)…
✅ Uploaded (1.8 MB)
⏳ Indexing… ████████████████████ 100% 22 chunks
✅ Indexed — 22 new chunks in client_documents
lm [Acme Corp] › /kb
Client Documents 4 files 51 chunks ✅ ← updated6. Running a Monthly Report
lm [Acme Corp] › /run report-writer
Starting report-writer for Acme Corp (April 2026)…
Activity ID: A-1270
🤖 Report Writer
────────────────────────────────────────────────────────
Pulling GA4 data… ✅
Pulling Google Search Console… ✅
Pulling published content (12 blogs, 16 social posts)… ✅
Pulling backlink status… ✅
Comparing vs March 2026 goals…
▌ Writing executive summary…
✅ Report generated — 2,840 words.
Action required: Review in Dashboard → Reports, then approve to send to client.7. Checking Costs at End of Month
lm › /cost --all --period 2026-04
Cost Usage — All Tenants — April 2026
─────────────────────────────────────────────────────────────────
Tenant Runs Total Cost Credits Used Budget
───────────────────────────────────────────────────────────────
Acme Corp 42 $38.40 420 / 1,000 ✅
Globex Corporation 128 $182.10 910 / 1,000 ⚠ 91%
Initech Corp 6 $4.20 42 / 500 ✅
Umbrella Ltd 310 $420.80 840 / 2,000 ✅
───────────────────────────────────────────────────────────────
Platform total 486 $645.50
lm › /use globex
lm [Globex Corp] › /cost --breakdown agent
blog-writer 64 runs $128.00
keyword-researcher 12 runs $24.10
report-writer 4 runs $16.00
social-post-writer 48 runs $14.008. Impersonating a Tenant to Debug an Issue
lm › /impersonate acme-corp
⚠ Impersonating Acme Corp. All actions logged.
Confirm? [y/N] › y
✅ Impersonation token active for 30 minutes.
Token copied to clipboard.
Paste into https://app.leadmetrics.io to access as Acme Corp admin.
[/end-impersonate to revoke early]
lm [Acme Corp — impersonating] › /queue
[Viewing Acme Corp queue as impersonator — all actions logged]
...
lm [Acme Corp — impersonating] › /end-impersonate
✅ Impersonation revoked. Session logged.9. Non-Interactive Use (Scripting)
# Morning standup snapshot — all tenants, JSON output
lm --run "/status --all" --output json > morning-status.json
# Approve all low-risk blog posts across all tenants (CI script)
lm --run "/bulk-approve --filter 'risk=low AND type=blog_post' --all" --quiet
# Upload multiple files to a tenant's knowledge base
for f in ./client-docs/*.pdf; do
lm --run "/upload $f --tenant acme-corp --dataset client-documents" --quiet
done
# Check platform health in a monitoring script
lm --run "/status" --output json | jq '.infrastructure | .[] | select(.status != "healthy")'10. Natural Language Shorthand (Examples)
lm › what's overdue across all clients?
lm › approve everything from Acme that's low risk
lm › show me what globex's keyword researcher found last run
lm › how much have we spent on blog writing this month?
lm › run site audit for initech
lm › which agents failed today?
lm › upload this file to acme's knowledge base
[then drag a file into the terminal — triggers /upload with the path]