KosmoKrator

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, 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 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.

Generic CLI call
kosmo integrations:call clerk.clerk_api_get '{}' --json
Provider shortcut
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.

Discovery commands
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 read
Parameters
none
Generic call
kosmo integrations:call clerk.clerk_api_get '{}' --json
Shortcut
kosmo integrations:clerk clerk_api_get '{}' --json

clerk.clerk_api_post

Execute a raw Clerk Backend API POST request.

Write write
Parameters
none
Generic call
kosmo integrations:call clerk.clerk_api_post '{}' --json
Shortcut
kosmo integrations:clerk clerk_api_post '{}' --json

clerk.clerk_api_patch

Execute a raw Clerk Backend API PATCH request.

Write write
Parameters
none
Generic call
kosmo integrations:call clerk.clerk_api_patch '{}' --json
Shortcut
kosmo integrations:clerk clerk_api_patch '{}' --json

clerk.clerk_api_delete

Execute a raw Clerk Backend API DELETE request.

Write write
Parameters
none
Generic call
kosmo integrations:call clerk.clerk_api_delete '{}' --json
Shortcut
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 read
Parameters
limit, offset, email_address, phone_number, query, order_by
Generic call
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
Shortcut
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 read
Parameters
none
Generic call
kosmo integrations:call clerk.clerk_count_users '{}' --json
Shortcut
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 read
Parameters
id
Generic call
kosmo integrations:call clerk.clerk_get_user '{"id":"example_id"}' --json
Shortcut
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 write
Parameters
email_address, first_name, last_name, password, username
Generic call
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
Shortcut
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 write
Parameters
id, first_name, last_name, username
Generic call
kosmo integrations:call clerk.clerk_update_user '{"id":"example_id","first_name":"example_first_name","last_name":"example_last_name","username":"example_username"}' --json
Shortcut
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 write
Parameters
id
Generic call
kosmo integrations:call clerk.clerk_delete_user '{"id":"example_id"}' --json
Shortcut
kosmo integrations:clerk clerk_delete_user '{"id":"example_id"}' --json

clerk.clerk_ban_user

Ban a Clerk user.

Write write
Parameters
none
Generic call
kosmo integrations:call clerk.clerk_ban_user '{}' --json
Shortcut
kosmo integrations:clerk clerk_ban_user '{}' --json

clerk.clerk_unban_user

Unban a Clerk user.

Write write
Parameters
none
Generic call
kosmo integrations:call clerk.clerk_unban_user '{}' --json
Shortcut
kosmo integrations:clerk clerk_unban_user '{}' --json

clerk.clerk_lock_user

Lock a Clerk user.

Write write
Parameters
none
Generic call
kosmo integrations:call clerk.clerk_lock_user '{}' --json
Shortcut
kosmo integrations:clerk clerk_lock_user '{}' --json

clerk.clerk_unlock_user

Unlock a Clerk user.

Write write
Parameters
none
Generic call
kosmo integrations:call clerk.clerk_unlock_user '{}' --json
Shortcut
kosmo integrations:clerk clerk_unlock_user '{}' --json

clerk.clerk_list_sessions

List Clerk sessions.

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

clerk.clerk_get_session

Get a Clerk session.

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

clerk.clerk_revoke_session

Revoke a Clerk session.

Write write
Parameters
none
Generic call
kosmo integrations:call clerk.clerk_revoke_session '{}' --json
Shortcut
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 read
Parameters
limit, offset, query
Generic call
kosmo integrations:call clerk.clerk_list_organizations '{"limit":1,"offset":1,"query":"example_query"}' --json
Shortcut
kosmo integrations:clerk clerk_list_organizations '{"limit":1,"offset":1,"query":"example_query"}' --json

clerk.clerk_create_organization

Create a Clerk organization.

Write write
Parameters
none
Generic call
kosmo integrations:call clerk.clerk_create_organization '{}' --json
Shortcut
kosmo integrations:clerk clerk_create_organization '{}' --json

clerk.clerk_get_organization

Get a Clerk organization.

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

clerk.clerk_update_organization

Update a Clerk organization.

Write write
Parameters
none
Generic call
kosmo integrations:call clerk.clerk_update_organization '{}' --json
Shortcut
kosmo integrations:clerk clerk_update_organization '{}' --json

clerk.clerk_delete_organization

Delete a Clerk organization.

Write write
Parameters
none
Generic call
kosmo integrations:call clerk.clerk_delete_organization '{}' --json
Shortcut
kosmo integrations:clerk clerk_delete_organization '{}' --json

