communication
Discord CLI for Shell Scripts
Use the Discord CLI for shell scripts with headless JSON commands, schema discovery, credentials, and permission controls.
7 functions 6 read 1 write Bearer token auth
Discord CLI for Shell Scripts
Call integration functions from shell scripts with stable JSON input and output.
Use shell scripts for small local automations that need one or more integration calls. The Discord CLI uses the same integration registry as the TUI, Lua runtime, and MCP gateway, but returns predictable command output for automation.
Command Shape
# Discord CLI for Shell Scripts
kosmokrator integrations:configure discord --set access_token="$DISCORD_ACCESS_TOKEN" --enable --read allow --write ask --json
kosmo integrations:call discord.discord_list_channels '{"guild_id":"example_guild_id"}' --json Discovery Before Execution
Agents and scripts can inspect Discord docs and schemas before choosing a function.
kosmo integrations:docs discord --json
kosmo integrations:docs discord.discord_list_channels --json
kosmo integrations:schema discord.discord_list_channels --json
kosmo integrations:search "Discord" --json
kosmo integrations:list --json Useful Discord CLI Functions
| Function | Type | Parameters | Description |
|---|---|---|---|
discord.discord_list_channels | Read | guild_id | List all channels in a Discord guild. Returns channel IDs, names, types, and topics. |
discord.discord_get_channel | Read | channel_id | Get information about a Discord channel by its ID. Returns the channel's ID, name, type, topic, and other properties. |
discord.discord_send_message | Write | channel_id, content, embeds, tts | Send a message to a Discord channel. Supports text content and rich embeds. Returns the sent message ID and channel ID. |
discord.discord_list_messages | Read | channel_id, limit, before, after | Get messages from a Discord channel. Supports pagination with before/after and limit. Returns message IDs, content, author info, and timestamps. |
discord.discord_list_guilds | Read | limit, before, after | 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. |
discord.discord_get_guild | Read | guild_id | Get information about a Discord guild by its ID. Returns the guild's ID, name, icon, description, member count, and other properties. |
discord.discord_get_current_user | Read | none | 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. |
Automation Notes
- Use
--jsonfor machine-readable output. - Keep credentials out of argv by using environment variables or stored KosmoKrator configuration.
- Configure read/write policy before unattended runs; use
--forceonly for trusted automation. - Use the MCP gateway instead when the agent needs dynamic tool discovery inside a conversation.