Skip to content

Leonxlnx/dccodex

Repository files navigation

dccodex

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.

Features

  • /c for quick Codex asks
  • /codex ask for full options
  • /codex auth for API key auth, host Codex OAuth, or hybrid auth
  • /codex repo for repo linking, branch selection, and repo switching
  • /codex context for 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

Quick Start

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 .env

Create 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-id

Start locally on Windows:

npm run local:start:bg

Install 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

Auth Modes

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

Common Commands

/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

Where It Works

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.

Documentation

Development

npm run verify
npm run build

Runtime logs:

data/logs/bot.log

License

MIT

About

Discord Codex bot using local codex login, slash commands, repo workspace targeting, and reasoning overrides.

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors