cli-discord-all
v0.1.1
Published
CLI wrapper for Discord Bot API workflows
Readme
cli-discord-all
A Node.js CLI for exploring and calling Discord Bot API endpoints from the terminal.
Unlike many Discord CLIs that focus on bot scaffolding, project workflows, or a narrow feature set, cli-discord-all is built around a broad endpoint reference so you can discover, inspect, and call a wide range of Discord Bot API routes from one CLI.
discord-cli is designed for a simple workflow:
- Find an endpoint with
list - Inspect it with
show - Execute it with
call
Install
npm install -g cli-discord-allRequires Node.js 18 or later.
Quick Start
discord-cli --help
discord-cli list message
discord-cli show message-get-channels-channel-id-messagesBefore making authenticated API calls, set your bot token:
export DISCORD_BOT_TOKEN=your_bot_tokenExample:
discord-cli call message-get-channels-channel-id-messages \
--param channel.id=123456789012345678 \
--query limit=10Send a message:
discord-cli call message-post-channels-channel-id-messages \
--param channel.id=123456789012345678 \
--body content="hello from cli-discord-all"Commands
discord-cli list [query]
List endpoints, optionally filtered by a search term.
discord-cli list
discord-cli list thread
discord-cli list permissionsdiscord-cli show <endpoint-id>
Print metadata for a specific endpoint as JSON.
discord-cli show message-get-channels-channel-id-messagesThe output typically includes:
- endpoint id
- category
- method
- path
- description
- permissions
- triggers
- matching discord.js method
discord-cli call <endpoint-id> [options]
Execute a Discord API endpoint.
Supported options:
--param key=value: replace path parameters--query key=value: add query string values--body key=value: add JSON body fields--body-json '<json>': provide the full request body as JSON--token <token>: overrideDISCORD_BOT_TOKEN--reason <text>: set theX-Audit-Log-Reasonheader--raw: print the response body without formatting
Examples:
discord-cli call message-get-channels-channel-id-messages \
--param channel.id=123456789012345678 \
--query limit=5discord-cli call message-post-channels-channel-id-messages \
--param channel.id=123456789012345678 \
--body content="hello"discord-cli call message-post-channels-channel-id-messages \
--param channel.id=123456789012345678 \
--body-json '{"content":"hello","tts":false}'Argument Rules
true,false, andnullare coerced to boolean/null values- integer and float strings are coerced to numbers
- values shaped like
{...}or[...]are parsed as JSON when possible - nested fields use dotted notation
Example:
discord-cli call message-post-channels-channel-id-messages \
--param channel.id=123456789012345678 \
--body-json '{"embeds":[{"title":"hello"}]}'For complex payloads, --body-json is recommended.
Output
list: plain textshow: pretty JSONcall: pretty JSONcall --raw: raw response body
Example call output:
{
"ok": true,
"status": 200,
"statusText": "OK",
"endpoint": {
"id": "message-get-channels-channel-id-messages",
"method": "GET",
"path": "/channels/{channel.id}/messages"
},
"request": {
"url": "https://discord.com/api/v10/channels/123/messages?limit=10"
},
"response": []
}Agent-Friendly Metadata
This package includes discord_cli_schema.json, a machine-readable description of the CLI structure.
It is intended for agents and tooling that want to understand:
- available commands
- positional arguments and options
- output formats
- authentication rules
- argument parsing behavior
Package Contents
The published package includes:
bin/discord-cli.jsdiscord_bot_api_reference.jsondiscord_cli_schema.json
discord_bot_api_reference.json is the data source used for endpoint discovery and execution. discord_cli_schema.json describes the CLI itself.
Development
Run locally:
node ./bin/discord-cli.js --help
node ./bin/discord-cli.js list messageIf you use nvm:
source ~/.nvm/nvm.sh
node ./bin/discord-cli.js --helpCheck the package contents:
npm pack --dry-runNotes
- Discord API rate limits still apply
- bot tokens should be stored securely
- use
--reasonfor operations that should include an audit log reason
License
MIT
