Open Source·AI Agent Infrastructure

Your Close CRM, Controlled by Agents.

Leads. Pipeline. Activities. Sequences. Tasks. 160+ commands. Every one doubles as an MCP tool.

Close CRM is built for speed — but your agents can’t touch it from a terminal.
So we built close-crm-cli — the missing CLI for agents on Close.

Install from npm
160+
Commands
30
Resource Groups
CLI
+ MCP Native
OpenClaw
OpenClaw
CLI / MCP
Close CRM
Close CRM
leads · pipeline · activities · sequences · tasks

Why close-crm-cli Exists

Without close-crm-cli

  • No official CLI — Close only offers a REST API and web UI
  • Agents can’t log calls, create leads, or move deals without custom wrappers
  • Manual CRM entry after every call, email, and meeting
  • No MCP support — agents can’t call Close as a native tool
  • Pipeline data and activity history locked in the dashboard

With close-crm-cli

  • 160+ commands covering the full Close API surface
  • Single API key, 3-tier resolution: flag → env var → config file
  • Every command is also an MCP tool — plug into any AI agent
  • JSON-first output — pipe to jq, save to files, feed to agents
  • Advanced search with Close DSL — query any lead or contact field

When You Need This

📞

Post-Call CRM Entry

Log the call, update lead status, create an opportunity, and schedule a follow-up — all from one agent prompt immediately after a call ends.

📊

Pipeline Management

Move deals through stages, update opportunity values, and create tasks on verbal commits — your CRM stays current without manual entry.

📧

Sequence Enrollment

Find leads matching criteria and batch-enroll them in outreach sequences. Subscribe by lead ID, manage subscriptions, and track progress.

🔍

Lead Research & Enrichment

Pull full lead records including contacts, activities, opportunities, and custom fields. Feed structured JSON to your enrichment pipeline.

📈

Activity Reporting

Pull activity metrics, funnel reports, and per-rep performance data for any date range — analytics your agent can act on.

🎯

Smart View Queries

Create and query Smart Views to find leads matching complex criteria. Surface exactly the accounts your agent needs to act on.

Quick Start

1. Install

Terminal
npm install -g close-crm-cli

2. Get your API key

1. Log into Close CRM

2. Navigate to SettingsAPI Keys at app.close.com/settings/api

3. Generate and copy your API key

3. Authenticate

Terminal
# Option A: environment variable (recommended for agents)
export CLOSE_API_KEY="your-api-key"

# Option B: login command (saves to ~/.close/config.json)
close login

# Option C: per-command flag
close leads list --api-key "your-api-key"

4. Verify

Terminal
close users me --pretty
# Returns your user profile

close leads list --pretty
# Lists your CRM leads as formatted JSON

close opportunities list --status active --pretty
# Lists open pipeline opportunities

What close-crm-cli Gives Your Agent

12 cmds

Leads & Contacts

Create, update, search, and merge leads. Manage contacts within leads — emails, phones, and custom fields. Full relationship graph from one API key.

15 cmds

Pipeline & Opportunities

Create and move opportunities through pipeline stages. Manage pipelines, lead statuses, and opportunity statuses. Your agent closes deals without opening a browser.

20 cmds

Activity Logging

Log calls, notes, emails, SMS, and meetings directly on any lead. Pull the full unified activity stream. Every touchpoint captured without manual entry.

6 cmds

Tasks & Follow-ups

Create, assign, and bulk-update tasks. Schedule follow-ups with due dates and types. Your agent never drops the ball on a next step.

18 cmds

Sequences & Templates

Manage outreach sequences and subscribe leads to them. Create, render, and use email and SMS templates. Full outreach automation from the terminal.

MCP Server

Every command is exposed as an MCP tool. Claude, Cursor, OpenClaw, and any MCP client can call all 160+ commands natively — no wrappers, no custom code.

Agent Workflows

Real prompts agents use to manage Close CRM end-to-end.

Full Deal Creation from a Verbal Commit

Agent Prompt

A prospect just said yes on a call. Create a lead for Acme Corp, add Jane Doe as a contact, log the call, create a $50k opportunity in the demo stage, and set a follow-up task for tomorrow.

