New — CLI for AI Agents

Your CRM, at the Speed of AI

SalesNexus CLI (snx) lets any AI agent manage
your entire CRM — contacts, deals, tasks, emails — with a single command line.

$ pip install salesnexus-cli

Why give your AI agent a CRM?

Because the most powerful agent is the one that can actually do things.

Zero-Code Integration

Zero-Code Integration

No SDK, no wrappers, no boilerplate. Every AI agent that can run a shell command can use snx. Pipe output to JSON automatically.
Built for Agents

Built for Agents

Auto-detects piped output and switches to machine-readable JSON. Errors go to stderr. Structured pagination. Exit codes your agent can trust.
Secure by Design

Secure by Design

Profile-based API keys stored locally. Environment variable overrides for CI/CD. No secrets in command history.
Full CRM Coverage

Full CRM Coverage

Contacts, opportunities, tasks, notes, goals, pipelines, fields, templates, reports, lookups, documents, forms, and users — all from one CLI.
Composable

Composable

Chain commands with pipes. Feed output to jq, Python, or another agent. Build entire workflows in bash one-liners.
Works Everywhere

Works Everywhere

macOS, Linux, Windows. Python ≥ 3.10. Works in GitHub Actions, Docker, local dev, and any agent's terminal sandbox.

Works with Every AI Agent

Any tool that can execute shell commands can use SalesNexus CLI out of the box.

 

GitHub Copilot Agent Mode

VS Code

Copilot’s agent mode in VS Code can run terminal commands autonomously. Just ask it in natural language.

  • Runs snx directly in VS Code terminal
  • Reads JSON output and reasons over it
  • Chains multi-step CRM workflows
  • Built into VS Code — no setup needed

Claude Code (Anthropic)

Terminal

Anthropic’s agentic coding tool with full terminal access. Perfect for complex, multi-step CRM
operations.

  • Autonomous shell command execution
  • Parses JSON responses natively
  • Handles errors and retries intelligently
  • Ideal for bulk data operations

Cursor Agent

IDE

Cursor’s agent mode can run terminal commands and iterate on results, making CRM automation effortless.

  • Composer agent runs shell commands
  • Auto-iterates on CLI output
  • Creates scripts that use snx
  • Full IDE integration

Windsurf (Codeium)

IDE

Windsurf’s Cascade agent can execute terminal commands, read output, and plan follow-up actions.

  • Cascade flow runs CLI commands
  • Reads & interprets structured output
  • Multi-step pipeline management
  • Agentic context awareness

OpenAI Codex CLI

Terminal

OpenAI’s open-source coding agent runs in your terminal and can execute snx commands
directly.

  • Sandboxed shell execution
  • Supports full-auto mode
  • Reads piped JSON natively
  • Open-source, customizable

Custom Agents (LangChain, CrewAI, etc.)

Framework

Any agent framework with a shell tool can integrate SalesNexus in minutes.

  • LangChain ShellTool
  • CrewAI process agents
  • AutoGen code executors
  • Any subprocess.run() wrapper

Real-World Agent Examples

See how agents use snx to automate CRM work that would take humans hours.

1

Lead Qualification & Enrichment

GitHub Copilot Agent Mode — VS Code

A sales manager asks Copilot to find unqualified leads and enrich them with pipeline info.

You
Find all contacts in Texas with no opportunity assigned. Create a “Prospecting”
opportunity for each one in the “SMB Sales” goal and add a note saying they need a follow-up call.
AI
I’ll start by getting the goal structure to find the right pipeline and stage
IDs, then search for Texas contacts.
Agent runs in terminal
snx goals list –json
Output (parsed by agent)
{ “data”: [{ “id”: 5, “name”: “SMB Sales”, “pipelines”: [{ “stages”: [{ “id”: 11, “name”: “Prospecting” }]
}] }] }
Agent runs in terminal
snx contacts list –all –json | jq ‘[.data[] | select(.state==”TX”)]’
Output
[{ “id”: 101, “firstName”: “Jane”, “lastName”: “Doe”, “state”: “TX” }, { “id”: 205, “firstName”: “Mark”,
“lastName”: “Rivera”, “state”: “TX” }]
Agent runs (for each contact)
snx opps create –contact-id 101 –goal-id 5 –stage-id 11 –title “SMB Prospecting — Jane Doe”
snx notes create –contact-id 101 –text “AI: Unqualified lead in TX. Needs follow-up call.”
AI
Done! I created prospecting opportunities for 2 contacts in
Texas (Jane Doe and Mark Rivera) and added follow-up notes to each. Both are now in the “Prospecting”
stage of SMB Sales.

2

Pipeline Review & Stalled Deal Alerts

Claude Code — Terminal

A VP of Sales asks Claude Code to analyze the pipeline and identify stalled deals.

