CRM from the CLI
Use the ConnectSafely CLI to add, find and update people in your Agentic CRM from a terminal, a script or a coding agent.
The ConnectSafely CLI has twelve CRM commands. They suit scripts, scheduled jobs and coding agents, where running a shell command is easier than connecting a server.
Set up
# Install (Node 20 or newer)
npm install -g @connectsafely/cli
# Use the key from https://connectsafely.ai/api-key
export CONNECTSAFELY_API_KEY=your_key_hereCRM commands need only the API key. You do not have to choose a LinkedIn account for them.
Check that you have the CRM commands
The CRM commands were added after CLI version 1.0.3. Check your install:
connectsafely commands --search prospectIf the list does not include create-prospect, update the CLI by running the install command again.
For output formats, exit codes and the other global flags, see Getting started with the CLI.
The commands
| Command | What it does | Changes data |
|---|---|---|
list-prospects | List people, with search and filters | no |
get-prospect | Read one person | no |
create-prospect | Add a person | yes |
update-prospect | Change a person | yes |
delete-prospect | Delete a person | yes |
list-prospect-notes | List the notes on a person | no |
create-prospect-note | Add a note | yes |
get-prospect-reminder | Read the open follow-up | no |
set-prospect-reminder | Set or move the follow-up | yes |
delete-prospect-reminder | Mark the follow-up done | yes |
list-stages | List your pipeline stages | no |
list-tags | List the tags in use | no |
Every command explains its own flags:
connectsafely update-prospect --helpTo see the request a command would send without sending it, add --dry-run.
Examples
See your stages
connectsafely list-stagesAdd a person
By LinkedIn profile:
connectsafely create-prospect \
--linkedin-url "https://www.linkedin.com/in/jane-doe" \
--note "Met at the SaaS meetup"By email only:
connectsafely create-prospect \
--email "maria@acme.com" \
--name "Maria Lopez" \
--company "Acme"You must give --linkedin-url or --email. The other flags are --name, --company, --title, --phone, --stage-id, --tags, --deal-value, --note and --workspace-id.
If the person is already in your CRM, you get the existing record back with created: false, and the stage, tags, deal value and note you passed are not applied. Use update-prospect for those.
Find people
# Search by name or company
connectsafely list-prospects --search "acme"
# Everyone with a tag who has an email
connectsafely list-prospects --tag "warm-lead" --has-email true
# People with no stage yet
connectsafely list-prospects --stage-id new
# Changed since a date
connectsafely list-prospects --updated-since "2026-11-01"Results come 50 at a time, newest activity first. --limit accepts 1 to 200. When the response has hasMore: true, pass its nextCursor back to get the next page:
connectsafely list-prospects --limit 200 --cursor "PASTE_NEXT_CURSOR"People in hidden stages, such as Archived, are left out unless you pass that stage's id with --stage-id.
Move a person to a stage
Use the stage name. Capital letters do not matter.
connectsafely update-prospect --id PROSPECT_ID --stage "Meeting Booked"A stage set this way counts as a manual move, so the CRM stops moving that person's stage on its own.
Set a deal value and close date
connectsafely update-prospect --id PROSPECT_ID \
--deal-value 5000 \
--expected-close-at "2026-12-31"Mark won or lost
connectsafely update-prospect --id PROSPECT_ID --outcome won
connectsafely update-prospect --id PROSPECT_ID \
--outcome lost \
--outcome-reason "Went with a competitor"Add and remove tags
Repeat the flag for each tag:
connectsafely update-prospect --id PROSPECT_ID --add-tags webinar --add-tags demoOr pass the whole request as JSON:
connectsafely update-prospect --json '{"id":"PROSPECT_ID","addTags":["webinar"],"removeTags":["cold"]}'Write a note
connectsafely create-prospect-note --id PROSPECT_ID \
--kind call \
--body "Wants pricing for 10 seats"--kind can be note, call, meeting or email. Leave it out for a plain note.
Set a follow-up
connectsafely set-prospect-reminder --id PROSPECT_ID \
--due-at "2026-11-24T10:00:00Z" \
--note "Send the proposal"--due-at is an ISO date and time, and it must be in the future. Each person has one open follow-up, so this replaces one that is already set. You can also pass --time-zone, for example Europe/London, so the reminder email shows the time in your zone.
Mark it done:
connectsafely delete-prospect-reminder --id PROSPECT_IDMore than one workspace
If your key belongs to more than one workspace, add --workspace-id to list-prospects, create-prospect, list-stages and list-tags. Commands that take a prospect --id use that person's workspace.
Using it with a coding agent
The command names are the same as the MCP tool names, so the prompts on that page work with an agent that runs the CLI. An agent can discover the commands itself with connectsafely commands --search prospect and connectsafely schema create-prospect.
Connect an AI assistant (MCP)
Connect the ConnectSafely Agentic CRM to Claude, ChatGPT, Cursor or any MCP client, then add people, move stages, write notes and set reminders by asking.
CRM API
REST reference for the ConnectSafely Agentic CRM. Endpoints for prospects, notes, follow-up reminders, stages and tags, with fields, filters and errors.
