KosmoKrator

sales

Capsule CRM CLI for AI Agents

Use the Capsule CRM CLI from KosmoKrator to call Capsule CRM tools headlessly, return JSON, inspect schemas, and automate workflows from coding agents, scripts, and CI.

7 functions 6 read 1 write Bearer token auth

Capsule CRM CLI Setup

Capsule CRM can be configured headlessly with `kosmokrator integrations:configure capsule`.

# Install KosmoKrator first if it is not available on PATH.
curl -fsSL https://raw.githubusercontent.com/OpenCompanyApp/kosmokrator/main/install.sh | bash

# Configure and verify this integration.
kosmokrator integrations:configure capsule --set access_token="$CAPSULE_ACCESS_TOKEN" --enable --read allow --write ask --json
kosmokrator integrations:doctor capsule --json
kosmokrator integrations:status --json

Credentials

Authentication type: Bearer token bearer_token. Configure credentials once, then use the same stored profile from scripts, coding CLIs, Lua code mode, and the MCP gateway.

KeyEnv varTypeRequiredLabel
access_token CAPSULE_ACCESS_TOKEN Secret secret yes Access Token
url CAPSULE_URL URL url no API Base URL

Call Capsule CRM Headlessly

Use the generic call form when another coding CLI or script needs a stable universal interface.

kosmo integrations:call capsule.capsule_list_contacts '{
  "page": 1,
  "per_page": 1
}' --json

Use the provider shortcut form for shorter human-facing commands.

kosmo integrations:capsule capsule_list_contacts '{
  "page": 1,
  "per_page": 1
}' --json

Agent Discovery Commands

These commands return structured output for coding agents that need to inspect capabilities before choosing a function.

kosmo integrations:docs capsule --json
kosmo integrations:docs capsule.capsule_list_contacts --json
kosmo integrations:schema capsule.capsule_list_contacts --json
kosmo integrations:search "Capsule CRM" --json
kosmo integrations:list --json

All CLI Functions

Every function below can be called headlessly. The generic form is stable across all integrations; the provider shortcut is shorter but specific to Capsule CRM.

capsule.capsule_list_contacts

Read read

List contacts (people and organisations) from Capsule CRM. Returns paginated results with contact details.

Parameters
page, per_page

Generic CLI call

kosmo integrations:call capsule.capsule_list_contacts '{"page":1,"per_page":1}' --json

Provider shortcut

kosmo integrations:capsule capsule_list_contacts '{"page":1,"per_page":1}' --json

capsule.capsule_get_contact

Read read

Retrieve a single contact (person or organisation) from Capsule CRM by ID.

Parameters
id

Generic CLI call

kosmo integrations:call capsule.capsule_get_contact '{"id":1}' --json

Provider shortcut

kosmo integrations:capsule capsule_get_contact '{"id":1}' --json

capsule.capsule_create_contact

Write write

Create a new contact (person or organisation) in Capsule CRM. Provide at least a first name and last name for a person contact.

Parameters
type, firstName, lastName, emailAddresses

Generic CLI call

kosmo integrations:call capsule.capsule_create_contact '{"type":"example_type","firstName":"example_firstName","lastName":"example_lastName","emailAddresses":"example_emailAddresses"}' --json

Provider shortcut

kosmo integrations:capsule capsule_create_contact '{"type":"example_type","firstName":"example_firstName","lastName":"example_lastName","emailAddresses":"example_emailAddresses"}' --json

capsule.capsule_list_opportunities

Read read

List sales opportunities from Capsule CRM. Optionally filter by status (OPEN, WON, LOST, CLOSED). Returns paginated results.

Parameters
page, per_page, status

Generic CLI call

kosmo integrations:call capsule.capsule_list_opportunities '{"page":1,"per_page":1,"status":"example_status"}' --json

Provider shortcut

kosmo integrations:capsule capsule_list_opportunities '{"page":1,"per_page":1,"status":"example_status"}' --json

capsule.capsule_get_opportunity

