KosmoKrator

productivity

Discord CLI for AI Agents

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

Discord CLI Setup

Discord can be configured headlessly with `kosmokrator integrations:configure discord`.

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 discord --enable --read allow --write ask --json
kosmokrator integrations:doctor discord --json
kosmokrator integrations:status --json

Credentials

Authentication type: bearer or bot token bearer_or_bot_token. 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 discord.discord_api_get '{}' --json
Provider shortcut
kosmo integrations:discord discord_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 discord --json
kosmo integrations:docs discord.discord_api_get --json
kosmo integrations:schema discord.discord_api_get --json
kosmo integrations:search "Discord" --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.

discord.discord_api_get

Execute a raw Discord API GET request.

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

discord.discord_api_post

Execute a raw Discord API POST request.

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

discord.discord_api_patch

Execute a raw Discord API PATCH request.

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

discord.discord_api_put

Execute a raw Discord API PUT request.

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

discord.discord_api_delete

Execute a raw Discord API DELETE request.

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

discord.discord_list_guilds

List guilds the current Discord user is a member of. Returns guild IDs, names, icons, and owner status. Use limit, before, and after for pagination.

Read read
Parameters
limit, before, after
Generic call
kosmo integrations:call discord.discord_list_guilds '{"limit":1,"before":"example_before","after":"example_after"}' --json
Shortcut
kosmo integrations:discord discord_list_guilds '{"limit":1,"before":"example_before","after":"example_after"}' --json

discord.discord_get_guild

Get information about a Discord guild by its ID. Returns the guild's ID, name, icon, description, member count, and other properties.

Read read
Parameters
guild_id
Generic call
kosmo integrations:call discord.discord_get_guild '{"guild_id":"example_guild_id"}' --json
Shortcut
kosmo integrations:discord discord_get_guild '{"guild_id":"example_guild_id"}' --json

discord.discord_list_channels

List all channels in a Discord guild. Returns channel IDs, names, types, and topics.

Read read
Parameters
guild_id
Generic call
kosmo integrations:call discord.discord_list_channels '{"guild_id":"example_guild_id"}' --json
Shortcut
kosmo integrations:discord discord_list_channels '{"guild_id":"example_guild_id"}' --json

discord.discord_create_guild_channel

Create a channel in a Discord guild.

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

discord.discord_get_channel

Get information about a Discord channel by its ID. Returns the channel's ID, name, type, topic, and other properties.

Read read
Parameters
channel_id
Generic call
kosmo integrations:call discord.discord_get_channel '{"channel_id":"example_channel_id"}' --json
Shortcut
kosmo integrations:discord discord_get_channel '{"channel_id":"example_channel_id"}' --json

discord.discord_edit_channel

Edit a Discord channel.

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

discord.discord_delete_channel

Delete a Discord guild channel or close a DM.

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

discord.discord_edit_channel_positions

Modify Discord guild channel positions.

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

discord.discord_list_messages

Get messages from a Discord channel. Supports pagination with before/after and limit. Returns message IDs, content, author info, and timestamps.

Read read
Parameters
channel_id, limit, before, after
Generic call
kosmo integrations:call discord.discord_list_messages '{"channel_id":"example_channel_id","limit":1,"before":"example_before","after":"example_after"}' --json
Shortcut
kosmo integrations:discord discord_list_messages '{"channel_id":"example_channel_id","limit":1,"before":"example_before","after":"example_after"}' --json

discord.discord_send_message

Send a message to a Discord channel. Supports text content and rich embeds. Returns the sent message ID and channel ID.

Write write
Parameters
channel_id, content, embeds, tts
Generic call
kosmo integrations:call discord.discord_send_message '{"channel_id":"example_channel_id","content":"example_content","embeds":"example_embeds","tts":true}' --json
Shortcut
kosmo integrations:discord discord_send_message '{"channel_id":"example_channel_id","content":"example_content","embeds":"example_embeds","tts":true}' --json