clerk.clerk_list_organization_memberships

List memberships for a Clerk organization.

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

clerk.clerk_create_organization_membership

Add a user to a Clerk organization.

Write write
Parameters
none
Generic call
kosmo integrations:call clerk.clerk_create_organization_membership '{}' --json
Shortcut
kosmo integrations:clerk clerk_create_organization_membership '{}' --json

clerk.clerk_update_organization_membership

Update a Clerk organization membership.

Write write
Parameters
none
Generic call
kosmo integrations:call clerk.clerk_update_organization_membership '{}' --json
Shortcut
kosmo integrations:clerk clerk_update_organization_membership '{}' --json

clerk.clerk_delete_organization_membership

Remove a user from a Clerk organization.

Write write
Parameters
none
Generic call
kosmo integrations:call clerk.clerk_delete_organization_membership '{}' --json
Shortcut
kosmo integrations:clerk clerk_delete_organization_membership '{}' --json

clerk.clerk_list_organization_invitations

List invitations for a Clerk organization.

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

clerk.clerk_create_organization_invitation

Create an invitation for a Clerk organization.

Write write
Parameters
none
Generic call
kosmo integrations:call clerk.clerk_create_organization_invitation '{}' --json
Shortcut
kosmo integrations:clerk clerk_create_organization_invitation '{}' --json

clerk.clerk_revoke_organization_invitation

Revoke a Clerk organization invitation.

Write write
Parameters
none
Generic call
kosmo integrations:call clerk.clerk_revoke_organization_invitation '{}' --json
Shortcut
kosmo integrations:clerk clerk_revoke_organization_invitation '{}' --json

clerk.clerk_list_invitations

List Clerk application invitations.

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

clerk.clerk_create_invitation

Create a Clerk application invitation.

Write write
Parameters
none
Generic call
kosmo integrations:call clerk.clerk_create_invitation '{}' --json
Shortcut
kosmo integrations:clerk clerk_create_invitation '{}' --json

clerk.clerk_revoke_invitation

Revoke a Clerk application invitation.

Write write
Parameters
none
Generic call
kosmo integrations:call clerk.clerk_revoke_invitation '{}' --json
Shortcut
kosmo integrations:clerk clerk_revoke_invitation '{}' --json

clerk.clerk_create_sign_in_token

Create a Clerk sign-in token.

Write write
Parameters
none
Generic call
kosmo integrations:call clerk.clerk_create_sign_in_token '{}' --json
Shortcut
kosmo integrations:clerk clerk_create_sign_in_token '{}' --json

clerk.clerk_revoke_sign_in_token

Revoke a Clerk sign-in token.

