🚀 We're live on Product Hunt! Support us →
Open source · MIT Licensed

Discord CLI for
AI agents & humans

Build autonomous Discord bots, automate servers, and deploy AI agents — all from your terminal. One binary. Any language. Zero boilerplate.

Get Started
$ pip install discord-cli-agent
discli serve
$ discli --json serve --status online
{"event":"ready","bot_name":"my-agent","guilds":3}
{"event":"message","author":"alice","content":"@bot help"}
{"action":"typing_start","channel_id":"982..."}
{"action":"reply","content":"Hi! How can I help?"}
{"event":"response","status":"ok"}

CLI-First

Every Discord action is a single command. Pipe into jq, chain with &&, run from cron. Built for the terminal.

Agent-Ready

Persistent JSONL over stdin/stdout. Your AI agent receives Discord events and sends actions in real-time, in any language.

Secure by Default

Permission profiles restrict what agents can do. Audit logs track every action. Rate limiting prevents abuse.

How it works

The JSONL protocol

discli serve opens a persistent connection. Events flow out on stdout. Actions flow in on stdin. Pure JSON lines.

stdout

Events

Messages, reactions, member joins, slash commands — every Discord event arrives as a JSON line on stdout.

{"event":"message","author":"alice"} {"event":"reaction_add","emoji":"thumbsup"} {"event":"member_join","user":"bob"}
stdin

Actions

Send messages, assign roles, create threads, stream responses — write a JSON line to stdin.

{"action":"reply","content":"Hi!"} {"action":"role_assign","role":"mod"} {"action":"thread_create","name":"..."}
Quick start

From zero to agent in 15 lines

agent.py
import json, subprocess

proc = subprocess.Popen(
    ["discli", "--json", "serve"],
    stdin=subprocess.PIPE, stdout=subprocess.PIPE, text=True,
)

for line in proc.stdout:
    event = json.loads(line)
    if event.get("event") == "message" and not event.get("is_bot"):
        cmd = json.dumps({
            "action": "reply",
            "channel_id": event["channel_id"],
            "message_id": event["message_id"],
            "content": f"You said: {event['content']}",
        })
        proc.stdin.write(cmd + "\n")
        proc.stdin.flush()
Progressive autonomy

Start simple. Scale up when ready.

Level 1 ~20 lines

Reactive Bot

Respond to keywords with fixed replies.

Level 2 ~35 lines

Context-Aware

Fetch message history before responding.

Level 3 ~60 lines

Proactive Agent

Create threads, stream responses, detect intent.

Level 4 ~90 lines

Multi-Action

Assign roles, DMs, reactions, channels.

Level 5 ~120 lines

Full Autonomous

Permission-bounded, audit-logged, production-ready.

Ready to build?

Install discli in seconds and ship your first agent today.