productivity
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.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 reuse the same stored profile from scripts, coding CLIs, Lua, and MCP.
| Key | Env var | Type | Required | Label |
|---|---|---|---|---|
access_token | CAPSULE_ACCESS_TOKEN | Secret secret | yes | Access Token |
url | CAPSULE_URL | URL url | no | API Base URL |
Command Patterns
The generic command is stable across every integration. The provider shortcut is shorter for humans.
kosmo integrations:call capsule.capsule_api_delete '{"path":"example_path","query":"example_query"}' --json kosmo integrations:capsule capsule_api_delete '{"path":"example_path","query":"example_query"}' --json Discovery
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_api_delete --json
kosmo integrations:schema capsule.capsule_api_delete --json
kosmo integrations:search "Capsule CRM" --json
kosmo integrations:list --json Automation Contexts
The same configured command surface works in these environments. The command does not change unless the host wrapper, credentials, or permissions change.
CLI Functions
Every function below can be called headlessly. Commands are highlighted, copyable, and scroll horizontally when payloads are long.
capsule.capsule_api_delete
Call a safe relative Capsule CRM API path with DELETE for endpoints not covered by a dedicated tool.
read - Parameters
- path, query
kosmo integrations:call capsule.capsule_api_delete '{"path":"example_path","query":"example_query"}' --json kosmo integrations:capsule capsule_api_delete '{"path":"example_path","query":"example_query"}' --json capsule.capsule_api_get
Call a safe relative Capsule CRM API path with GET for endpoints not covered by a dedicated tool.
read - Parameters
- path, query
kosmo integrations:call capsule.capsule_api_get '{"path":"example_path","query":"example_query"}' --json kosmo integrations:capsule capsule_api_get '{"path":"example_path","query":"example_query"}' --json capsule.capsule_api_post
Call a safe relative Capsule CRM API path with POST for endpoints not covered by a dedicated tool.
read - Parameters
- path, payload, query
kosmo integrations:call capsule.capsule_api_post '{"path":"example_path","payload":"example_payload","query":"example_query"}' --json kosmo integrations:capsule capsule_api_post '{"path":"example_path","payload":"example_payload","query":"example_query"}' --json capsule.capsule_api_put
Call a safe relative Capsule CRM API path with PUT for endpoints not covered by a dedicated tool.
read - Parameters
- path, payload, query
kosmo integrations:call capsule.capsule_api_put '{"path":"example_path","payload":"example_payload","query":"example_query"}' --json kosmo integrations:capsule capsule_api_put '{"path":"example_path","payload":"example_payload","query":"example_query"}' --json capsule.capsule_create_case
Create a Capsule CRM project/case.
write - Parameters
- kase
kosmo integrations:call capsule.capsule_create_case '{"kase":"example_kase"}' --json kosmo integrations:capsule capsule_create_case '{"kase":"example_kase"}' --json 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.
write - Parameters
- type, firstName, lastName, emailAddresses
kosmo integrations:call capsule.capsule_create_contact '{"type":"example_type","firstName":"example_firstName","lastName":"example_lastName","emailAddresses":"example_emailAddresses"}' --json kosmo integrations:capsule capsule_create_contact '{"type":"example_type","firstName":"example_firstName","lastName":"example_lastName","emailAddresses":"example_emailAddresses"}' --json capsule.capsule_create_custom_field
Create a custom field definition for parties, opportunities, or cases.
write - Parameters
- entity, definition
kosmo integrations:call capsule.capsule_create_custom_field '{"entity":"example_entity","definition":"example_definition"}' --json kosmo integrations:capsule capsule_create_custom_field '{"entity":"example_entity","definition":"example_definition"}' --json capsule.capsule_create_opportunity
Create a Capsule CRM sales opportunity.
write - Parameters
- opportunity
kosmo integrations:call capsule.capsule_create_opportunity '{"opportunity":"example_opportunity"}' --json kosmo integrations:capsule capsule_create_opportunity '{"opportunity":"example_opportunity"}' --json capsule.capsule_create_tag
Create a tag definition for parties, opportunities, or cases.
write - Parameters
- entity, tag
kosmo integrations:call capsule.capsule_create_tag '{"entity":"example_entity","tag":"example_tag"}' --json kosmo integrations:capsule capsule_create_tag '{"entity":"example_entity","tag":"example_tag"}' --json capsule.capsule_create_task
Create a Capsule CRM task.
write - Parameters
- task
kosmo integrations:call capsule.capsule_create_task '{"task":"example_task"}' --json kosmo integrations:capsule capsule_create_task '{"task":"example_task"}' --json capsule.capsule_delete_case
Delete a Capsule CRM project/case.
write - Parameters
- id
kosmo integrations:call capsule.capsule_delete_case '{"id":1}' --json kosmo integrations:capsule capsule_delete_case '{"id":1}' --json capsule.capsule_delete_contact
Delete a Capsule CRM contact or organisation.
write - Parameters
- id
kosmo integrations:call capsule.capsule_delete_contact '{"id":1}' --json kosmo integrations:capsule capsule_delete_contact '{"id":1}' --json capsule.capsule_delete_custom_field
Delete a custom field definition for parties, opportunities, or cases.
write - Parameters
- entity, definition_id
kosmo integrations:call capsule.capsule_delete_custom_field '{"entity":"example_entity","definition_id":1}' --json kosmo integrations:capsule capsule_delete_custom_field '{"entity":"example_entity","definition_id":1}' --json capsule.capsule_delete_opportunity
Delete a Capsule CRM opportunity.
write - Parameters
- id
kosmo integrations:call capsule.capsule_delete_opportunity '{"id":1}' --json kosmo integrations:capsule capsule_delete_opportunity '{"id":1}' --json capsule.capsule_delete_tag
Delete a tag definition for parties, opportunities, or cases.
write - Parameters
- entity, tag_id
kosmo integrations:call capsule.capsule_delete_tag '{"entity":"example_entity","tag_id":1}' --json kosmo integrations:capsule capsule_delete_tag '{"entity":"example_entity","tag_id":1}' --json capsule.capsule_delete_task
Delete a Capsule CRM task.
write - Parameters
- id
kosmo integrations:call capsule.capsule_delete_task '{"id":1}' --json kosmo integrations:capsule capsule_delete_task '{"id":1}' --json capsule.capsule_get_case
Get one Capsule CRM project/case by ID.
read - Parameters
- id, params
kosmo integrations:call capsule.capsule_get_case '{"id":1,"params":"example_params"}' --json kosmo integrations:capsule capsule_get_case '{"id":1,"params":"example_params"}' --json capsule.capsule_get_contact
Retrieve a single contact (person or organisation) from Capsule CRM by ID.
read - Parameters
- id
kosmo integrations:call capsule.capsule_get_contact '{"id":1}' --json kosmo integrations:capsule capsule_get_contact '{"id":1}' --json capsule.capsule_get_current_user
Get the currently authenticated Capsule CRM user. Use this to verify credentials or identify the connected account.
read - Parameters
- none
kosmo integrations:call capsule.capsule_get_current_user '{}' --json kosmo integrations:capsule capsule_get_current_user '{}' --json capsule.capsule_get_opportunity
Retrieve a single sales opportunity from Capsule CRM by ID.
read - Parameters
- id
kosmo integrations:call capsule.capsule_get_opportunity '{"id":1}' --json kosmo integrations:capsule capsule_get_opportunity '{"id":1}' --json capsule.capsule_get_task
Get one Capsule CRM task by ID.
read - Parameters
- id
kosmo integrations:call capsule.capsule_get_task '{"id":1}' --json kosmo integrations:capsule capsule_get_task '{"id":1}' --json capsule.capsule_list_cases
List Capsule CRM projects/cases.
read - Parameters
- params
kosmo integrations:call capsule.capsule_list_cases '{"params":"example_params"}' --json kosmo integrations:capsule capsule_list_cases '{"params":"example_params"}' --json capsule.capsule_list_contacts
List contacts (people and organisations) from Capsule CRM. Returns paginated results with contact details.
read - Parameters
- page, per_page
kosmo integrations:call capsule.capsule_list_contacts '{"page":1,"per_page":1}' --json kosmo integrations:capsule capsule_list_contacts '{"page":1,"per_page":1}' --json capsule.capsule_list_custom_fields
List custom field definitions for parties, opportunities, or cases.
read - Parameters
- entity, params
kosmo integrations:call capsule.capsule_list_custom_fields '{"entity":"example_entity","params":"example_params"}' --json kosmo integrations:capsule capsule_list_custom_fields '{"entity":"example_entity","params":"example_params"}' --json capsule.capsule_list_opportunities
List sales opportunities from Capsule CRM. Optionally filter by status (OPEN, WON, LOST, CLOSED). Returns paginated results.
read - Parameters
- page, per_page, status
kosmo integrations:call capsule.capsule_list_opportunities '{"page":1,"per_page":1,"status":"example_status"}' --json kosmo integrations:capsule capsule_list_opportunities '{"page":1,"per_page":1,"status":"example_status"}' --json capsule.capsule_list_party_cases
List projects/cases associated with a Capsule CRM party.
read - Parameters
- party_id, params
kosmo integrations:call capsule.capsule_list_party_cases '{"party_id":1,"params":"example_params"}' --json kosmo integrations:capsule capsule_list_party_cases '{"party_id":1,"params":"example_params"}' --json capsule.capsule_list_party_opportunities
List opportunities associated with a Capsule CRM party.
read - Parameters
- party_id, params
kosmo integrations:call capsule.capsule_list_party_opportunities '{"party_id":1,"params":"example_params"}' --json kosmo integrations:capsule capsule_list_party_opportunities '{"party_id":1,"params":"example_params"}' --json capsule.capsule_list_tags
List tag definitions for parties, opportunities, or cases.
read - Parameters
- entity, params
kosmo integrations:call capsule.capsule_list_tags '{"entity":"example_entity","params":"example_params"}' --json kosmo integrations:capsule capsule_list_tags '{"entity":"example_entity","params":"example_params"}' --json capsule.capsule_list_tasks
List tasks from Capsule CRM. Optionally filter by status (OPEN, COMPLETED). Returns paginated results.
read - Parameters
- page, per_page, status
kosmo integrations:call capsule.capsule_list_tasks '{"page":1,"per_page":1,"status":"example_status"}' --json kosmo integrations:capsule capsule_list_tasks '{"page":1,"per_page":1,"status":"example_status"}' --json capsule.capsule_list_tracks
List Capsule CRM track definitions for opportunities and cases.
read - Parameters
- params
kosmo integrations:call capsule.capsule_list_tracks '{"params":"example_params"}' --json kosmo integrations:capsule capsule_list_tracks '{"params":"example_params"}' --json capsule.capsule_update_case
Update a Capsule CRM project/case.
write - Parameters
- id, kase
kosmo integrations:call capsule.capsule_update_case '{"id":1,"kase":"example_kase"}' --json kosmo integrations:capsule capsule_update_case '{"id":1,"kase":"example_kase"}' --json capsule.capsule_update_contact
Update a Capsule CRM contact or organisation using a native party payload.
write - Parameters
- id, party
kosmo integrations:call capsule.capsule_update_contact '{"id":1,"party":"example_party"}' --json kosmo integrations:capsule capsule_update_contact '{"id":1,"party":"example_party"}' --json capsule.capsule_update_custom_field
Update a custom field definition for parties, opportunities, or cases.
write - Parameters
- entity, definition_id, definition
kosmo integrations:call capsule.capsule_update_custom_field '{"entity":"example_entity","definition_id":1,"definition":"example_definition"}' --json kosmo integrations:capsule capsule_update_custom_field '{"entity":"example_entity","definition_id":1,"definition":"example_definition"}' --json capsule.capsule_update_opportunity
Update a Capsule CRM sales opportunity.
write - Parameters
- id, opportunity
kosmo integrations:call capsule.capsule_update_opportunity '{"id":1,"opportunity":"example_opportunity"}' --json kosmo integrations:capsule capsule_update_opportunity '{"id":1,"opportunity":"example_opportunity"}' --json capsule.capsule_update_tag
Update a tag definition for parties, opportunities, or cases.
write - Parameters
- entity, tag_id, tag
kosmo integrations:call capsule.capsule_update_tag '{"entity":"example_entity","tag_id":1,"tag":"example_tag"}' --json kosmo integrations:capsule capsule_update_tag '{"entity":"example_entity","tag_id":1,"tag":"example_tag"}' --json capsule.capsule_update_task
Update a Capsule CRM task.
write - Parameters
- id, task
kosmo integrations:call capsule.capsule_update_task '{"id":1,"task":"example_task"}' --json kosmo integrations:capsule capsule_update_task '{"id":1,"task":"example_task"}' --json Function Schemas
Use these parameter tables when building CLI payloads without calling integrations:schema first.
capsule.capsule_api_delete 2 parameters
kosmo integrations:schema capsule.capsule_api_delete --json | Parameter | Type | Required | Description |
|---|---|---|---|
path | string | yes | Relative API path below /api/v2. |
query | object | no | Optional query parameters. |
capsule.capsule_api_get 2 parameters
kosmo integrations:schema capsule.capsule_api_get --json | Parameter | Type | Required | Description |
|---|---|---|---|
path | string | yes | Relative API path below /api/v2. |
query | object | no | Optional query parameters. |
capsule.capsule_api_post 3 parameters
kosmo integrations:schema capsule.capsule_api_post --json | Parameter | Type | Required | Description |
|---|---|---|---|
path | string | yes | Relative API path below /api/v2. |
payload | object | no | JSON request body. |
query | object | no | Optional query parameters. |
capsule.capsule_api_put 3 parameters
kosmo integrations:schema capsule.capsule_api_put --json | Parameter | Type | Required | Description |
|---|---|---|---|
path | string | yes | Relative API path below /api/v2. |
payload | object | no | JSON request body. |
query | object | no | Optional query parameters. |
capsule.capsule_create_case 1 parameters
kosmo integrations:schema capsule.capsule_create_case --json | Parameter | Type | Required | Description |
|---|---|---|---|
kase | object | yes | Case payload. |
capsule.capsule_create_contact 4 parameters
kosmo integrations:schema capsule.capsule_create_contact --json | Parameter | Type | Required | Description |
|---|---|---|---|
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":"user@example.com"}]. |
capsule.capsule_create_custom_field 2 parameters
kosmo integrations:schema capsule.capsule_create_custom_field --json | Parameter | Type | Required | Description |
|---|---|---|---|
entity | string | yes | parties, opportunities, or kases. |
definition | object | yes | Custom field definition payload. |
capsule.capsule_create_opportunity 1 parameters
kosmo integrations:schema capsule.capsule_create_opportunity --json | Parameter | Type | Required | Description |
|---|---|---|---|
opportunity | object | yes | Opportunity payload. |
capsule.capsule_create_tag 2 parameters
kosmo integrations:schema capsule.capsule_create_tag --json | Parameter | Type | Required | Description |
|---|---|---|---|
entity | string | yes | parties, opportunities, or kases. |
tag | object | yes | Tag payload. |
capsule.capsule_create_task 1 parameters
kosmo integrations:schema capsule.capsule_create_task --json | Parameter | Type | Required | Description |
|---|---|---|---|
task | object | yes | Task payload. |
capsule.capsule_delete_case 1 parameters
kosmo integrations:schema capsule.capsule_delete_case --json | Parameter | Type | Required | Description |
|---|---|---|---|
id | integer | yes | Case ID. |
capsule.capsule_delete_contact 1 parameters
kosmo integrations:schema capsule.capsule_delete_contact --json | Parameter | Type | Required | Description |
|---|---|---|---|
id | integer | yes | Party ID. |
capsule.capsule_delete_custom_field 2 parameters
kosmo integrations:schema capsule.capsule_delete_custom_field --json | Parameter | Type | Required | Description |
|---|---|---|---|
entity | string | yes | parties, opportunities, or kases. |
definition_id | integer | yes | Definition ID. |
capsule.capsule_delete_opportunity 1 parameters
kosmo integrations:schema capsule.capsule_delete_opportunity --json | Parameter | Type | Required | Description |
|---|---|---|---|
id | integer | yes | Opportunity ID. |
capsule.capsule_delete_tag 2 parameters
kosmo integrations:schema capsule.capsule_delete_tag --json | Parameter | Type | Required | Description |
|---|---|---|---|
entity | string | yes | parties, opportunities, or kases. |
tag_id | integer | yes | Tag ID. |
capsule.capsule_delete_task 1 parameters
kosmo integrations:schema capsule.capsule_delete_task --json | Parameter | Type | Required | Description |
|---|---|---|---|
id | integer | yes | Task ID. |
capsule.capsule_get_case 2 parameters
kosmo integrations:schema capsule.capsule_get_case --json | Parameter | Type | Required | Description |
|---|---|---|---|
id | integer | yes | Case ID. |
params | object | no | Optional query parameters such as embed. |
capsule.capsule_get_contact 1 parameters
kosmo integrations:schema capsule.capsule_get_contact --json | Parameter | Type | Required | Description |
|---|---|---|---|
id | integer | yes | The contact (party) ID. |
capsule.capsule_get_current_user 0 parameters
kosmo integrations:schema capsule.capsule_get_current_user --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
capsule.capsule_get_opportunity 1 parameters
kosmo integrations:schema capsule.capsule_get_opportunity --json | Parameter | Type | Required | Description |
|---|---|---|---|
id | integer | yes | The opportunity ID. |
capsule.capsule_get_task 1 parameters
kosmo integrations:schema capsule.capsule_get_task --json | Parameter | Type | Required | Description |
|---|---|---|---|
id | integer | yes | Task ID. |
capsule.capsule_list_cases 1 parameters
kosmo integrations:schema capsule.capsule_list_cases --json | Parameter | Type | Required | Description |
|---|---|---|---|
params | object | no | Optional query parameters such as page, perPage, q, since, status, and embed. |
capsule.capsule_list_contacts 2 parameters
kosmo integrations:schema capsule.capsule_list_contacts --json | Parameter | Type | Required | Description |
|---|---|---|---|
page | integer | no | Page number for pagination (default: 1). |
per_page | integer | no | Number of contacts per page, max 100 (default: 50). |
capsule.capsule_list_custom_fields 2 parameters
kosmo integrations:schema capsule.capsule_list_custom_fields --json | Parameter | Type | Required | Description |
|---|---|---|---|
entity | string | yes | parties, opportunities, or kases. |
params | object | no | Optional query parameters. |
capsule.capsule_list_opportunities 3 parameters
kosmo integrations:schema capsule.capsule_list_opportunities --json | Parameter | Type | Required | Description |
|---|---|---|---|
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_list_party_cases 2 parameters
kosmo integrations:schema capsule.capsule_list_party_cases --json | Parameter | Type | Required | Description |
|---|---|---|---|
party_id | integer | yes | Party ID. |
params | object | no | Optional query parameters. |
capsule.capsule_list_party_opportunities 2 parameters
kosmo integrations:schema capsule.capsule_list_party_opportunities --json | Parameter | Type | Required | Description |
|---|---|---|---|
party_id | integer | yes | Party ID. |
params | object | no | Optional query parameters such as page, perPage, and embed. |
capsule.capsule_list_tags 2 parameters
kosmo integrations:schema capsule.capsule_list_tags --json | Parameter | Type | Required | Description |
|---|---|---|---|
entity | string | yes | parties, opportunities, or kases. |
params | object | no | Optional query parameters. |
capsule.capsule_list_tasks 3 parameters
kosmo integrations:schema capsule.capsule_list_tasks --json | Parameter | Type | Required | Description |
|---|---|---|---|
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_list_tracks 1 parameters
kosmo integrations:schema capsule.capsule_list_tracks --json | Parameter | Type | Required | Description |
|---|---|---|---|
params | object | no | Optional query parameters. |
capsule.capsule_update_case 2 parameters
kosmo integrations:schema capsule.capsule_update_case --json | Parameter | Type | Required | Description |
|---|---|---|---|
id | integer | yes | Case ID. |
kase | object | yes | Case update payload. |
capsule.capsule_update_contact 2 parameters
kosmo integrations:schema capsule.capsule_update_contact --json | Parameter | Type | Required | Description |
|---|---|---|---|
id | integer | yes | Party ID. |
party | object | yes | Party update payload. |
capsule.capsule_update_custom_field 3 parameters
kosmo integrations:schema capsule.capsule_update_custom_field --json | Parameter | Type | Required | Description |
|---|---|---|---|
entity | string | yes | parties, opportunities, or kases. |
definition_id | integer | yes | Definition ID. |
definition | object | yes | Custom field definition update payload. |
capsule.capsule_update_opportunity 2 parameters
kosmo integrations:schema capsule.capsule_update_opportunity --json | Parameter | Type | Required | Description |
|---|---|---|---|
id | integer | yes | Opportunity ID. |
opportunity | object | yes | Opportunity update payload. |
capsule.capsule_update_tag 3 parameters
kosmo integrations:schema capsule.capsule_update_tag --json | Parameter | Type | Required | Description |
|---|---|---|---|
entity | string | yes | parties, opportunities, or kases. |
tag_id | integer | yes | Tag ID. |
tag | object | yes | Tag update payload. |
capsule.capsule_update_task 2 parameters
kosmo integrations:schema capsule.capsule_update_task --json | Parameter | Type | Required | Description |
|---|---|---|---|
id | integer | yes | Task ID. |
task | object | yes | Task update payload. |
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.