Skip to main content

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.

PyPI version License: MIT Python 3.9+ CI skills.sh

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 jq for 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

  1. Create a bot at the Discord Developer Portal
  2. Add it to your server with the permissions you need
  3. 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 inspection
  • message — send, edit, react, purge, and fetch messages
  • guild — guild profile, emojis, stickers, bans, and prune flows
  • member — list, info, kick, ban, timeout, nickname, and role checks
  • role — create, edit, assign, remove, and inspect roles
  • permissions — per-channel permission overwrites
  • webhook, threads, invite, category, search, and export — the rest of the automation surface

Documentation

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)

Source distribution for discordcli-agents 1.4.0
File Size Uploaded
discordcli_agents-1.4.0.tar.gz 70.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for discordcli-agents 1.4.0
File Interpreter ABI Platform
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 log

Release 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

Release history Release notifications | RSS feed

This release

1.4.0 This release

2 release files

1.3.0

2 release files

1.2.1

2 release files

1.2.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page