Skip to content
OpenSmartRoute
Skillv1.0.0

discord-cli

Discord CLI with YAML-first structured output for AI agents — fetch chat history, search messages, sync channels, and AI analysis

by jackwener(0) 0 installs
Free
Sign in to install

Free account. Installing gives you the manifest plus copy-paste snippets.

See reviews

About

Imported from jackwener/discord-cli (SKILL.md). Install upstream with npx skills add jackwener/discord-cli. Copyright stays with the author.

discord-cli Skill

CLI tool for Discord — fetch chat history, search messages, sync channels, AI analysis.

Agent Defaults

When you need machine-readable output:

  1. Prefer --yaml for structured output unless a strict JSON parser is required.
  2. Use -n to keep result sets small and token-efficient.
  3. Use -o <file> with export to save large datasets to a file.
  4. Prefer specific queries over broad ones. Example: use discord search "keyword" -c general --yaml instead of scanning all channels.
  5. Non-TTY stdout defaults to YAML automatically. Use OUTPUT=yaml|json|rich|auto to override.
  6. All machine-readable output uses the envelope documented in SCHEMA.md.

Prerequisites

  • Python 3.10+
# Install
uv tool install kabi-discord-cli
# Or: pipx install kabi-discord-cli

# Upgrade to latest (recommended to avoid API errors)
uv tool upgrade kabi-discord-cli
# Or: pipx upgrade kabi-discord-cli
  • Token configured via discord auth --save

Commands

Auth & Account

discord auth --save          # Auto-extract & save token
discord status               # Check token validity (exit 0 = valid)
discord status --yaml        # Structured auth status
discord whoami               # User profile
discord whoami --yaml        # Structured profile

Servers & Channels

discord dc guilds            # List servers
discord dc guilds --yaml     # YAML output
discord dc channels <GUILD>  # List text channels
discord dc info <GUILD>      # Server details
discord dc members <GUILD>   # List members

Fetching Messages

discord dc history <CHANNEL_ID> -n 1000   # Fetch history
discord dc sync <CHANNEL_ID>              # Incremental sync
discord dc sync-all                       # Sync all known channels
discord dc tail <CHANNEL_ID> -n 20        # Follow new messages live
discord dc search <GUILD> "keyword"       # Native Discord search

Querying Stored Messages

discord search "keyword"                  # Search local DB
discord search "keyword" -c general       # Filter by channel
discord stats                             # Per-channel stats
discord today                             # Today's messages
discord today -c general --yaml           # Filter + YAML
discord top                               # Most active senders
discord top --hours 24                    # Last 24h only
discord timeline                          # Activity chart
discord timeline --by hour               # Hourly granularity

Data

discord export <CHANNEL> -f json -o out.json   # Export
discord purge <CHANNEL> -y                     # Delete stored

Workflow: Before Using

# Always run this first to ensure token is valid
discord auth --save          # Auto-extract token from browser (if needed)
discord status               # Verify token works

Workflow: Daily Sync

# 1. First time: fetch history for channels you care about
discord dc guilds --yaml
discord dc channels <guild_id> --yaml
discord dc history <channel_id> -n 2000

# 2. Daily: incremental sync
discord dc sync-all

# 3. Read today's messages (structured output for agents)
discord today --yaml

Notes

  • Uses Discord user token (not bot token) for read-only access
  • Rate limits are handled automatically with retry
  • Messages stored in SQLite at ~/Library/Application Support/discord-cli/messages.db

Safety Notes

  • Do not ask users to share raw token values in chat logs.
  • Prefer auto-extraction via discord auth --save over manual token input.
  • Token is stored locally and never uploaded.

Use it

Copy one of these into your project. Installing also returns the manifest and these snippets.

yaml
targets:
  - https://api.opensmartroute.ai/api/v1/registry/jackwener-discord-cli-discord-cli/manifest   # or paste the manifest below

Manifest

An Open Capability Manifest: the router reads it to know what this does, what it costs and when to pick it.

jackwener-discord-cli-discord-cli.ocm.jsonjson
{
  "ocm": "1",
  "id": "jackwener-discord-cli-discord-cli",
  "kind": "skill",
  "name": "discord-cli",
  "description": "Discord CLI with YAML-first structured output for AI agents — fetch chat history, search messages, sync channels, and AI analysis",
  "publisher": "jackwener",
  "version": "1.0.0",
  "capabilities": {
    "domains": [
      "general"
    ],
    "tags": [
      "skill-md",
      "discord",
      "chat",
      "sync",
      "ai-analysis",
      "cli",
      "github"
    ],
    "languages": [
      "en"
    ]
  },
  "quality_prior": 0.6,
  "examples": [
    "Discord CLI with YAML-first structured output for AI agents — fetch chat history, search messages, sync channels, and AI analysis"
  ],
  "primary": false,
  "metadata": {
    "source": {
      "provider": "github",
      "repository": "https://github.com/jackwener/discord-cli",
      "path": "SKILL.md",
      "ref": "ce32e6b37bdf1a3852ebf65fbdf580ee81361155",
      "url": "https://github.com/jackwener/discord-cli/blob/ce32e6b37bdf1a3852ebf65fbdf580ee81361155/SKILL.md",
      "key": "jackwener/discord-cli/SKILL.md"
    }
  },
  "instructions": "# discord-cli Skill\n\nCLI tool for Discord — fetch chat history, search messages, sync channels, AI analysis.\n\n## Agent Defaults\n\nWhen you need machine-readable output:\n\n1. Prefer `--yaml` for structured output unless a strict JSON parser is required.\n2. Use `-n` to keep result sets small and token-efficient.\n3. Use `-o <file>` with `export` to save large datasets to a file.\n4. Prefer specific queries over broad ones. Example: use `discord search \"keyword\" -c general --yaml` instead of scanning all channels.\n5. Non-TTY stdout defaults to YAML automatically. Use `OUTPUT=yaml|json|rich|auto` to o",
  "cost": {
    "context_tokens": 905
  }
}

Fetch it by URL: GET /api/v1/registry/jackwener-discord-cli-discord-cli/manifest?version=1.0.0

Reviews

Star ratings from people who tried it. One review per account; edit yours any time.

No reviews yet. Install it, try it, and be the first to rate it.