Write write
Parameters
none
Generic call
kosmo integrations:call clerk.clerk_revoke_sign_in_token '{}' --json
Shortcut
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 read
Parameters
none
Generic call
kosmo integrations:call clerk.clerk_get_current_user '{}' --json
Shortcut
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
Schema command
kosmo integrations:schema clerk.clerk_api_get --json
ParameterTypeRequiredDescription
No parameters.
clerk.clerk_api_post 0 parameters
Schema command
kosmo integrations:schema clerk.clerk_api_post --json
ParameterTypeRequiredDescription
No parameters.
clerk.clerk_api_patch 0 parameters
Schema command
kosmo integrations:schema clerk.clerk_api_patch --json
ParameterTypeRequiredDescription
No parameters.
clerk.clerk_api_delete 0 parameters
Schema command
kosmo integrations:schema clerk.clerk_api_delete --json
ParameterTypeRequiredDescription
No parameters.
clerk.clerk_list_users 6 parameters
Schema command
kosmo integrations:schema clerk.clerk_list_users --json
ParameterTypeRequiredDescription
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
Schema command
kosmo integrations:schema clerk.clerk_count_users --json
ParameterTypeRequiredDescription
No parameters.
clerk.clerk_get_user 1 parameters
Schema command
kosmo integrations:schema clerk.clerk_get_user --json
ParameterTypeRequiredDescription
id string yes The Clerk user ID (e.g., "user_2abc123").
clerk.clerk_create_user 5 parameters
Schema command
kosmo integrations:schema clerk.clerk_create_user --json
ParameterTypeRequiredDescription
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
Schema command
kosmo integrations:schema clerk.clerk_update_user --json
ParameterTypeRequiredDescription
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
Schema command
kosmo integrations:schema clerk.clerk_delete_user --json
ParameterTypeRequiredDescription
id string yes The Clerk user ID to delete (e.g., "user_2abc123").
clerk.clerk_ban_user 0 parameters
Schema command
kosmo integrations:schema clerk.clerk_ban_user --json
ParameterTypeRequiredDescription
No parameters.
clerk.clerk_unban_user 0 parameters
Schema command
kosmo integrations:schema clerk.clerk_unban_user --json
ParameterTypeRequiredDescription
No parameters.
clerk.clerk_lock_user 0 parameters
Schema command
kosmo integrations:schema clerk.clerk_lock_user --json
ParameterTypeRequiredDescription
No parameters.
clerk.clerk_unlock_user 0 parameters
Schema command
kosmo integrations:schema clerk.clerk_unlock_user --json
ParameterTypeRequiredDescription
No parameters.
clerk.clerk_list_sessions 0 parameters
Schema command
kosmo integrations:schema clerk.clerk_list_sessions --json
ParameterTypeRequiredDescription
No parameters.
clerk.clerk_get_session 0 parameters
Schema command
kosmo integrations:schema clerk.clerk_get_session --json
ParameterTypeRequiredDescription
No parameters.
clerk.clerk_revoke_session 0 parameters
Schema command
kosmo integrations:schema clerk.clerk_revoke_session --json
ParameterTypeRequiredDescription
No parameters.
clerk.clerk_list_organizations 3 parameters
Schema command
kosmo integrations:schema clerk.clerk_list_organizations --json
ParameterTypeRequiredDescription
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
Schema command
kosmo integrations:schema clerk.clerk_create_organization --json
ParameterTypeRequiredDescription
No parameters.
clerk.clerk_get_organization 0 parameters
Schema command
kosmo integrations:schema clerk.clerk_get_organization --json
ParameterTypeRequiredDescription
No parameters.
clerk.clerk_update_organization 0 parameters
Schema command
kosmo integrations:schema clerk.clerk_update_organization --json
ParameterTypeRequiredDescription
No parameters.
clerk.clerk_delete_organization 0 parameters
Schema command
kosmo integrations:schema clerk.clerk_delete_organization --json
ParameterTypeRequiredDescription
No parameters.
clerk.clerk_list_organization_memberships 0 parameters
Schema command
kosmo integrations:schema clerk.clerk_list_organization_memberships --json
ParameterTypeRequiredDescription
No parameters.
clerk.clerk_create_organization_membership 0 parameters
Schema command
kosmo integrations:schema clerk.clerk_create_organization_membership --json
ParameterTypeRequiredDescription
No parameters.
clerk.clerk_update_organization_membership 0 parameters
Schema command
kosmo integrations:schema clerk.clerk_update_organization_membership --json
ParameterTypeRequiredDescription
No parameters.
clerk.clerk_delete_organization_membership 0 parameters
Schema command
kosmo integrations:schema clerk.clerk_delete_organization_membership --json
ParameterTypeRequiredDescription
No parameters.
clerk.clerk_list_organization_invitations 0 parameters
Schema command
kosmo integrations:schema clerk.clerk_list_organization_invitations --json
ParameterTypeRequiredDescription
No parameters.
clerk.clerk_create_organization_invitation 0 parameters
Schema command
kosmo integrations:schema clerk.clerk_create_organization_invitation --json
ParameterTypeRequiredDescription
No parameters.
clerk.clerk_revoke_organization_invitation 0 parameters
Schema command
kosmo integrations:schema clerk.clerk_revoke_organization_invitation --json
ParameterTypeRequiredDescription
No parameters.
clerk.clerk_list_invitations 0 parameters
Schema command
kosmo integrations:schema clerk.clerk_list_invitations --json
ParameterTypeRequiredDescription
No parameters.
clerk.clerk_create_invitation 0 parameters
Schema command
kosmo integrations:schema clerk.clerk_create_invitation --json
ParameterTypeRequiredDescription
No parameters.
clerk.clerk_revoke_invitation 0 parameters
Schema command
kosmo integrations:schema clerk.clerk_revoke_invitation --json
ParameterTypeRequiredDescription
No parameters.
clerk.clerk_create_sign_in_token 0 parameters
Schema command
kosmo integrations:schema clerk.clerk_create_sign_in_token --json
ParameterTypeRequiredDescription
No parameters.
clerk.clerk_revoke_sign_in_token 0 parameters
Schema command
kosmo integrations:schema clerk.clerk_revoke_sign_in_token --json
ParameterTypeRequiredDescription
No parameters.
clerk.clerk_get_current_user 0 parameters
Schema command
kosmo integrations:schema clerk.clerk_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.