discord-cli
discord-cli is a headless, scriptable Discord CLI for automation and AI-agent workflows. It connects with a Discord bot token, runs a single command, and exits; command output is JSON by default so you can pipe it into jq, save it in CI logs, or call it from shell scripts and local agents.
Current release: 1.4.0 (PyPI)
Why discord-cli?
- Script Discord operations from shell, cron, GitHub Actions, or an AI agent
- Keep the bot token and workflow logic outside a long-running service process
- Use JSON output for automation and
jqfor filtering without custom glue code
Install
Command-line tool
pip install discordcli-agents
# or
npx discordcli-agents
The installed command is discord-cli.
A man page ships with the package, so after a pip or pipx install you can read
the full reference offline:
man discord-cli
If your shell cannot find it (some virtualenv layouts are not on the default
MANPATH), point man at the file directly:
man "$(python -c 'import sysconfig; print(sysconfig.get_path("data"))')/share/man/man1/discord-cli.1"
Agent skill
Install the repository's discord-cli-server-management skill with the open skills CLI:
npx skills add 1solomonwakhungu/discord-cli --skill discord-cli-server-management
The skill is listed on skills.sh and works with Codex, Claude Code, Cursor, GitHub Copilot, and other agents supported by the skills CLI.
Quick setup
- Create a bot at the Discord Developer Portal
- Add it to your server with the permissions you need
- Export a token:
export DISCORD_BOT_TOKEN="your-bot-token-here"
Or create a .env file in the same directory:
echo 'DISCORD_BOT_TOKEN=your-bot-token-here' > .env
Quick start
# Server info
discord-cli guild info
# List channels
discord-cli channel list
# Create a channel
discord-cli channel create "announcements" --type text --topic "Server announcements"
# Send a message
discord-cli message send 123456789012345678 --content "Hello from the CLI!"
# Export channel history
discord-cli export channel 123456789012345678 --limit 500 --format json > history.json
Recipes
Use the ready-to-copy examples in docs/recipes.md for:
- GitHub Actions notifications
- Scheduled maintenance and status checks
- Server/channel export and backup
- Bulk role and permission changes
- Claude/Codex and generic terminal-agent workflows
Need a deeper AI-agent workflow guide? See docs/ai-agents.md.
Command groups
channel— channel management and inspectionmessage— send, edit, react, purge, and fetch messagesguild— guild profile, emojis, stickers, bans, and prune flowsmember— list, info, kick, ban, timeout, nickname, and role checksrole— create, edit, assign, remove, and inspect rolespermissions— per-channel permission overwriteswebhook,threads,invite,category,search, andexport— the rest of the automation surface
Documentation
man discord-cli— the complete command reference, also readable in the repo at docs/man/discord-cli.1- Recipes
- AI agent integration
- Plugin guide
- Contributing guide
License
This project is licensed under the MIT License. See LICENSE for details.
Metadata
Release files for discordcli-agents 1.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| discordcli_agents-1.4.0.tar.gz | 70.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| discordcli_agents-1.4.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 110.4 kB
Release files / discordcli_agents-1.4.0.tar.gz
| Download URL | discordcli_agents-1.4.0.tar.gz |
|---|---|
| Size | 70.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
54f54bcea5770a30ed10619fb0206a50772b36fa3af8a9d6e7e2d56551528572
|
|
BLAKE2b-256 checksum How to use checksums |
62284f906186061a1d9fe638d3dae034f9eaf55e6408e0224a9b79c9aec0fed7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 14, 2026.
Transparency logRelease files / discordcli_agents-1.4.0-py3-none-any.whl
| Download URL | discordcli_agents-1.4.0-py3-none-any.whl |
|---|---|
| Size | 40.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
56420352112757e6df1d03d2c3e5f598ec6aa220127d2814290efa4aa5c59a72
|
|
BLAKE2b-256 checksum How to use checksums |
2b6d7c89142e3d8fd3988926756955f0b186ba5ae3a951e83bfcc708cb23a378
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 14, 2026.
Transparency log