discord.discord_get_message

Get one Discord message.

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

discord.discord_edit_message

Edit a Discord message.

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

discord.discord_delete_message

Delete a Discord message.

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

discord.discord_bulk_delete_messages

Bulk delete Discord messages.

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

discord.discord_list_pinned_messages

List pinned messages in a Discord channel.

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

discord.discord_pin_message

Pin a Discord message.

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

discord.discord_unpin_message

Unpin a Discord message.

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

discord.discord_create_reaction

Add a reaction to a Discord message.

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

discord.discord_delete_own_reaction

Delete the current user reaction from a Discord message.

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

discord.discord_list_reaction_users

List users who reacted with an emoji.

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

discord.discord_list_guild_members

List members in a Discord guild.

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

discord.discord_get_guild_member

Get a Discord guild member.

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

discord.discord_edit_guild_member

Edit a Discord guild member.

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

discord.discord_kick_guild_member

Kick a member from a Discord guild.

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

discord.discord_add_guild_member_role

Add a role to a Discord guild member.

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

discord.discord_remove_guild_member_role

Remove a role from a Discord guild member.

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

discord.discord_list_guild_roles

List roles in a Discord guild.

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

discord.discord_create_guild_role

Create a Discord guild role.

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

discord.discord_edit_guild_role

Edit a Discord guild role.

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

discord.discord_delete_guild_role

Delete a Discord guild role.

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

discord.discord_list_guild_bans

List bans in a Discord guild.

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

discord.discord_create_guild_ban

Ban a user from a Discord guild.

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

discord.discord_remove_guild_ban

Remove a ban from a Discord guild.

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

discord.discord_list_guild_invites

List invites for a Discord guild.

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

discord.discord_create_channel_invite

Create a Discord channel invite.

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

discord.discord_get_invite

Get a Discord invite.

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

discord.discord_delete_invite

Delete a Discord invite.

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

discord.discord_list_channel_webhooks

List webhooks for a Discord channel.

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

discord.discord_list_guild_webhooks

List webhooks for a Discord guild.

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

discord.discord_create_webhook

Create a Discord webhook.

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

discord.discord_get_webhook

Get a Discord webhook.

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

discord.discord_edit_webhook

Edit a Discord webhook.

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

discord.discord_delete_webhook

Delete a Discord webhook.

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

discord.discord_get_current_user

Retrieve the currently authenticated Discord user. Returns the user's ID, username, discriminator, and avatar. Useful for identifying which account or token is in use.

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

Function Schemas

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