Agent builds the entire CRM record in one pass — lead, contact, call log, opportunity at the right stage, and a follow-up task — zero manual entry after the call.

1
close leads create --name "Acme Corp" --url "https://acme.com"

Create the lead

2
close contacts create --lead-id $LEAD_ID --name "Jane Doe" --emails '[{"email":"jane@acme.com","type":"office"}]'

Add contact

3
close calls create --lead-id $LEAD_ID --direction outbound --duration 1800 --note "Verbal commit on Q2 pilot"

Log the call

4
close opportunities create --lead-id $LEAD_ID --value 50000 --status-id $DEMO_STAGE_ID

Create opportunity

5
close tasks create --lead-id $LEAD_ID --text "Send proposal" --type email --due-date "2026-03-14T09:00:00"

Schedule follow-up

Morning Pipeline Review

Agent Prompt

Show me all open opportunities in my pipeline, any overdue tasks from yesterday, and leads I haven't touched in 7+ days.

Agent surfaces pipeline health, overdue actions, and stale leads — a complete morning briefing without opening Close.

1
close opportunities list --status active --pretty

List all open pipeline opportunities

2
close tasks list --is_complete false --due-date-lte "2026-03-12" --pretty

Pull overdue tasks

3
close leads list --query "date_updated < 2026-03-06" --fields id,display_name,status_label

Find stale leads

4
close reports activity-metrics --date-range "this_week" --pretty

Pull activity metrics

Enroll Leads in Outreach Sequence

Agent Prompt

Find all leads in "Potential" status that don't have an active sequence. Enroll them in the Q2 Enterprise Follow-up sequence.

Agent searches for leads matching the criteria and mass-enrolls them in the target sequence — no manual clicking through lists.

1
close leads list --query "status_label:\"Potential\"" --fields id,display_name

Find Potential leads

2
close sequences list --pretty

Get sequence IDs

3
close sequences subscribe --sequence-id $SEQ_ID --lead-id $LEAD_ID --sender-account-id $ACCT

Enroll each lead

4
close sequences list-subscriptions --sequence-id $SEQ_ID

Verify enrollments

Commands Reference

leads (7 commands)
close leads list [--query <q>] [--limit <n>]List leads with optional search query
close leads get <id>Get a single lead by ID
close leads create --name <name> [--url <url>]Create a new lead
close leads update <id> [--name] [--status-id]Update lead fields
close leads delete <id>Delete a lead
close leads merge --source-id <id> --destination-id <id>Merge two leads
close leads search --query <json>Advanced search with Close DSL
contacts (5 commands)
close contacts list [--lead-id <id>]List contacts, optionally filtered by lead
close contacts get <id>Get a single contact
close contacts create --lead-id <id> --name <name>Create a contact on a lead
close contacts update <id>Update contact fields
close contacts delete <id>Delete a contact
opportunities (5 commands)
close opportunities list [--status <active|won|lost>]List opportunities with status filter
close opportunities get <id>Get a single opportunity
close opportunities create --lead-id <id> --status-id <id> [--value <n>]Create an opportunity
close opportunities update <id> [--status-id] [--value] [--note]Move deal stage or update value
close opportunities delete <id>Delete an opportunity
tasks (6 commands)
close tasks list [--is-complete <bool>] [--lead-id <id>]List tasks with filters
close tasks get <id>Get a single task
close tasks create --lead-id <id> --text <text> --due-date <iso>Create a task or follow-up
close tasks update <id>Update task fields
close tasks delete <id>Delete a task
close tasks bulk-update --ids <list>Bulk-update multiple tasks
calls / notes / emails / sms (19 commands)
close calls create --lead-id <id> --direction <in|out> --duration <secs>Log a call activity
close notes create --lead-id <id> --note <text>Add a note to a lead
close emails create --lead-id <id> --subject <s> --body-text <t>Log an email activity
close sms create --lead-id <id> --text <text> --direction <in|out>Log an SMS activity
close activities list --lead-id <id>Pull unified activity stream for a lead
sequences (7 commands)
close sequences listList all sequences
close sequences get <id>Get a single sequence
close sequences create --name <name>Create a sequence
close sequences update <id>Update sequence settings
close sequences delete <id>Delete a sequence
close sequences subscribe --sequence-id <id> --lead-id <id>Enroll a lead in a sequence
close sequences list-subscriptions --sequence-id <id>List enrolled leads
reports (3 commands)
close reports activity-metrics --date-range <range>Activity metrics by rep and type
close reports activity-report --date-range <range>Detailed activity breakdown
close reports funnel --date-range <range>Pipeline funnel analytics
webhooks (5 commands)
close webhooks listList all webhooks
close webhooks get <id>Get a single webhook
close webhooks create --url <url> --events <list>Create a webhook subscription
close webhooks update <id>Update webhook settings
close webhooks delete <id>Delete a webhook

