KosmoKrator

productivity

Keap CLI for AI Agents

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

Keap CLI Setup

Keap can be configured headlessly with `kosmokrator integrations:configure keap`.

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 keap --set access_token="$KEAP_ACCESS_TOKEN" --enable --read allow --write ask --json
kosmokrator integrations:doctor keap --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 KEAP_ACCESS_TOKEN Secret secret yes Access Token
url KEAP_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 keap.keap_list_contacts '{"page":1,"limit":1}' --json
Provider shortcut
kosmo integrations:keap keap_list_contacts '{"page":1,"limit":1}' --json

Discovery

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

Discovery commands
kosmo integrations:docs keap --json
kosmo integrations:docs keap.keap_list_contacts --json
kosmo integrations:schema keap.keap_list_contacts --json
kosmo integrations:search "Keap" --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.

keap.keap_list_contacts

List contacts from Keap CRM. Returns paginated results with contact details including name, email, and company.

Read read
Parameters
page, limit
Generic call
kosmo integrations:call keap.keap_list_contacts '{"page":1,"limit":1}' --json
Shortcut
kosmo integrations:keap keap_list_contacts '{"page":1,"limit":1}' --json

keap.keap_get_contact

Retrieve a single Keap contact by ID. Returns full contact details including email addresses, phone numbers, and tags.

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

keap.keap_create_contact

Create a new contact in Keap CRM. Provide at least a first name or last name. Email and company name are optional.

Write write
Parameters
first_name, last_name, email, company_name
Generic call
kosmo integrations:call keap.keap_create_contact '{"first_name":"example_first_name","last_name":"example_last_name","email":"example_email","company_name":"example_company_name"}' --json
Shortcut
kosmo integrations:keap keap_create_contact '{"first_name":"example_first_name","last_name":"example_last_name","email":"example_email","company_name":"example_company_name"}' --json

keap.keap_list_opportunities

List sales opportunities from Keap CRM. Optionally filter by pipeline stage. Returns paginated results with opportunity details.

Read read
Parameters
page, limit, stage
Generic call
kosmo integrations:call keap.keap_list_opportunities '{"page":1,"limit":1,"stage":"example_stage"}' --json
Shortcut
kosmo integrations:keap keap_list_opportunities '{"page":1,"limit":1,"stage":"example_stage"}' --json

keap.keap_get_opportunity

Retrieve a single Keap sales opportunity by ID. Returns full details including contact, stage, value, and notes.

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

keap.keap_list_tags

List all tags in Keap. Tags are used to categorize contacts and trigger automations.

Read read
Parameters
none
Generic call
kosmo integrations:call keap.keap_list_tags '{}' --json
Shortcut
kosmo integrations:keap keap_list_tags '{}' --json

keap.keap_get_current_user

Get the currently authenticated Keap user. Returns profile information for the user associated with the access token.

Read read
Parameters
none
Generic call
kosmo integrations:call keap.keap_get_current_user '{}' --json
Shortcut
kosmo integrations:keap keap_get_current_user '{}' --json

Function Schemas

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

keap.keap_list_contacts 2 parameters
Schema command
kosmo integrations:schema keap.keap_list_contacts --json
ParameterTypeRequiredDescription
page integer no Page number for pagination (default: 1).
limit integer no Number of contacts per page (default: 20, max: 200).
keap.keap_get_contact 1 parameters
Schema command
kosmo integrations:schema keap.keap_get_contact --json
ParameterTypeRequiredDescription
id integer yes The Keap contact ID.
keap.keap_create_contact 4 parameters
Schema command
kosmo integrations:schema keap.keap_create_contact --json
ParameterTypeRequiredDescription
first_name string no First name of the contact.
last_name string no Last name of the contact.
email string no Primary email address for the contact.
company_name string no Company name to associate with the contact.
keap.keap_list_opportunities 3 parameters
Schema command
kosmo integrations:schema keap.keap_list_opportunities --json
ParameterTypeRequiredDescription
page integer no Page number for pagination (default: 1).
limit integer no Number of opportunities per page (default: 20, max: 200).
stage string no Filter by opportunity stage (e.g., "New", "Appointment Scheduled", "Closed Won", "Closed Lost").
keap.keap_get_opportunity 1 parameters
Schema command
kosmo integrations:schema keap.keap_get_opportunity --json
ParameterTypeRequiredDescription
id integer yes The Keap opportunity ID.
keap.keap_list_tags 0 parameters
Schema command
kosmo integrations:schema keap.keap_list_tags --json
ParameterTypeRequiredDescription
No parameters.
keap.keap_get_current_user 0 parameters
Schema command
kosmo integrations:schema keap.keap_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.