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

Current release: 1.2.1 (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

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"

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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

discordcli_agents-1.3.0.tar.gz (64.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

discordcli_agents-1.3.0-py3-none-any.whl (40.1 kB view details)

Uploaded Python 3

File details

Details for the file discordcli_agents-1.3.0.tar.gz.

File metadata

  • Download URL: discordcli_agents-1.3.0.tar.gz
  • Upload date:
  • Size: 64.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for discordcli_agents-1.3.0.tar.gz
Algorithm Hash digest
SHA256 3dd51d141bf2a11c10d28167c51624d112f70c922e49998d20d0773a65646301
MD5 e87967d4400fbfbd31e9920238155ae0
BLAKE2b-256 f8b15024f8112ba484a3d39e0ce8e35241ef812cb2ce6d23f3c5b745c763813f

See more details on using hashes here.

Provenance

The following attestation bundles were made for discordcli_agents-1.3.0.tar.gz:

Publisher: release.yml on 1solomonwakhungu/discord-cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file discordcli_agents-1.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for discordcli_agents-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 85938ba226b98cc8ff0cafb1bdb22c4dd2d406a6873bb94de7c7b4ce69c3717f
MD5 15eb407e392c614e59a1c4b3f39ce5ce
BLAKE2b-256 0017763e379884a10c6b612e6630b7a0d3c8fce8bb0134f201633fe711016fc0

See more details on using hashes here.

Provenance

The following attestation bundles were made for discordcli_agents-1.3.0-py3-none-any.whl:

Publisher: release.yml on 1solomonwakhungu/discord-cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

1.3.0 This release

2 files

1.2.1

2 files

1.2.0

2 files

0.1.1

2 files

0.1.0

2 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