Read read

Retrieve a single sales opportunity from Capsule CRM by ID.

Parameters
id

Generic CLI call

kosmo integrations:call capsule.capsule_get_opportunity '{"id":1}' --json

Provider shortcut

kosmo integrations:capsule capsule_get_opportunity '{"id":1}' --json

capsule.capsule_list_tasks

Read read

List tasks from Capsule CRM. Optionally filter by status (OPEN, COMPLETED). Returns paginated results.

Parameters
page, per_page, status

Generic CLI call

kosmo integrations:call capsule.capsule_list_tasks '{"page":1,"per_page":1,"status":"example_status"}' --json

Provider shortcut

kosmo integrations:capsule capsule_list_tasks '{"page":1,"per_page":1,"status":"example_status"}' --json

capsule.capsule_get_current_user

Read read

Get the currently authenticated Capsule CRM user. Use this to verify credentials or identify the connected account.

Parameters
none

Generic CLI call

kosmo integrations:call capsule.capsule_get_current_user '{}' --json

Provider shortcut

kosmo integrations:capsule capsule_get_current_user '{}' --json

Function Schemas

Use these parameter tables when building CLI payloads without calling integrations:schema first.

capsule.capsule_list_contacts

List contacts (people and organisations) from Capsule CRM. Returns paginated results with contact details.

Operation
Read read
Schema command
kosmo integrations:schema capsule.capsule_list_contacts --json
ParameterTypeRequiredDescription
page integer no Page number for pagination (default: 1).
per_page integer no Number of contacts per page, max 100 (default: 50).

capsule.capsule_get_contact

Retrieve a single contact (person or organisation) from Capsule CRM by ID.

Operation
Read read
Schema command
kosmo integrations:schema capsule.capsule_get_contact --json
ParameterTypeRequiredDescription
id integer yes The contact (party) ID.

capsule.capsule_create_contact

Create a new contact (person or organisation) in Capsule CRM. Provide at least a first name and last name for a person contact.

Operation
Write write
Schema command
kosmo integrations:schema capsule.capsule_create_contact --json
ParameterTypeRequiredDescription
type string no Contact type: "person" (default) or "organisation".
firstName string yes First name of the contact.
lastName string yes Last name of the contact.
emailAddresses array no Email addresses, e.g. [{"address":"[email protected]"}].

capsule.capsule_list_opportunities

List sales opportunities from Capsule CRM. Optionally filter by status (OPEN, WON, LOST, CLOSED). Returns paginated results.

Operation
Read read
Schema command
kosmo integrations:schema capsule.capsule_list_opportunities --json
ParameterTypeRequiredDescription
page integer no Page number for pagination (default: 1).
per_page integer no Number of opportunities per page, max 100 (default: 50).
status string no Filter by status: OPEN, WON, LOST, or CLOSED.

capsule.capsule_get_opportunity

Retrieve a single sales opportunity from Capsule CRM by ID.

Operation
Read read
Schema command
kosmo integrations:schema capsule.capsule_get_opportunity --json
ParameterTypeRequiredDescription
id integer yes The opportunity ID.

capsule.capsule_list_tasks

List tasks from Capsule CRM. Optionally filter by status (OPEN, COMPLETED). Returns paginated results.

Operation
Read read
Schema command
kosmo integrations:schema capsule.capsule_list_tasks --json
ParameterTypeRequiredDescription
page integer no Page number for pagination (default: 1).
per_page integer no Number of tasks per page, max 100 (default: 50).
status string no Filter by status: OPEN or COMPLETED.

capsule.capsule_get_current_user

Get the currently authenticated Capsule CRM user. Use this to verify credentials or identify the connected account.

Operation
Read read
Schema command
kosmo integrations:schema capsule.capsule_get_current_user --json
ParameterTypeRequiredDescription
No parameters.

Permissions

Headless calls still follow the integration read/write permission policy. Configure read/write defaults with integrations:configure. Add --force only for trusted automation that should bypass that policy.