KosmoKrator

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, configure, and verify
# 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.

KeyEnv varTypeRequiredLabel
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.

Generic CLI call
kosmo integrations:call capsule.capsule_api_delete '{"path":"example_path","query":"example_query"}' --json
Provider shortcut
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.

Discovery commands
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 read
Parameters
path, query
Generic call
kosmo integrations:call capsule.capsule_api_delete '{"path":"example_path","query":"example_query"}' --json
Shortcut
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 read
Parameters
path, query
Generic call
kosmo integrations:call capsule.capsule_api_get '{"path":"example_path","query":"example_query"}' --json
Shortcut
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 read
Parameters
path, payload, query
Generic call
kosmo integrations:call capsule.capsule_api_post '{"path":"example_path","payload":"example_payload","query":"example_query"}' --json
Shortcut
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 read
Parameters
path, payload, query
Generic call
kosmo integrations:call capsule.capsule_api_put '{"path":"example_path","payload":"example_payload","query":"example_query"}' --json
Shortcut
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 write
Parameters
kase
Generic call
kosmo integrations:call capsule.capsule_create_case '{"kase":"example_kase"}' --json
Shortcut
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 write
Parameters
type, firstName, lastName, emailAddresses
Generic call
kosmo integrations:call capsule.capsule_create_contact '{"type":"example_type","firstName":"example_firstName","lastName":"example_lastName","emailAddresses":"example_emailAddresses"}' --json
Shortcut
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 write
Parameters
entity, definition
Generic call
kosmo integrations:call capsule.capsule_create_custom_field '{"entity":"example_entity","definition":"example_definition"}' --json
Shortcut
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 write
Parameters
opportunity
Generic call
kosmo integrations:call capsule.capsule_create_opportunity '{"opportunity":"example_opportunity"}' --json
Shortcut
kosmo integrations:capsule capsule_create_opportunity '{"opportunity":"example_opportunity"}' --json

capsule.capsule_create_tag

Create a tag definition for parties, opportunities, or cases.

Write write
Parameters
entity, tag
Generic call
kosmo integrations:call capsule.capsule_create_tag '{"entity":"example_entity","tag":"example_tag"}' --json
Shortcut
kosmo integrations:capsule capsule_create_tag '{"entity":"example_entity","tag":"example_tag"}' --json

capsule.capsule_create_task

Create a Capsule CRM task.

Write write
Parameters
task
Generic call
kosmo integrations:call capsule.capsule_create_task '{"task":"example_task"}' --json
Shortcut
kosmo integrations:capsule capsule_create_task '{"task":"example_task"}' --json

capsule.capsule_delete_case

Delete a Capsule CRM project/case.

Write write
Parameters
id
Generic call
kosmo integrations:call capsule.capsule_delete_case '{"id":1}' --json
Shortcut
kosmo integrations:capsule capsule_delete_case '{"id":1}' --json

capsule.capsule_delete_contact

Delete a Capsule CRM contact or organisation.

Write write
Parameters
id
Generic call
kosmo integrations:call capsule.capsule_delete_contact '{"id":1}' --json
Shortcut
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 write
Parameters
entity, definition_id
Generic call
kosmo integrations:call capsule.capsule_delete_custom_field '{"entity":"example_entity","definition_id":1}' --json
Shortcut
kosmo integrations:capsule capsule_delete_custom_field '{"entity":"example_entity","definition_id":1}' --json

capsule.capsule_delete_opportunity

Delete a Capsule CRM opportunity.

Write write
Parameters
id
Generic call
kosmo integrations:call capsule.capsule_delete_opportunity '{"id":1}' --json
Shortcut
kosmo integrations:capsule capsule_delete_opportunity '{"id":1}' --json

capsule.capsule_delete_tag

Delete a tag definition for parties, opportunities, or cases.

Write write
Parameters
entity, tag_id
Generic call
kosmo integrations:call capsule.capsule_delete_tag '{"entity":"example_entity","tag_id":1}' --json
Shortcut
kosmo integrations:capsule capsule_delete_tag '{"entity":"example_entity","tag_id":1}' --json

capsule.capsule_delete_task

Delete a Capsule CRM task.

Write write
Parameters
id
Generic call
kosmo integrations:call capsule.capsule_delete_task '{"id":1}' --json
Shortcut
kosmo integrations:capsule capsule_delete_task '{"id":1}' --json

capsule.capsule_get_case

Get one Capsule CRM project/case by ID.

Read read
Parameters
id, params
Generic call
kosmo integrations:call capsule.capsule_get_case '{"id":1,"params":"example_params"}' --json
Shortcut
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 read
Parameters
id
Generic call
kosmo integrations:call capsule.capsule_get_contact '{"id":1}' --json
Shortcut
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 read
Parameters
none
Generic call
kosmo integrations:call capsule.capsule_get_current_user '{}' --json
Shortcut
kosmo integrations:capsule capsule_get_current_user '{}' --json

capsule.capsule_get_opportunity

Retrieve a single sales opportunity from Capsule CRM by ID.

