Contact Book
Command line (CLI)
A native command-line client for Contact Book. One install line.
The Contact Book CLI is auto-generated from the same models the HTTP API exposes - every endpoint you can hit with curl is also a subcommand here. The script is one self-contained Python file (no pip install), checks for updates once a day, and authenticates with the same Bearer tokens the rest of the API accepts.
Install
One line, one file. The script lands under your home directory - no pip install, no system-wide changes. Pick your OS in the tabs below.
curl -fsSL https://monicacrm.com/xapi2/cli/install.sh | bash
1.2.8·Command: contactscli·checksum: 5b23702452…Sign in
Every command except login / version / update requires a valid token. Two ways in: a personal access token (PAT) from the Integrations menu (recommended for scripts + CI), or interactive email + password (saved as a session token under ~/.contactscli/credentials.json, mode 0600).
contactscli login --token pat_…
Commands
Each data model is a subgroup. Click a model name to jump to its detail page; the available ops mirror the HTTP API one-to-one.
| Model | Commands |
|---|---|
| activity | contactscli activity listcontactscli activity getcontactscli activity createcontactscli activity updatecontactscli activity deletecontactscli activity upsert |
| contact | contactscli contact listcontactscli contact getcontactscli contact createcontactscli contact updatecontactscli contact deletecontactscli contact upsert |
| conversation | contactscli conversation listcontactscli conversation getcontactscli conversation createcontactscli conversation updatecontactscli conversation deletecontactscli conversation upsert |
| custom_field | contactscli custom_field listcontactscli custom_field getcontactscli custom_field createcontactscli custom_field updatecontactscli custom_field deletecontactscli custom_field upsert |
| gift | contactscli gift listcontactscli gift getcontactscli gift createcontactscli gift updatecontactscli gift deletecontactscli gift upsert |
| journal_entry | contactscli journal_entry listcontactscli journal_entry getcontactscli journal_entry createcontactscli journal_entry updatecontactscli journal_entry deletecontactscli journal_entry upsert |
| life_event | contactscli life_event listcontactscli life_event getcontactscli life_event createcontactscli life_event updatecontactscli life_event deletecontactscli life_event upsert |
| note | contactscli note listcontactscli note getcontactscli note createcontactscli note updatecontactscli note deletecontactscli note upsert |
| pet | contactscli pet listcontactscli pet getcontactscli pet createcontactscli pet updatecontactscli pet deletecontactscli pet upsert |
| relationship | contactscli relationship listcontactscli relationship getcontactscli relationship createcontactscli relationship updatecontactscli relationship deletecontactscli relationship upsert |
| reminder | contactscli reminder listcontactscli reminder getcontactscli reminder createcontactscli reminder updatecontactscli reminder deletecontactscli reminder upsert |
--filter name=Foo (repeatable), --all (auto-paginate), --fields id,name (project response), --cache N (local cache, N s), --file p.json / --csv p.csv / --stdin (bulk input; arrays + CSV rows), --continue-on-error (don't stop on bulk failure; exit 1 if any failed), --dry-run (preview the request), --idempotency-key K / --auto-idempotency (safe retries), --retry N + --backoff exp (auto-retry 429/5xx), --format json|ndjson|table (output shape), --stderr-json (machine-readable errors), --profile NAME (switch credentials).Use with an AI assistant
Models like Claude, ChatGPT, or Gemini will write scripts that drive this CLI for you - they only need the context below. Copy the block into your chat, then describe what you want to do.
Help me write scripts using `contactscli`, the CLI for the Contact Book app.Install:macOS/Linux: curl -fsSL https://monicacrm.com/xapi2/cli/install.sh | bashWindows PS: irm https://monicacrm.com/xapi2/cli/install.ps1 | iexSign in (required before any data command):contactscli login --token pat_… # personal access tokencontactscli login # interactive (token or email + password)Commands per model:contactscli activity { list | get | create | update | delete | upsert }fields: --parent-id --kind --summary --description --occurred-at --locationcontactscli contact { list | get | create | update | delete | upsert }fields: --name --nickname --pronouns --email --phone --secondary-email --secondary-phone --company --job-title --address-line --city --country --website --linkedin --twitter --birthday --anniversary --gender --how-we-met --food-prefs --allergies --last-contacted-at --stay-in-touch-frequency --stay-in-touch-topic --notes --tags --favorite --avatar-blob-id --colorcontactscli conversation { list | get | create | update | delete | upsert }fields: --parent-id --channel --summary --content --occurred-at --sentiment --duration-minutescontactscli custom_field { list | get | create | update | delete | upsert }fields: --parent-id --label --value --kind --iconcontactscli gift { list | get | create | update | delete | upsert }fields: --parent-id --title --occasion --status --occurred-at --price --currency --url --notescontactscli journal_entry { list | get | create | update | delete | upsert }fields: --title --body --mood --occurred-at --tagscontactscli life_event { list | get | create | update | delete | upsert }fields: --parent-id --kind --title --occurred-at --description --location --recurringcontactscli note { list | get | create | update | delete | upsert }fields: --parent-id --body --pinnedcontactscli pet { list | get | create | update | delete | upsert }fields: --parent-id --name --species --species-other --breed --born-at --color --notescontactscli relationship { list | get | create | update | delete | upsert }fields: --parent-id --target-id --kind --label --since --notescontactscli reminder { list | get | create | update | delete | upsert }fields: --parent-id --message --due-date --completedOutput + flags:- stdout is JSON (one object, or {data:[...], meta:{...}} on list).- errors go to stderr; non-zero exit (3=auth, 5=not found, 6=validation, 7=conflict, 8=rate-limited).- --filter name=Foo (friendly key, repeatable) on `list`.- --all auto-paginates; --fields id,name projects; --cache N caches list/get for N s.- writes accept --json '{...}', --file path.json (arrays = bulk), --stdin, or --csv path [--map k=COL,…].- upsert needs --unique <field>; --dry-run previews any write.- --retry N --backoff exp survives 429/5xx; --stderr-json gives machine-readable errors.Field schemas + constraints per model: https://monicacrm.com/docs/types/<model>Full CLI reference: https://monicacrm.com/docs/cliTask: <describe what you want to do>
Examples
contactscli login --token pat_…contactscli whoami
Recipes
End-to-end snippets for the workflows people actually run. Pick a tab.
# items.csv has columns: parent_id,Full Name,status# --map renames CSV headers to API field names; missing cells skipped.contactscli activity create \--csv items.csv \--map name=Full Name \--continue-on-error \--retry 3 --backoff exp
Environment variables
| Variable | Purpose |
|---|---|
| XCLI_NO_AUTOUPDATE | Skip the once-per-day version check + self-replace. |
| XCLI_NO_TELEMETRY | Skip the anonymous CLI usage analytics. |
| XCLI_BASE_URL | Override the baked-in server URL (testing only). |
| XCLI_TOKEN | Use this PAT for the current invocation without saving it. |
Telemetry + auto-update
The CLI sends one anonymous analytics event per command (command name, version, OS - no request bodies, no field values) so the team running this app can see how it's used in the same dashboard as the web UI. The data is processed securely; an audit log of every event tied to you can be requested at any time from the company operating the app. We strongly encourage leaving telemetry on - it's how reliability issues surface and how the team prioritises improvements that affect you. It can be turned off with XCLI_NO_TELEMETRY=1. Separately, the CLI checks for a newer version at most once every 24 hours and updates itself in place; XCLI_NO_AUTOUPDATE=1 disables that.