{"slug": "show-hn-discord-cli-a-headless-discord-cli-that-prints-json-and-exits", "title": "Show HN: Discord-CLI – a headless Discord CLI that prints JSON and exits", "summary": "A developer released discord-cli 1.4.0, a headless, scriptable Discord command-line tool that connects with a bot token, runs a single command, prints JSON by default and exits, targeting automation and AI-agent workflows. The package, published on PyPI as discordcli-agents and installable via pip or npx, ships a man page and a `discord-cli-server-management` skill that works with Codex, Claude Code, Cursor and GitHub Copilot through the open skills CLI. Commands cover channels, messages, guilds, members, roles, permissions, webhooks, threads, invites, categories, search and channel export, under the MIT License.", "body_md": "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.\n\nCurrent release: 1.4.0 ([PyPI](https://pypi.org/project/discordcli-agents/))\n\n- Script Discord operations from shell, cron, GitHub Actions, or an AI agent\n- Keep the bot token and workflow logic outside a long-running service process\n- Use JSON output for automation and `jq` for filtering without custom glue code\n\n```\npip install discordcli-agents\n# or\nnpx discordcli-agents\n```\n\nThe installed command is `discord-cli`.\n\nA man page ships with the package, so after a `pip` or `pipx` install you can read\nthe full reference offline:\n\n```\nman discord-cli\n```\n\nIf your shell cannot find it (some virtualenv layouts are not on the default\n`MANPATH`), point `man` at the file directly:\n\n``` python\nman \"$(python -c 'import sysconfig; print(sysconfig.get_path(\"data\"))')/share/man/man1/discord-cli.1\"\n```\n\nInstall the repository's `discord-cli-server-management` skill with the open skills CLI:\n\n```\nnpx skills add 1solomonwakhungu/discord-cli --skill discord-cli-server-management\n```\n\nThe skill is listed on\n[skills.sh](https://skills.sh/1solomonwakhungu/discord-cli/discord-cli-server-management) and works with Codex,\nClaude Code, Cursor, GitHub Copilot, and other agents supported by the skills CLI.\n\n1. Create a bot at the [Discord Developer Portal](https://discord.com/developers/applications)\n2. Add it to your server with the permissions you need\n3. Export a token:\n\n```\nexport DISCORD_BOT_TOKEN=\"your-bot-token-here\"\n```\n\nOr create a `.env` file in the same directory:\n\n```\necho 'DISCORD_BOT_TOKEN=your-bot-token-here' > .env\n# Server info\ndiscord-cli guild info\n\n# List channels\ndiscord-cli channel list\n\n# Create a channel\ndiscord-cli channel create \"announcements\" --type text --topic \"Server announcements\"\n\n# Send a message\ndiscord-cli message send 123456789012345678 --content \"Hello from the CLI!\"\n\n# Export channel history\ndiscord-cli export channel 123456789012345678 --limit 500 --format json > history.json\n```\n\nUse the ready-to-copy examples in [docs/recipes.md](https://github.com/1solomonwakhungu/discord-cli/blob/main/docs/recipes.md) for:\n\n- GitHub Actions notifications\n- Scheduled maintenance and status checks\n- Server/channel export and backup\n- Bulk role and permission changes\n- Claude/Codex and generic terminal-agent workflows\n\nNeed a deeper AI-agent workflow guide? See [docs/ai-agents.md](https://github.com/1solomonwakhungu/discord-cli/blob/main/docs/ai-agents.md).\n\n- `channel` — channel management and inspection\n- `message` — send, edit, react, purge, and fetch messages\n- `guild` — guild profile, emojis, stickers, bans, and prune flows\n- `member` — list, info, kick, ban, timeout, nickname, and role checks\n- `role` — create, edit, assign, remove, and inspect roles\n- `permissions` — per-channel permission overwrites\n- `webhook` ,`threads` ,`invite` ,`category` ,`search` , and`export` — the rest of the automation surface\n\n- `man discord-cli` — the complete command reference, also readable in the repo at[docs/man/discord-cli.1](https://github.com/1solomonwakhungu/discord-cli/blob/main/docs/man/discord-cli.1)\n- [Recipes](https://github.com/1solomonwakhungu/discord-cli/blob/main/docs/recipes.md)\n- [AI agent integration](https://github.com/1solomonwakhungu/discord-cli/blob/main/docs/ai-agents.md)\n- [Plugin guide](https://github.com/1solomonwakhungu/discord-cli/blob/main/docs/plugins.md)\n- [Contributing guide](https://github.com/1solomonwakhungu/discord-cli/blob/main/CONTRIBUTING.md)\n\nThis project is licensed under the MIT License. See [LICENSE](https://github.com/1solomonwakhungu/discord-cli/blob/main/LICENSE) for details.", "url": "https://wpnews.pro/news/show-hn-discord-cli-a-headless-discord-cli-that-prints-json-and-exits", "canonical_source": "https://github.com/1solomonwakhungu/discord-cli", "published_at": "2026-10-27 14:03:55+00:00", "updated_at": "2026-10-27 14:12:06.356296+00:00", "lang": "en", "topics": ["ai-agents", "developer-tools", "ai-tools"], "entities": ["discord-cli", "Discord", "PyPI", "Codex", "Claude Code", "Cursor", "GitHub Copilot", "1solomonwakhungu"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/show-hn-discord-cli-a-headless-discord-cli-that-prints-json-and-exits", "markdown": "https://wpnews.pro/news/show-hn-discord-cli-a-headless-discord-cli-that-prints-json-and-exits.md", "text": "https://wpnews.pro/news/show-hn-discord-cli-a-headless-discord-cli-that-prints-json-and-exits.txt", "jsonld": "https://wpnews.pro/news/show-hn-discord-cli-a-headless-discord-cli-that-prints-json-and-exits.jsonld"}}