Read read
Parameters
id
Generic call
kosmo integrations:call capsule.capsule_get_opportunity '{"id":1}' --json
Shortcut
kosmo integrations:capsule capsule_get_opportunity '{"id":1}' --json

capsule.capsule_get_task

Get one Capsule CRM task by ID.

Read read
Parameters
id
Generic call
kosmo integrations:call capsule.capsule_get_task '{"id":1}' --json
Shortcut
kosmo integrations:capsule capsule_get_task '{"id":1}' --json

capsule.capsule_list_cases

List Capsule CRM projects/cases.

Read read
Parameters
params
Generic call
kosmo integrations:call capsule.capsule_list_cases '{"params":"example_params"}' --json
Shortcut
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 read
Parameters
page, per_page
Generic call
kosmo integrations:call capsule.capsule_list_contacts '{"page":1,"per_page":1}' --json
Shortcut
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 read
Parameters
entity, params
Generic call
kosmo integrations:call capsule.capsule_list_custom_fields '{"entity":"example_entity","params":"example_params"}' --json
Shortcut
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 read
Parameters
page, per_page, status
Generic call
kosmo integrations:call capsule.capsule_list_opportunities '{"page":1,"per_page":1,"status":"example_status"}' --json
Shortcut
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 read
Parameters
party_id, params
Generic call
kosmo integrations:call capsule.capsule_list_party_cases '{"party_id":1,"params":"example_params"}' --json
Shortcut
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 read
Parameters
party_id, params
Generic call
kosmo integrations:call capsule.capsule_list_party_opportunities '{"party_id":1,"params":"example_params"}' --json
Shortcut
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 read
Parameters
entity, params
Generic call
kosmo integrations:call capsule.capsule_list_tags '{"entity":"example_entity","params":"example_params"}' --json
Shortcut
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 read
Parameters
page, per_page, status
Generic call
kosmo integrations:call capsule.capsule_list_tasks '{"page":1,"per_page":1,"status":"example_status"}' --json
Shortcut
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 read
Parameters
params
Generic call
kosmo integrations:call capsule.capsule_list_tracks '{"params":"example_params"}' --json
Shortcut
kosmo integrations:capsule capsule_list_tracks '{"params":"example_params"}' --json

capsule.capsule_update_case

Update a Capsule CRM project/case.

