productivity
Clerk CLI for AI Agents
Use the Clerk CLI from KosmoKrator to call Clerk tools headlessly, return JSON, inspect schemas, and automate workflows from coding agents, scripts, and CI.Clerk CLI Setup
Clerk can be configured headlessly with `kosmokrator integrations:configure clerk`.
# 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 clerk --enable --read allow --write ask --json
kosmokrator integrations:doctor clerk --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.
No credentials are required.
Command Patterns
The generic command is stable across every integration. The provider shortcut is shorter for humans.
kosmo integrations:call clerk.clerk_api_get '{}' --json kosmo integrations:clerk clerk_api_get '{}' --json Discovery
These commands return structured output for coding agents that need to inspect capabilities before choosing a function.
kosmo integrations:docs clerk --json
kosmo integrations:docs clerk.clerk_api_get --json
kosmo integrations:schema clerk.clerk_api_get --json
kosmo integrations:search "Clerk" --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.
clerk.clerk_api_get
Execute a raw Clerk Backend API GET request.
read - Parameters
- none
kosmo integrations:call clerk.clerk_api_get '{}' --json kosmo integrations:clerk clerk_api_get '{}' --json clerk.clerk_api_post
Execute a raw Clerk Backend API POST request.
write - Parameters
- none
kosmo integrations:call clerk.clerk_api_post '{}' --json kosmo integrations:clerk clerk_api_post '{}' --json clerk.clerk_api_patch
Execute a raw Clerk Backend API PATCH request.
write - Parameters
- none
kosmo integrations:call clerk.clerk_api_patch '{}' --json kosmo integrations:clerk clerk_api_patch '{}' --json clerk.clerk_api_delete
Execute a raw Clerk Backend API DELETE request.
write - Parameters
- none
kosmo integrations:call clerk.clerk_api_delete '{}' --json kosmo integrations:clerk clerk_api_delete '{}' --json clerk.clerk_list_users
List users from Clerk with optional filtering and pagination. Returns user IDs, emails, names, and profile details.
read - Parameters
- limit, offset, email_address, phone_number, query, order_by
kosmo integrations:call clerk.clerk_list_users '{"limit":1,"offset":1,"email_address":"example_email_address","phone_number":"example_phone_number","query":"example_query","order_by":"example_order_by"}' --json kosmo integrations:clerk clerk_list_users '{"limit":1,"offset":1,"email_address":"example_email_address","phone_number":"example_phone_number","query":"example_query","order_by":"example_order_by"}' --json clerk.clerk_count_users
Count Clerk users with optional filters.
read - Parameters
- none
kosmo integrations:call clerk.clerk_count_users '{}' --json kosmo integrations:clerk clerk_count_users '{}' --json clerk.clerk_get_user
Retrieve a single Clerk user by their user ID. Returns full profile details including email, name, and metadata.
read - Parameters
- id
kosmo integrations:call clerk.clerk_get_user '{"id":"example_id"}' --json kosmo integrations:clerk clerk_get_user '{"id":"example_id"}' --json clerk.clerk_create_user
Create a new user in Clerk. Requires at least one email address. Optionally set name, password, and username.
write - Parameters
- email_address, first_name, last_name, password, username
kosmo integrations:call clerk.clerk_create_user '{"email_address":"example_email_address","first_name":"example_first_name","last_name":"example_last_name","password":"example_password","username":"example_username"}' --json kosmo integrations:clerk clerk_create_user '{"email_address":"example_email_address","first_name":"example_first_name","last_name":"example_last_name","password":"example_password","username":"example_username"}' --json clerk.clerk_update_user
Update an existing Clerk user's profile. Provide the user ID and fields to update.
write - Parameters
- id, first_name, last_name, username
kosmo integrations:call clerk.clerk_update_user '{"id":"example_id","first_name":"example_first_name","last_name":"example_last_name","username":"example_username"}' --json kosmo integrations:clerk clerk_update_user '{"id":"example_id","first_name":"example_first_name","last_name":"example_last_name","username":"example_username"}' --json clerk.clerk_delete_user
Delete a user from Clerk. This action is irreversible and will remove all associated data.
write - Parameters
- id
kosmo integrations:call clerk.clerk_delete_user '{"id":"example_id"}' --json kosmo integrations:clerk clerk_delete_user '{"id":"example_id"}' --json clerk.clerk_ban_user
Ban a Clerk user.
write - Parameters
- none
kosmo integrations:call clerk.clerk_ban_user '{}' --json kosmo integrations:clerk clerk_ban_user '{}' --json clerk.clerk_unban_user
Unban a Clerk user.
write - Parameters
- none
kosmo integrations:call clerk.clerk_unban_user '{}' --json kosmo integrations:clerk clerk_unban_user '{}' --json clerk.clerk_lock_user
Lock a Clerk user.
write - Parameters
- none
kosmo integrations:call clerk.clerk_lock_user '{}' --json kosmo integrations:clerk clerk_lock_user '{}' --json clerk.clerk_unlock_user
Unlock a Clerk user.
write - Parameters
- none
kosmo integrations:call clerk.clerk_unlock_user '{}' --json kosmo integrations:clerk clerk_unlock_user '{}' --json clerk.clerk_list_sessions
List Clerk sessions.
read - Parameters
- none
kosmo integrations:call clerk.clerk_list_sessions '{}' --json kosmo integrations:clerk clerk_list_sessions '{}' --json clerk.clerk_get_session
Get a Clerk session.
read - Parameters
- none
kosmo integrations:call clerk.clerk_get_session '{}' --json kosmo integrations:clerk clerk_get_session '{}' --json clerk.clerk_revoke_session
Revoke a Clerk session.
write - Parameters
- none
kosmo integrations:call clerk.clerk_revoke_session '{}' --json kosmo integrations:clerk clerk_revoke_session '{}' --json clerk.clerk_list_organizations
List organizations from Clerk with optional filtering and pagination. Returns organization IDs, names, and metadata.
read - Parameters
- limit, offset, query
kosmo integrations:call clerk.clerk_list_organizations '{"limit":1,"offset":1,"query":"example_query"}' --json kosmo integrations:clerk clerk_list_organizations '{"limit":1,"offset":1,"query":"example_query"}' --json clerk.clerk_create_organization
Create a Clerk organization.
write - Parameters
- none
kosmo integrations:call clerk.clerk_create_organization '{}' --json kosmo integrations:clerk clerk_create_organization '{}' --json clerk.clerk_get_organization
Get a Clerk organization.
read - Parameters
- none
kosmo integrations:call clerk.clerk_get_organization '{}' --json kosmo integrations:clerk clerk_get_organization '{}' --json clerk.clerk_update_organization
Update a Clerk organization.
write - Parameters
- none
kosmo integrations:call clerk.clerk_update_organization '{}' --json kosmo integrations:clerk clerk_update_organization '{}' --json clerk.clerk_delete_organization
Delete a Clerk organization.
write - Parameters
- none
kosmo integrations:call clerk.clerk_delete_organization '{}' --json kosmo integrations:clerk clerk_delete_organization '{}' --json clerk.clerk_list_organization_memberships
List memberships for a Clerk organization.
read - Parameters
- none
kosmo integrations:call clerk.clerk_list_organization_memberships '{}' --json kosmo integrations:clerk clerk_list_organization_memberships '{}' --json clerk.clerk_create_organization_membership
Add a user to a Clerk organization.
write - Parameters
- none
kosmo integrations:call clerk.clerk_create_organization_membership '{}' --json kosmo integrations:clerk clerk_create_organization_membership '{}' --json clerk.clerk_update_organization_membership
Update a Clerk organization membership.
write - Parameters
- none
kosmo integrations:call clerk.clerk_update_organization_membership '{}' --json kosmo integrations:clerk clerk_update_organization_membership '{}' --json clerk.clerk_delete_organization_membership
Remove a user from a Clerk organization.
write - Parameters
- none
kosmo integrations:call clerk.clerk_delete_organization_membership '{}' --json kosmo integrations:clerk clerk_delete_organization_membership '{}' --json clerk.clerk_list_organization_invitations
List invitations for a Clerk organization.
read - Parameters
- none
kosmo integrations:call clerk.clerk_list_organization_invitations '{}' --json kosmo integrations:clerk clerk_list_organization_invitations '{}' --json clerk.clerk_create_organization_invitation
Create an invitation for a Clerk organization.
write - Parameters
- none
kosmo integrations:call clerk.clerk_create_organization_invitation '{}' --json kosmo integrations:clerk clerk_create_organization_invitation '{}' --json clerk.clerk_revoke_organization_invitation
Revoke a Clerk organization invitation.
write - Parameters
- none
kosmo integrations:call clerk.clerk_revoke_organization_invitation '{}' --json kosmo integrations:clerk clerk_revoke_organization_invitation '{}' --json clerk.clerk_list_invitations
List Clerk application invitations.
read - Parameters
- none
kosmo integrations:call clerk.clerk_list_invitations '{}' --json kosmo integrations:clerk clerk_list_invitations '{}' --json clerk.clerk_create_invitation
Create a Clerk application invitation.
write - Parameters
- none
kosmo integrations:call clerk.clerk_create_invitation '{}' --json kosmo integrations:clerk clerk_create_invitation '{}' --json clerk.clerk_revoke_invitation
Revoke a Clerk application invitation.
write - Parameters
- none
kosmo integrations:call clerk.clerk_revoke_invitation '{}' --json kosmo integrations:clerk clerk_revoke_invitation '{}' --json clerk.clerk_create_sign_in_token
Create a Clerk sign-in token.
write - Parameters
- none
kosmo integrations:call clerk.clerk_create_sign_in_token '{}' --json kosmo integrations:clerk clerk_create_sign_in_token '{}' --json clerk.clerk_revoke_sign_in_token
Revoke a Clerk sign-in token.
write - Parameters
- none
kosmo integrations:call clerk.clerk_revoke_sign_in_token '{}' --json kosmo integrations:clerk clerk_revoke_sign_in_token '{}' --json clerk.clerk_get_current_user
Health check - verify Clerk API connectivity by fetching the first user. Returns a single user or empty result to confirm the API is reachable.
read - Parameters
- none
kosmo integrations:call clerk.clerk_get_current_user '{}' --json kosmo integrations:clerk clerk_get_current_user '{}' --json Function Schemas
Use these parameter tables when building CLI payloads without calling integrations:schema first.
clerk.clerk_api_get 0 parameters
kosmo integrations:schema clerk.clerk_api_get --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
clerk.clerk_api_post 0 parameters
kosmo integrations:schema clerk.clerk_api_post --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
clerk.clerk_api_patch 0 parameters
kosmo integrations:schema clerk.clerk_api_patch --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
clerk.clerk_api_delete 0 parameters
kosmo integrations:schema clerk.clerk_api_delete --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
clerk.clerk_list_users 6 parameters
kosmo integrations:schema clerk.clerk_list_users --json | Parameter | Type | Required | Description |
|---|---|---|---|
limit | integer | no | Maximum number of users to return (default: 10, max: 500). |
offset | integer | no | Number of users to skip for pagination. |
email_address | string | no | Filter users by email address. |
phone_number | string | no | Filter users by phone number. |
query | string | no | Search query to filter users by name, email, or username. |
order_by | string | no | Sort order for results. Use "+created_at" for ascending or "-created_at" for descending (default: "+created_at"). |
clerk.clerk_count_users 0 parameters
kosmo integrations:schema clerk.clerk_count_users --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
clerk.clerk_get_user 1 parameters
kosmo integrations:schema clerk.clerk_get_user --json | Parameter | Type | Required | Description |
|---|---|---|---|
id | string | yes | The Clerk user ID (e.g., "user_2abc123"). |
clerk.clerk_create_user 5 parameters
kosmo integrations:schema clerk.clerk_create_user --json | Parameter | Type | Required | Description |
|---|---|---|---|
email_address | array | yes | Array of email addresses for the user. At least one is required. |
first_name | string | no | The user's first name. |
last_name | string | no | The user's last name. |
password | string | no | The user's password. Minimum 8 characters. |
username | string | no | The user's username. |
clerk.clerk_update_user 4 parameters
kosmo integrations:schema clerk.clerk_update_user --json | Parameter | Type | Required | Description |
|---|---|---|---|
id | string | yes | The Clerk user ID to update (e.g., "user_2abc123"). |
first_name | string | no | Updated first name. |
last_name | string | no | Updated last name. |
username | string | no | Updated username. |
clerk.clerk_delete_user 1 parameters
kosmo integrations:schema clerk.clerk_delete_user --json | Parameter | Type | Required | Description |
|---|---|---|---|
id | string | yes | The Clerk user ID to delete (e.g., "user_2abc123"). |
clerk.clerk_ban_user 0 parameters
kosmo integrations:schema clerk.clerk_ban_user --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
clerk.clerk_unban_user 0 parameters
kosmo integrations:schema clerk.clerk_unban_user --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
clerk.clerk_lock_user 0 parameters
kosmo integrations:schema clerk.clerk_lock_user --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
clerk.clerk_unlock_user 0 parameters
kosmo integrations:schema clerk.clerk_unlock_user --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
clerk.clerk_list_sessions 0 parameters
kosmo integrations:schema clerk.clerk_list_sessions --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
clerk.clerk_get_session 0 parameters
kosmo integrations:schema clerk.clerk_get_session --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
clerk.clerk_revoke_session 0 parameters
kosmo integrations:schema clerk.clerk_revoke_session --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
clerk.clerk_list_organizations 3 parameters
kosmo integrations:schema clerk.clerk_list_organizations --json | Parameter | Type | Required | Description |
|---|---|---|---|
limit | integer | no | Maximum number of organizations to return (default: 10, max: 500). |
offset | integer | no | Number of organizations to skip for pagination. |
query | string | no | Search query to filter organizations by name. |
clerk.clerk_create_organization 0 parameters
kosmo integrations:schema clerk.clerk_create_organization --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
clerk.clerk_get_organization 0 parameters
kosmo integrations:schema clerk.clerk_get_organization --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
clerk.clerk_update_organization 0 parameters
kosmo integrations:schema clerk.clerk_update_organization --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
clerk.clerk_delete_organization 0 parameters
kosmo integrations:schema clerk.clerk_delete_organization --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
clerk.clerk_list_organization_memberships 0 parameters
kosmo integrations:schema clerk.clerk_list_organization_memberships --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
clerk.clerk_create_organization_membership 0 parameters
kosmo integrations:schema clerk.clerk_create_organization_membership --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
clerk.clerk_update_organization_membership 0 parameters
kosmo integrations:schema clerk.clerk_update_organization_membership --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
clerk.clerk_delete_organization_membership 0 parameters
kosmo integrations:schema clerk.clerk_delete_organization_membership --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
clerk.clerk_list_organization_invitations 0 parameters
kosmo integrations:schema clerk.clerk_list_organization_invitations --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
clerk.clerk_create_organization_invitation 0 parameters
kosmo integrations:schema clerk.clerk_create_organization_invitation --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
clerk.clerk_revoke_organization_invitation 0 parameters
kosmo integrations:schema clerk.clerk_revoke_organization_invitation --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
clerk.clerk_list_invitations 0 parameters
kosmo integrations:schema clerk.clerk_list_invitations --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
clerk.clerk_create_invitation 0 parameters
kosmo integrations:schema clerk.clerk_create_invitation --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
clerk.clerk_revoke_invitation 0 parameters
kosmo integrations:schema clerk.clerk_revoke_invitation --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
clerk.clerk_create_sign_in_token 0 parameters
kosmo integrations:schema clerk.clerk_create_sign_in_token --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
clerk.clerk_revoke_sign_in_token 0 parameters
kosmo integrations:schema clerk.clerk_revoke_sign_in_token --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
clerk.clerk_get_current_user 0 parameters
kosmo integrations:schema clerk.clerk_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.