Skip to main content

Installation

npm install -g mosscrm

Global Options

These options apply to every command:
FlagDescription
--jsonOutput as JSON instead of a table
--workspace <id>Override the active workspace ID
--api-key <key>Override the API key
--session-token <token>Override the session token
--api-url <url>Override the API base URL
--request-id <id>Attach a request ID for tracing
--idempotency-key <key>Idempotency key to prevent duplicate mutations

Output Modes

Table (default)

Human-readable table output. Column widths are fixed for consistent formatting.
moss contact list
ID       Name          Email              Company
──────── ───────────── ────────────────── ────────
cnt_a1   Jane Smith    [email protected]      Acme Corp
cnt_b2   Bob Chen      [email protected]     StartupIO

JSON

Machine-readable JSON output. Use --json with any command.
moss contact list --json
{
  "data": [
    { "id": "cnt_a1", "first_name": "Jane", "last_name": "Smith", "email": "[email protected]" }
  ],
  "meta": { "page": 1, "per_page": 25, "total": 1, "total_pages": 1 }
}

Exit Codes

CodeMeaning
0Success
1General error
2Validation error (invalid input)
3Authentication error (missing or invalid credentials)
4Not found
5Rate limited
Use exit codes for scripting and automation:
moss contact show --id cnt_abc123 --json
if [ $? -eq 4 ]; then
  echo "Contact not found"
fi

Configuration

The CLI stores configuration at ~/.moss/config.json:
{
  "active_workspace": "ws_abc123",
  "workspaces": {
    "ws_abc123": {
      "api_key": "moss_k_...",
      "api_url": "https://api.mosscrm.com"
    }
  }
}
Credentials are saved via moss auth login and can be overridden per-command with --api-key and --workspace.

Command Groups

GroupDescription
authLogin, logout, and identity
workspaceManage workspaces and invites
keyManage API keys
contactManage contacts
companyManage companies
dealManage deals and deal-contact links
interactionLog and view interactions
followupManage follow-ups
commitmentManage commitments
tagManage tags
custom-fieldManage custom field definitions
pipelineView pipeline summary
searchFull-text search
activityView activity timelines
webhookManage webhooks
import / exportBulk data import and export
notificationNotification preferences
auditView audit logs
queueDead letter queue management