Write write
Parameters
id, kase
Generic call
kosmo integrations:call capsule.capsule_update_case '{"id":1,"kase":"example_kase"}' --json
Shortcut
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 write
Parameters
id, party
Generic call
kosmo integrations:call capsule.capsule_update_contact '{"id":1,"party":"example_party"}' --json
Shortcut
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 write
Parameters
entity, definition_id, definition
Generic call
kosmo integrations:call capsule.capsule_update_custom_field '{"entity":"example_entity","definition_id":1,"definition":"example_definition"}' --json
Shortcut
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 write
Parameters
id, opportunity
Generic call
kosmo integrations:call capsule.capsule_update_opportunity '{"id":1,"opportunity":"example_opportunity"}' --json
Shortcut
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 write
Parameters
entity, tag_id, tag
Generic call
kosmo integrations:call capsule.capsule_update_tag '{"entity":"example_entity","tag_id":1,"tag":"example_tag"}' --json
Shortcut
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 write
Parameters
id, task
Generic call
kosmo integrations:call capsule.capsule_update_task '{"id":1,"task":"example_task"}' --json
Shortcut
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
Schema command
kosmo integrations:schema capsule.capsule_api_delete --json
ParameterTypeRequiredDescription
path string yes Relative API path below /api/v2.
query object no Optional query parameters.
capsule.capsule_api_get 2 parameters
Schema command
kosmo integrations:schema capsule.capsule_api_get --json
ParameterTypeRequiredDescription
path string yes Relative API path below /api/v2.
query object no Optional query parameters.
capsule.capsule_api_post 3 parameters
Schema command
kosmo integrations:schema capsule.capsule_api_post --json
ParameterTypeRequiredDescription
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
Schema command
kosmo integrations:schema capsule.capsule_api_put --json
ParameterTypeRequiredDescription
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
Schema command
kosmo integrations:schema capsule.capsule_create_case --json
ParameterTypeRequiredDescription
kase object yes Case payload.
capsule.capsule_create_contact 4 parameters
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":"user@example.com"}].
capsule.capsule_create_custom_field 2 parameters
Schema command
kosmo integrations:schema capsule.capsule_create_custom_field --json
ParameterTypeRequiredDescription
entity string yes parties, opportunities, or kases.
definition object yes Custom field definition payload.
capsule.capsule_create_opportunity 1 parameters
Schema command
kosmo integrations:schema capsule.capsule_create_opportunity --json
ParameterTypeRequiredDescription
opportunity object yes Opportunity payload.
capsule.capsule_create_tag 2 parameters
Schema command
kosmo integrations:schema capsule.capsule_create_tag --json
ParameterTypeRequiredDescription
entity string yes parties, opportunities, or kases.
tag object yes Tag payload.
capsule.capsule_create_task 1 parameters
Schema command
kosmo integrations:schema capsule.capsule_create_task --json
ParameterTypeRequiredDescription
task object yes Task payload.
capsule.capsule_delete_case 1 parameters
Schema command
kosmo integrations:schema capsule.capsule_delete_case --json
ParameterTypeRequiredDescription
id integer yes Case ID.
capsule.capsule_delete_contact 1 parameters
Schema command
kosmo integrations:schema capsule.capsule_delete_contact --json
ParameterTypeRequiredDescription
id integer yes Party ID.
capsule.capsule_delete_custom_field 2 parameters
Schema command
kosmo integrations:schema capsule.capsule_delete_custom_field --json
ParameterTypeRequiredDescription
entity string yes parties, opportunities, or kases.
definition_id integer yes Definition ID.
capsule.capsule_delete_opportunity 1 parameters
Schema command
kosmo integrations:schema capsule.capsule_delete_opportunity --json
ParameterTypeRequiredDescription
id integer yes Opportunity ID.
capsule.capsule_delete_tag 2 parameters
Schema command
kosmo integrations:schema capsule.capsule_delete_tag --json
ParameterTypeRequiredDescription
entity string yes parties, opportunities, or kases.
tag_id integer yes Tag ID.
capsule.capsule_delete_task 1 parameters
Schema command
kosmo integrations:schema capsule.capsule_delete_task --json
ParameterTypeRequiredDescription
id integer yes Task ID.
capsule.capsule_get_case 2 parameters
Schema command
kosmo integrations:schema capsule.capsule_get_case --json
ParameterTypeRequiredDescription
id integer yes Case ID.
params object no Optional query parameters such as embed.
capsule.capsule_get_contact 1 parameters
Schema command
kosmo integrations:schema capsule.capsule_get_contact --json
ParameterTypeRequiredDescription
id integer yes The contact (party) ID.
capsule.capsule_get_current_user 0 parameters
Schema command
kosmo integrations:schema capsule.capsule_get_current_user --json
ParameterTypeRequiredDescription
No parameters.
capsule.capsule_get_opportunity 1 parameters
Schema command
kosmo integrations:schema capsule.capsule_get_opportunity --json
ParameterTypeRequiredDescription
id integer yes The opportunity ID.
capsule.capsule_get_task 1 parameters
Schema command
kosmo integrations:schema capsule.capsule_get_task --json
ParameterTypeRequiredDescription
id integer yes Task ID.
capsule.capsule_list_cases 1 parameters
Schema command
kosmo integrations:schema capsule.capsule_list_cases --json
ParameterTypeRequiredDescription
params object no Optional query parameters such as page, perPage, q, since, status, and embed.
capsule.capsule_list_contacts 2 parameters
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_list_custom_fields 2 parameters
Schema command
kosmo integrations:schema capsule.capsule_list_custom_fields --json
ParameterTypeRequiredDescription
entity string yes parties, opportunities, or kases.
params object no Optional query parameters.
capsule.capsule_list_opportunities 3 parameters
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_list_party_cases 2 parameters
Schema command
kosmo integrations:schema capsule.capsule_list_party_cases --json
ParameterTypeRequiredDescription
party_id integer yes Party ID.
params object no Optional query parameters.
capsule.capsule_list_party_opportunities 2 parameters
Schema command
kosmo integrations:schema capsule.capsule_list_party_opportunities --json
ParameterTypeRequiredDescription
party_id integer yes Party ID.
params object no Optional query parameters such as page, perPage, and embed.
capsule.capsule_list_tags 2 parameters
Schema command
kosmo integrations:schema capsule.capsule_list_tags --json
ParameterTypeRequiredDescription
entity string yes parties, opportunities, or kases.
params object no Optional query parameters.
capsule.capsule_list_tasks 3 parameters
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_list_tracks 1 parameters
Schema command
kosmo integrations:schema capsule.capsule_list_tracks --json
ParameterTypeRequiredDescription
params object no Optional query parameters.
capsule.capsule_update_case 2 parameters
Schema command
kosmo integrations:schema capsule.capsule_update_case --json
ParameterTypeRequiredDescription
id integer yes Case ID.
kase object yes Case update payload.
capsule.capsule_update_contact 2 parameters
Schema command
kosmo integrations:schema capsule.capsule_update_contact --json
ParameterTypeRequiredDescription
id integer yes Party ID.
party object yes Party update payload.
capsule.capsule_update_custom_field 3 parameters
Schema command
kosmo integrations:schema capsule.capsule_update_custom_field --json
ParameterTypeRequiredDescription
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
Schema command
kosmo integrations:schema capsule.capsule_update_opportunity --json
ParameterTypeRequiredDescription
id integer yes Opportunity ID.
opportunity object yes Opportunity update payload.
capsule.capsule_update_tag 3 parameters
Schema command
kosmo integrations:schema capsule.capsule_update_tag --json
ParameterTypeRequiredDescription
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
Schema command
kosmo integrations:schema capsule.capsule_update_task --json
ParameterTypeRequiredDescription
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.