discord.discord_api_get 0 parameters
Schema command
kosmo integrations:schema discord.discord_api_get --json
ParameterTypeRequiredDescription
No parameters.
discord.discord_api_post 0 parameters
Schema command
kosmo integrations:schema discord.discord_api_post --json
ParameterTypeRequiredDescription
No parameters.
discord.discord_api_patch 0 parameters
Schema command
kosmo integrations:schema discord.discord_api_patch --json
ParameterTypeRequiredDescription
No parameters.
discord.discord_api_put 0 parameters
Schema command
kosmo integrations:schema discord.discord_api_put --json
ParameterTypeRequiredDescription
No parameters.
discord.discord_api_delete 0 parameters
Schema command
kosmo integrations:schema discord.discord_api_delete --json
ParameterTypeRequiredDescription
No parameters.
discord.discord_list_guilds 3 parameters
Schema command
kosmo integrations:schema discord.discord_list_guilds --json
ParameterTypeRequiredDescription
limit integer no Number of guilds to retrieve (1-200, default 200).
before string no Guild ID to get guilds before (for pagination).
after string no Guild ID to get guilds after (for pagination).
discord.discord_get_guild 1 parameters
Schema command
kosmo integrations:schema discord.discord_get_guild --json
ParameterTypeRequiredDescription
guild_id string yes The ID of the guild to retrieve.
discord.discord_list_channels 1 parameters
Schema command
kosmo integrations:schema discord.discord_list_channels --json
ParameterTypeRequiredDescription
guild_id string yes The ID of the guild to list channels for.
discord.discord_create_guild_channel 0 parameters
Schema command
kosmo integrations:schema discord.discord_create_guild_channel --json
ParameterTypeRequiredDescription
No parameters.
discord.discord_get_channel 1 parameters
Schema command
kosmo integrations:schema discord.discord_get_channel --json
ParameterTypeRequiredDescription
channel_id string yes The ID of the channel to retrieve.
discord.discord_edit_channel 0 parameters
Schema command
kosmo integrations:schema discord.discord_edit_channel --json
ParameterTypeRequiredDescription
No parameters.
discord.discord_delete_channel 0 parameters
Schema command
kosmo integrations:schema discord.discord_delete_channel --json
ParameterTypeRequiredDescription
No parameters.
discord.discord_edit_channel_positions 0 parameters
Schema command
kosmo integrations:schema discord.discord_edit_channel_positions --json
ParameterTypeRequiredDescription
No parameters.
discord.discord_list_messages 4 parameters
Schema command
kosmo integrations:schema discord.discord_list_messages --json
ParameterTypeRequiredDescription
channel_id string yes The ID of the channel to get messages from.
limit integer no Number of messages to retrieve (1-100, default 50).
before string no Message ID to get messages before (for pagination).
after string no Message ID to get messages after (for pagination).
discord.discord_send_message 4 parameters
Schema command
kosmo integrations:schema discord.discord_send_message --json
ParameterTypeRequiredDescription
channel_id string yes The ID of the channel to send the message to.
content string no The text content of the message.
embeds string no JSON array of embed objects for rich formatting.
tts boolean no If true, the message will be read aloud via text-to-speech.
discord.discord_get_message 0 parameters
Schema command
kosmo integrations:schema discord.discord_get_message --json
ParameterTypeRequiredDescription
No parameters.
discord.discord_edit_message 0 parameters
Schema command
kosmo integrations:schema discord.discord_edit_message --json
ParameterTypeRequiredDescription
No parameters.
discord.discord_delete_message 0 parameters
Schema command
kosmo integrations:schema discord.discord_delete_message --json
ParameterTypeRequiredDescription
No parameters.
discord.discord_bulk_delete_messages 0 parameters
Schema command
kosmo integrations:schema discord.discord_bulk_delete_messages --json
ParameterTypeRequiredDescription
No parameters.
discord.discord_list_pinned_messages 0 parameters
Schema command
kosmo integrations:schema discord.discord_list_pinned_messages --json
ParameterTypeRequiredDescription
No parameters.
discord.discord_pin_message 0 parameters
Schema command
kosmo integrations:schema discord.discord_pin_message --json
ParameterTypeRequiredDescription
No parameters.
discord.discord_unpin_message 0 parameters
Schema command
kosmo integrations:schema discord.discord_unpin_message --json
ParameterTypeRequiredDescription
No parameters.
discord.discord_create_reaction 0 parameters
Schema command
kosmo integrations:schema discord.discord_create_reaction --json
ParameterTypeRequiredDescription
No parameters.
discord.discord_delete_own_reaction 0 parameters
Schema command
kosmo integrations:schema discord.discord_delete_own_reaction --json
ParameterTypeRequiredDescription
No parameters.
discord.discord_list_reaction_users 0 parameters
Schema command
kosmo integrations:schema discord.discord_list_reaction_users --json
ParameterTypeRequiredDescription
No parameters.
discord.discord_list_guild_members 0 parameters
Schema command
kosmo integrations:schema discord.discord_list_guild_members --json
ParameterTypeRequiredDescription
No parameters.
discord.discord_get_guild_member 0 parameters
Schema command
kosmo integrations:schema discord.discord_get_guild_member --json
ParameterTypeRequiredDescription
No parameters.
discord.discord_edit_guild_member 0 parameters
Schema command
kosmo integrations:schema discord.discord_edit_guild_member --json
ParameterTypeRequiredDescription
No parameters.
discord.discord_kick_guild_member 0 parameters
Schema command
kosmo integrations:schema discord.discord_kick_guild_member --json
ParameterTypeRequiredDescription
No parameters.
discord.discord_add_guild_member_role 0 parameters
Schema command
kosmo integrations:schema discord.discord_add_guild_member_role --json
ParameterTypeRequiredDescription
No parameters.
discord.discord_remove_guild_member_role 0 parameters
Schema command
kosmo integrations:schema discord.discord_remove_guild_member_role --json
ParameterTypeRequiredDescription
No parameters.
discord.discord_list_guild_roles 0 parameters
Schema command
kosmo integrations:schema discord.discord_list_guild_roles --json
ParameterTypeRequiredDescription
No parameters.
discord.discord_create_guild_role 0 parameters
Schema command
kosmo integrations:schema discord.discord_create_guild_role --json
ParameterTypeRequiredDescription
No parameters.
discord.discord_edit_guild_role 0 parameters
Schema command
kosmo integrations:schema discord.discord_edit_guild_role --json
ParameterTypeRequiredDescription
No parameters.
discord.discord_delete_guild_role 0 parameters
Schema command
kosmo integrations:schema discord.discord_delete_guild_role --json
ParameterTypeRequiredDescription
No parameters.
discord.discord_list_guild_bans 0 parameters
Schema command
kosmo integrations:schema discord.discord_list_guild_bans --json
ParameterTypeRequiredDescription
No parameters.
discord.discord_create_guild_ban 0 parameters
Schema command
kosmo integrations:schema discord.discord_create_guild_ban --json
ParameterTypeRequiredDescription
No parameters.
discord.discord_remove_guild_ban 0 parameters
Schema command
kosmo integrations:schema discord.discord_remove_guild_ban --json
ParameterTypeRequiredDescription
No parameters.
discord.discord_list_guild_invites 0 parameters
Schema command
kosmo integrations:schema discord.discord_list_guild_invites --json
ParameterTypeRequiredDescription
No parameters.
discord.discord_create_channel_invite 0 parameters
Schema command
kosmo integrations:schema discord.discord_create_channel_invite --json
ParameterTypeRequiredDescription
No parameters.
discord.discord_get_invite 0 parameters
Schema command
kosmo integrations:schema discord.discord_get_invite --json
ParameterTypeRequiredDescription
No parameters.
discord.discord_delete_invite 0 parameters
Schema command
kosmo integrations:schema discord.discord_delete_invite --json
ParameterTypeRequiredDescription
No parameters.
discord.discord_list_channel_webhooks 0 parameters
Schema command
kosmo integrations:schema discord.discord_list_channel_webhooks --json
ParameterTypeRequiredDescription
No parameters.
discord.discord_list_guild_webhooks 0 parameters
Schema command
kosmo integrations:schema discord.discord_list_guild_webhooks --json
ParameterTypeRequiredDescription
No parameters.
discord.discord_create_webhook 0 parameters
Schema command
kosmo integrations:schema discord.discord_create_webhook --json
ParameterTypeRequiredDescription
No parameters.
discord.discord_get_webhook 0 parameters
Schema command
kosmo integrations:schema discord.discord_get_webhook --json
ParameterTypeRequiredDescription
No parameters.
discord.discord_edit_webhook 0 parameters
Schema command
kosmo integrations:schema discord.discord_edit_webhook --json
ParameterTypeRequiredDescription
No parameters.
discord.discord_delete_webhook 0 parameters
Schema command
kosmo integrations:schema discord.discord_delete_webhook --json
ParameterTypeRequiredDescription
No parameters.
discord.discord_get_current_user 0 parameters
Schema command
kosmo integrations:schema discord.discord_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.