You
Review all open opportunities over $25K. If any haven’t been updated in 30+ days,
flag them as stalled and create a high-priority task for the owner.
Agent runs
snx opps list –all –json
Agent parses and filters
Found 3 opps over $25K not updated since before Jan 27, 2026:
• #200 “Acme Enterprise” — $50,000 — owner: user 3 — last update: Dec 15
• #215 “GlobalTech Renewal” — $32,000 — owner: user 7 — last update: Jan 10
• #220 “Meridian Expansion” — $28,500 — owner: user 3 — last update: Jan 5
Agent runs (for each stalled opp)
snx opps update 200 –custom-field “deal_status=Stalled”
snx tasks create –title “STALLED: Acme Enterprise ($50K) — re-engage” –priority “High” –assigned-to 3
–opportunity-id 200 –date-from “2026-02-27T09:00:00”
AI
Pipeline review complete. 3 deals worth a combined
$110,500 have been flagged as stalled. High-priority tasks have been assigned to the
respective owners with tomorrow’s date. Here’s the summary:

Acme Enterprise $50,000 72 days stalled → User 3
GlobalTech Renewal $32,000 47 days stalled → User 7
Meridian Expansion $28,500 52 days stalled → User 3

3

Post-Event Lead Import & Campaign Assignment

Cursor Agent — Composer

After a trade show, a marketing manager asks their agent to bulk-import leads and assign them to a drip
campaign.

You
I have 4 new leads from the Houston Tech Expo. Create contacts for them, tag them
with lead_source=”Trade Show” and event=”Houston Tech Expo 2026″, then add them all to a new task for
our SDR team to follow up by March 5th.
Agent runs
snx contacts create -f “Sarah” -l “Chen” -e “sarah@techcorp.io” -c “TechCorp” –title “CTO” –city “Houston”
–state “TX” -F “lead_source=Trade Show” -F “event=Houston Tech Expo 2026”

snx contacts create -f “David” -l “Kim” -e “dkim@innovate.co” -c “Innovate LLC” –title “VP Eng” –city
“Austin” –state “TX” -F “lead_source=Trade Show” -F “event=Houston Tech Expo 2026”

snx contacts create -f “Lisa” -l “Patel” -e “lpatel@nexgen.com” -c “NexGen Solutions” –title “Director”
–city “Dallas” –state “TX” -F “lead_source=Trade Show” -F “event=Houston Tech Expo 2026”

snx contacts create -f “James” -l “Wu” -e “jwu@dataflow.ai” -c “DataFlow AI” –title “CEO” –city “Houston”
–state “TX” -F “lead_source=Trade Show” -F “event=Houston Tech Expo 2026”

Created contacts
IDs: 310, 311, 312, 313
Agent runs
snx tasks create –title “Follow up: Houston Tech Expo 2026 leads” –details “4 new leads from trade show
booth. Sarah Chen (TechCorp), David Kim (Innovate), Lisa Patel (NexGen), James Wu (DataFlow). All tagged.”
–type “Call” –priority “High” –date-from “2026-03-01T09:00:00” –date-to “2026-03-05T17:00:00”
–contact-id 310
AI
All done! Created 4 new contacts from the Houston Tech Expo,
each tagged with the trade show source. A high-priority follow-up task is scheduled for March 1–5. The
SDR team will see it on their dashboard.

4

Weekly Pipeline Report Generation

OpenAI Codex CLI — Full Auto Mode

A scheduled agent autonomously generates a weekly pipeline summary every Monday morning.

Agent runs (automated script)
snx opps list –all –json | python3 -c ”
import json, sys
data = json.load(sys.stdin)[‘data’]
total = sum(o.get(‘amount’, 0) or 0 for o in data)
by_stage = {}
for o in data:
s = o.get(‘currentStageId’, ‘Unknown’)
by_stage[s] = by_stage.get(s, 0) + (o.get(‘amount’, 0) or 0)
print(json.dumps({‘total_pipeline’: total, ‘deals’: len(data), ‘by_stage’: by_stage},
indent=2))
Output
{
“total_pipeline”: 487500.00,
“deals”: 23,
“by_stage”: { “11”: 85000, “12”: 142500, “13”: 210000, “14”: 50000 }
}
Agent runs
snx templates stats 42 –json
Campaign performance
{ “sent”: 1250, “opens”: 487, “clicks”: 134, “bounces”: 12 }
AI
Weekly Pipeline Report — Feb 24, 2026

📊 $487,500 total pipeline across 23 deals
• Prospecting: $85,000 (5 deals)
• Qualification: $142,500 (8 deals)
• Proposal: $210,000 (7 deals)
• Closed Won: $50,000 (3 deals)

📧 Last campaign: 39% open rate, 10.7% click rate

Report stored and emailed to the team.

5

Custom Agent: Automated Lead Scoring

