Quickstart
Go from zero to sending Discord messages in under 2 minutes. This guide assumes you have already installed discli and have a Discord bot token. If you need a token, follow the Your First Bot guide first.
Set your bot token
Store your Discord bot token so discli can authenticate:
discli config set token YOUR_BOT_TOKENSet token.This saves the token to ~/.discli/config.json. You only need to do this once.
You can also pass the token per-command with --token YOUR_BOT_TOKEN or set the DISCORD_BOT_TOKEN environment variable. See Configuration for details.
Send a message
Send a message to a channel your bot has access to:
discli message send "#general" "Hello from discli!"Message sent to #general (ID: 1234567890123456789)Check your Discord server — the message should appear in the channel.
Channel identifiers: You can reference channels by name with a # prefix (e.g., #general) or by their raw numeric ID (e.g., 1234567890123456789). Channel names are matched within the server the bot has access to. If your bot is in multiple servers with identically named channels, use the numeric ID to be precise.
Read messages
Fetch the most recent messages from a channel:
discli message list "#general" --limit 5[2026-03-15 10:32] discli-bot: Hello from discli![2026-03-15 10:30] Alice: Has anyone tried the new CLI tool?[2026-03-15 10:28] Bob: Good morning everyone![2026-03-15 10:15] Alice: Welcome to the server![2026-03-15 09:45] Bob: Hey folksThe output shows the most recent messages, newest first, with timestamps and authors.
Try JSON output
Add the --json flag to get structured output, perfect for piping to other tools or feeding to an AI agent:
discli --json message list "#general" --limit 3[ { "id": "1234567890123456789", "author": "discli-bot", "author_id": "9876543210987654321", "content": "Hello from discli!", "timestamp": "2026-03-15T10:32:00+00:00", "channel": "general", "channel_id": "1111111111111111111", "is_bot": true }, { "id": "1234567890123456780", "author": "Alice", "author_id": "2222222222222222222", "content": "Has anyone tried the new CLI tool?", "timestamp": "2026-03-15T10:30:00+00:00", "channel": "general", "channel_id": "1111111111111111111", "is_bot": false }, { "id": "1234567890123456770", "author": "Bob", "author_id": "3333333333333333333", "content": "Good morning everyone!", "timestamp": "2026-03-15T10:28:00+00:00", "channel": "general", "channel_id": "1111111111111111111", "is_bot": false }]The --json flag works with every command. It is placed before the subcommand: discli --json message list, not discli message list --json.
What else can you do?
Here are a few more commands to try:
# List servers your bot is indiscli server list
# List channels in a serverdiscli channel list "My Server"
# Send a DM to a userdiscli dm send @username "Hey there!"
# React to a messagediscli reaction add "#general" MESSAGE_ID "👍"
# Search messagesdiscli message search "#general" "search term"
# Start a real-time event streamdiscli listenRun discli --help or discli <command> --help to explore all available commands and options.
Next steps
Your First Bot
Build a working Discord bot agent from scratch with discli serve.
Configuration
Learn about token management, permission profiles, and config options.
CLI Usage Guide
Deep dive into all available commands and day-to-day usage patterns.
Building Agents
Build progressively more autonomous AI agents on top of discli.