productivity
Knock CLI for AI Agents
Use the Knock CLI from KosmoKrator to call Knock tools headlessly, return JSON, inspect schemas, and automate workflows from coding agents, scripts, and CI.Knock CLI Setup
Knock can be configured headlessly with `kosmokrator integrations:configure knock`.
# 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 knock --set api_key="$KNOCK_API_KEY" --enable --read allow --write ask --json
kosmokrator integrations:doctor knock --json
kosmokrator integrations:status --json Credentials
Authentication type: API key api_key. Configure credentials once, then reuse the same stored profile from scripts, coding CLIs, Lua, and MCP.
| Key | Env var | Type | Required | Label |
|---|---|---|---|---|
api_key | KNOCK_API_KEY | Secret secret | yes | API Key |
url | KNOCK_URL | URL url | no | Knock URL |
Command Patterns
The generic command is stable across every integration. The provider shortcut is shorter for humans.
kosmo integrations:call knock.knock_list_workflows '{"limit":1,"page":1}' --json kosmo integrations:knock knock_list_workflows '{"limit":1,"page":1}' --json Discovery
These commands return structured output for coding agents that need to inspect capabilities before choosing a function.
kosmo integrations:docs knock --json
kosmo integrations:docs knock.knock_list_workflows --json
kosmo integrations:schema knock.knock_list_workflows --json
kosmo integrations:search "Knock" --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.
knock.knock_list_workflows
List notification workflows from Knock. Returns workflow IDs and details you can use to trigger or inspect workflows.
read - Parameters
- limit, page
kosmo integrations:call knock.knock_list_workflows '{"limit":1,"page":1}' --json kosmo integrations:knock knock_list_workflows '{"limit":1,"page":1}' --json knock.knock_get_workflow
Get details of a specific notification workflow in Knock, including its steps and configuration.
read - Parameters
- id
kosmo integrations:call knock.knock_get_workflow '{"id":"example_id"}' --json kosmo integrations:knock knock_get_workflow '{"id":"example_id"}' --json knock.knock_trigger_workflow
Trigger a notification workflow in Knock for one or more recipients. The workflow will execute its configured steps (email, Slack, in-app, etc.) for each recipient.
write - Parameters
- id, recipients, data, cancellation_criteria
kosmo integrations:call knock.knock_trigger_workflow '{"id":"example_id","recipients":"example_recipients","data":"example_data","cancellation_criteria":"example_cancellation_criteria"}' --json kosmo integrations:knock knock_trigger_workflow '{"id":"example_id","recipients":"example_recipients","data":"example_data","cancellation_criteria":"example_cancellation_criteria"}' --json knock.knock_list_messages
List notification messages from Knock. Optionally filter by delivery status (e.g., sent, delivered, undelivered).
read - Parameters
- limit, page, status
kosmo integrations:call knock.knock_list_messages '{"limit":1,"page":1,"status":"example_status"}' --json kosmo integrations:knock knock_list_messages '{"limit":1,"page":1,"status":"example_status"}' --json knock.knock_get_message
Get details of a specific notification message in Knock, including its content, delivery status, and channel.
read - Parameters
- id
kosmo integrations:call knock.knock_get_message '{"id":"example_id"}' --json kosmo integrations:knock knock_get_message '{"id":"example_id"}' --json knock.knock_list_recipients
List notification recipients from Knock. Returns recipient identifiers and their preferences.
read - Parameters
- limit, page
kosmo integrations:call knock.knock_list_recipients '{"limit":1,"page":1}' --json kosmo integrations:knock knock_list_recipients '{"limit":1,"page":1}' --json knock.knock_get_current_user
Get the currently authenticated Knock user. Useful for verifying API credentials and inspecting account details.
read - Parameters
- none
kosmo integrations:call knock.knock_get_current_user '{}' --json kosmo integrations:knock knock_get_current_user '{}' --json Function Schemas
Use these parameter tables when building CLI payloads without calling integrations:schema first.
knock.knock_list_workflows 2 parameters
kosmo integrations:schema knock.knock_list_workflows --json | Parameter | Type | Required | Description |
|---|---|---|---|
limit | integer | no | Maximum number of workflows to return (default: 25). |
page | integer | no | Page number for pagination. |
knock.knock_get_workflow 1 parameters
kosmo integrations:schema knock.knock_get_workflow --json | Parameter | Type | Required | Description |
|---|---|---|---|
id | string | yes | The workflow ID. |
knock.knock_trigger_workflow 4 parameters
kosmo integrations:schema knock.knock_trigger_workflow --json | Parameter | Type | Required | Description |
|---|---|---|---|
id | string | yes | The workflow ID to trigger. |
recipients | array | yes | Array of recipient identifiers (user IDs or emails) to receive the notification. |
data | array | no | Payload data to pass to the workflow. Used in notification templates as merge variables. |
cancellation_criteria | array | no | Cancellation criteria for the workflow run. Allows automatic cancellation based on conditions. |
knock.knock_list_messages 3 parameters
kosmo integrations:schema knock.knock_list_messages --json | Parameter | Type | Required | Description |
|---|---|---|---|
limit | integer | no | Maximum number of messages to return (default: 25). |
page | integer | no | Page number for pagination. |
status | string | no | Filter by message status: sent, delivered, undelivered, or opened. |
knock.knock_get_message 1 parameters
kosmo integrations:schema knock.knock_get_message --json | Parameter | Type | Required | Description |
|---|---|---|---|
id | string | yes | The message ID. |
knock.knock_list_recipients 2 parameters
kosmo integrations:schema knock.knock_list_recipients --json | Parameter | Type | Required | Description |
|---|---|---|---|
limit | integer | no | Maximum number of recipients to return (default: 25). |
page | integer | no | Page number for pagination. |
knock.knock_get_current_user 0 parameters
kosmo integrations:schema knock.knock_get_current_user --json | Parameter | Type | Required | Description |
|---|---|---|---|
| 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.