LangChain + ShellTool — Python Script

A custom LangChain agent scores leads based on engagement data and updates the CRM automatically.

# lead_scoring_agent.py — LangChain agent with SalesNexus CLI
from langchain.agents import initialize_agent, Tool
from langchain_community.tools import ShellTool
from langchain_openai import ChatOpenAI

shell = ShellTool()
tools = [Tool(name="snx", func=shell.run, description="""
Run SalesNexus CLI commands. Examples:
- snx contacts list --all --json (list all contacts)
- snx contacts get {id} --json   (get contact details)  
- snx contacts update {id} --custom-field "score=85"
- snx opps create --contact-id {id} --goal-id 5
- snx notes create --contact-id {id} --text "..."
Returns JSON when piped. Use jq to filter.
""")]

llm = ChatOpenAI(model="gpt-4o", temperature=0)
agent = initialize_agent(tools, llm, agent="zero-shot-react-description")

agent.run("""
Score all contacts that were created in the last 7 days.
Scoring rules:
- Has email: +30 points
- Has phone: +20 points  
- Has company: +20 points
- Has title with "VP", "Director", "C-level": +30 points
Update each contact's 'lead_score' custom field with the total.
If score >= 70, create a high-priority task for user 3.
""")
AI
Scored 12 new leads. Results:
• 4 contacts scored 80+ → high-priority tasks created
• 5 contacts scored 50–70 → warm leads
• 3 contacts scored below 50 → need enrichment

All lead_score fields updated in SalesNexus.

6

Natural Language CRM Queries

Any Agent — Conversational

Users ask questions in plain English. The agent translates them into CLI commands instantly.

You
How many contacts do we have in California?
Agent runs
snx contacts list –all –json | jq ‘[.data[] | select(.state==”CA”)] | length’
Output47
AI
You have 47 contacts in California.
another query
You
What’s our total pipeline value for deals closing this month?
Agent runs
snx opps list –all –json | jq ‘[.data[] | select(.closeDate >= “2026-02-01” and .closeDate <= “2026-02-28”
) | .amount // 0] | add’
Output215750.00
AI
Your pipeline for deals closing in February is $215,750.
another query
You
Change Jane Doe’s status to “Customer” and log that she signed the contract
today.
Agent runs
snx contacts list –search “Jane Doe” –json
snx contacts update 101 –custom-field “status=Customer”
snx notes create –contact-id 101 –text “Contract signed on Feb 26, 2026. Status updated to Customer.”
AI
Done! Jane Doe (ID 101) is now marked as “Customer” and I’ve
logged the contract signing note.

Command Cheat Sheet for Agents

Every command your agent needs, at a glance.

 

Action Command Category
Check connection snx ping Setup
List all contacts snx contacts list --all --json Contacts
Search contacts snx contacts list --search "Acme" --json Contacts
Get contact details snx contacts get 101 --json Contacts
Create contact snx contacts create -f "Jane" -l "Doe" -e "j@co.com" -c "Acme" Contacts
Update contact snx contacts update 101 --title "VP Sales" -F "score=90" Contacts
Bulk update snx contacts batch-update --ids "1,2,3" --field "status=Active" Contacts
Create opportunity snx opps create --contact-id 101 --goal-id 5 --amount 50000 Deals
Move deal stage snx opps update 200 --stage-id 13 Deals
Create task snx tasks create --title "Follow up" --priority "High" -c 101 Tasks
Add note snx notes create --contact-id 101 --text "Called, interested" Notes
List pipelines snx goals list --json Pipeline
Get campaign stats snx templates stats 42 --json Campaigns
List custom fields snx fields list --json Schema
Export to CSV snx --csv contacts list --all > contacts.csv Export

How Agent Integration Works

Three properties make snx the perfect agent tool.

 

1

Auto-JSON Output

When called via subprocess (non-TTY), snx automatically outputs JSON on stdout. No special
flags needed. Status messages go to stderr.

$ snx contacts get 101 | cat
{
  "id": 101,
  "firstName": "Jane",
  ...
}
2

Structured Errors

Exit code 0 = success, 1 = error. Errors go to stderr with clear messages. Your
agent always knows what happened.

# stdout: empty (no JSON)
# stderr:
Error: HTTP 404: Contact not found.
# exit code: 1
3

Auto-Retry

Rate limits (429) and transient errors (502, 503, 504) are retried automatically with exponential backoff.
Your agent never sees flaky failures.

# Agent runs 100 commands.
# CLI handles retries silently.
# Agent gets clean results every time.
✓ 100/100 commands succeeded

Get Started in 60 Seconds

Three commands and your AI agent is managing your CRM.

Step 1 — Install
pip install salesnexus-cli

Step 2 — Authenticate
snx auth login –api-key sn_live_…

Step 3 — Go
snx contacts list –json