MCP Server Setup

Every command is available as an MCP tool. Configure once and your agent has full Close CRM access.

Claude Desktop / Cursor (~/.cursor/mcp.json or claude_desktop_config.json)
{
  "mcpServers": {
    "close": {
      "command": "npx",
      "args": ["close-crm-cli", "mcp"],
      "env": {
        "CLOSE_API_KEY": "your-api-key"
      }
    }
  }
}

Sample MCP tools available (160+ total):

leads_listleads_createleads_updateleads_searchleads_mergecontacts_createcontacts_updateopportunities_createopportunities_updatetasks_createtasks_bulk_updatecalls_createnotes_createemails_createsms_createactivities_listsequences_subscribesequences_list_subscriptionsreports_activity_metricsreports_funnelwebhooks_createsmart_views_list+140 more

OpenClaw Agent Setup

Give any OpenClaw agent full Close CRM access. Install once, set the API key, and the agent manages your pipeline autonomously.

1
Install on the agent's server
npm install -g close-crm-cli
2
Set API key in agent environment
export CLOSE_API_KEY=your-key — or use close login to save to config
3
Start MCP server
close mcp — runs on stdio transport, compatible with any MCP client
4
Add CRM instructions to SOUL.md
Tell the agent how to log activities, move deals, create follow-ups, and query pipeline health after calls and meetings
5
Test from Slack
"Log a 20-minute call with Acme Corp, they want a proposal by Friday" — agent creates the call log, updates the lead, and schedules the task

Architecture

Every API endpoint is a CommandDefinition — one source of truth powering both the CLI subcommand and the MCP tool.

src/
├── core/
│   ├── types.ts          # CommandDefinition, CloseClient interfaces
│   ├── client.ts         # HTTP Basic Auth, retry, rate limit (429 backoff)
│   ├── auth.ts           # 3-tier API key resolution
│   ├── config.ts         # ~/.close/config.json
│   └── output.ts         # JSON output + --fields filtering
├── commands/
│   ├── leads/            # list, get, create, update, delete, merge, search
│   ├── contacts/         # list, get, create, update, delete
│   ├── opportunities/    # list, get, create, update, delete
│   ├── tasks/            # list, get, create, update, delete, bulk-update
│   ├── calls/            # list, get, create, update, delete
│   ├── notes/            # list, get, create, update, delete
│   ├── emails/           # list, get, create, update, delete
│   ├── sequences/        # list, get, create, update, delete, subscribe
│   ├── reports/          # activity-metrics, activity-report, funnel
│   ├── webhooks/         # list, get, create, update, delete
│   └── ... (20 more groups)
├── mcp.ts                # MCP server (auto-registers all 160+ commands)
└── index.ts              # CLI entry point

Same pattern as all TOFU CLIs

The CommandDefinition architecture is shared across instantly-cli, hubspot-cli, heyreach-cli, smartlead-cli, and more. One schema generates the Commander.js subcommand and the MCP tool — zero duplication.

Close API Specifics

HTTP Basic Auth with API key as username (auto-handled). Offset-based pagination via _limit/_skip. Auto-retry with exponential backoff on 429/5xx. Advanced search via Close DSL at /data/search/.

Ready to put your CRM on autopilot?

Install close-crm-cli, set your API key in 60 seconds, and your agent can log activities, move deals, enroll leads in sequences, and manage your entire Close pipeline autonomously.

Need agents running your full sales operation? We deploy and manage the full setup.