Codex in Discord for DMs and group DMs.
dccodex is a user-installable Discord app for asking Codex questions, linking repos, saving shared context, and continuing work from a chat without leaving Discord.
/cfor quick Codex asks/codex askfor full options/codex authfor API key auth, host Codex OAuth, or hybrid auth/codex repofor repo linking, branch selection, and repo switching/codex contextfor goals, decisions, snippets, imports, recaps, plans, and todos- message actions:
Ask Codex,Save to Codex - reply actions:
Retry,Deep,Shorter,Make Plan,Use Chat - Windows background runner and Linux systemd deployment files
Requirements:
- Node.js 22+
- npm
- a Discord application
- either Codex CLI login or OpenAI API access
git clone https://github.com/Leonxlnx/dccodex.git
cd dccodex
npm install
npm run build
copy .env.example .envCreate a Discord app, enable User Install, add applications.commands, create a bot token, then put these in .env:
DISCORD_TOKEN=your-discord-bot-token
DISCORD_CLIENT_ID=your-discord-application-idStart locally on Windows:
npm run local:start:bgInstall the app with Discord's provided install link, or:
https://discord.com/oauth2/authorize?client_id=YOUR_DISCORD_CLIENT_ID&scope=applications.commands&integration_type=1
Choose one:
| Mode | Best For | Key Settings |
|---|---|---|
| Codex CLI OAuth | personal use or self-hosting | CODEX_BACKEND=cli, BOT_CREDENTIAL_MODE=host |
| API keys | public/shared host | CODEX_BACKEND=openai, BOT_CREDENTIAL_MODE=user |
| Hybrid | trusted host OAuth plus user API keys | CODEX_BACKEND=cli, BOT_CREDENTIAL_MODE=hybrid |
Important: Codex CLI OAuth belongs to the machine hosting the bot. For a public/shared hosted bot, use per-user OpenAI API keys so other users do not spend the host owner's credits.
Full auth guide: docs/AUTH_MODES.md
/c prompt: summarize our plan
/codex auth action: status
/codex auth action: connect
/codex repo action: link target: owner/repo branch: main
/codex context action: preview
/codex status
/codex stop
dccodex is built for Discord user-installed app flows:
- bot DMs
- group DMs
- private channels where user-installed apps are available
It is not a server bot by default. Discord does not let apps silently read ordinary friend DMs without an app interaction. Recent chat context depends on what Discord exposes to the app.
npm run verify
npm run buildRuntime logs:
data/logs/bot.log
MIT