Contacts & CRM Commands

Full CRM management from the command line — create and update contacts, move them through pipeline stages, define custom fields, and pull analytics.


contacts list

List contacts for your organization with search, filtering, sorting, and cursor-based pagination.

smallforce contacts list [options]

Options

FlagTypeDefaultDescription
--search <text>stringSearch by name, email, or phone
--stage <id>stringFilter by pipeline stage ID
--source <source>stringFilter by source
--tag <tag>stringFilter by tag
--created-after <date>stringFilter contacts created after this date (ISO 8601)
--created-before <date>stringFilter contacts created before this date (ISO 8601)
--sort-by <field>stringcreated_atSort by: created_at, updated_at, first_name
--sort-order <order>stringdescSort order: asc, desc
--cursor <cursor>stringPagination cursor from a previous response
--limit <n>numberNumber of contacts to return (1–100)

List all contacts

smallforce contacts list

Search by name

smallforce contacts list --search "John"

Filter by pipeline stage

smallforce contacts list --stage stg_abc123 --sort-by first_name --sort-order asc

Filter by date range

smallforce contacts list --created-after "2026-01-01" --created-before "2026-03-14"

Paginate through results

# First page
smallforce contacts list --limit 25

# Use the cursor from the response for the next page
smallforce contacts list --limit 25 --cursor "eyJpZCI6Imxhc3RfaWQifQ"

contacts get

Get full details for a specific contact, including custom field values.

smallforce contacts get <contact-id>

Example

smallforce contacts get cnt_abc123

Example output

{
  "id": "cnt_abc123",
  "firstName": "Sarah",
  "lastName": "Chen",
  "email": "sarah@example.com",
  "mobilePhone": "+1-555-0123",
  "company": "Acme Corp",
  "jobTitle": "Marketing Director",
  "source": "website",
  "tags": ["vip", "enterprise"],
  "pipelineStage": {
    "id": "stg_abc123",
    "name": "Qualified Lead"
  },
  "customFields": {
    "Annual Revenue": "$2.5M",
    "Industry": "SaaS"
  },
  "createdAt": "2026-02-15T09:30:00Z"
}

contacts create

Create a new contact. First name is required; all other fields are optional.

smallforce contacts create --first-name <name> [options]

Options

FlagTypeRequiredDefaultDescription
--first-name <name>stringYesContact’s first name
--last-name <name>stringNoLast name
--email <email>stringNoEmail address
--mobile-phone <phone>stringNoMobile phone number
--company <company>stringNoCompany name
--job-title <title>stringNoJob title
--source <source>stringNoHow you acquired this contact
--tags <tags>stringNoComma-separated tags
--notes <notes>stringNoFree-text notes
--stage <id>stringNoPipeline stage ID

Create a basic contact

smallforce contacts create --first-name "Sarah" --last-name "Chen" --email "sarah@example.com"

Create a contact with full details

smallforce contacts create \
  --first-name "Marcus" \
  --last-name "Johnson" \
  --email "marcus@acme.com" \
  --mobile-phone "+1-555-0456" \
  --company "Acme Corp" \
  --job-title "CEO" \
  --source "referral" \
  --tags "vip,enterprise" \
  --stage stg_abc123

contacts update

Update an existing contact. Only include the fields you want to change.

smallforce contacts update <contact-id> [options]

Options

FlagTypeDescription
--first-name <name>stringFirst name
--last-name <name>stringLast name
--email <email>stringEmail address
--mobile-phone <phone>stringMobile phone number
--company <company>stringCompany name
--job-title <title>stringJob title
--source <source>stringContact source
--tags <tags>stringComma-separated tags
--notes <notes>stringFree-text notes

Update email and company

smallforce contacts update cnt_abc123 --email "sarah.new@company.com" --company "New Company Inc"

Update tags

smallforce contacts update cnt_abc123 --tags "vip,enterprise,q1-lead"

contacts move-stage

Move a contact to a specific pipeline stage.

smallforce contacts move-stage <contact-id> --stage <stage-id>

Options

FlagTypeRequiredDescription
--stage <id>stringYesTarget pipeline stage ID

Example

smallforce contacts move-stage cnt_abc123 --stage stg_qualified

Use smallforce contacts pipeline to list available stages and their IDs.


contacts pipeline

List all pipeline stages defined for your organization.

smallforce contacts pipeline

Example output

{
  "stages": [
    { "id": "stg_new", "name": "New Lead", "order": 0 },
    { "id": "stg_qualified", "name": "Qualified", "order": 1 },
    { "id": "stg_proposal", "name": "Proposal Sent", "order": 2 },
    { "id": "stg_closed", "name": "Closed Won", "order": 3 }
  ]
}

contacts custom-fields

List custom field definitions configured for your organization.

smallforce contacts custom-fields

Example output

{
  "fields": [
    { "id": "cf_revenue", "label": "Annual Revenue", "type": "text" },
    { "id": "cf_industry", "label": "Industry", "type": "dropdown", "options": ["SaaS", "E-commerce", "Services"] },
    { "id": "cf_score", "label": "Lead Score", "type": "number" }
  ]
}

Custom fields are defined in the SmallForce app under Settings → Custom Fields. The CLI provides read access to these definitions and their values appear on contact details.


contacts analytics

Get CRM analytics including total contacts, pipeline distribution, and source breakdown.

smallforce contacts analytics

Example output

{
  "totals": {
    "contacts": 342,
    "thisMonth": 28
  },
  "pipeline": {
    "New Lead": 45,
    "Qualified": 67,
    "Proposal Sent": 23,
    "Closed Won": 207
  },
  "sources": {
    "website": 120,
    "referral": 89,
    "social": 68,
    "manual": 65
  }
}