codex-discord-bridge — плагин для Claude Code: обзор и установка
Плагин codex-discord-bridge подключает Codex CLI к боту в Discord через мост на Rust. Позволяет ставить задачи агенту со смартфона и одобрять действия кнопками прямо в чате.
MIT ★ 1 596 обновлён 2026-10-29
/plugin marketplace add hashgraph-online/awesome-codex-plugins
/plugin install codex-discord-bridge@awesome-codex-pluginsЧто делает codex-discord-bridge
Плагин связывает Discord-бота с локальным сервером codex app-server по протоколу JSON-RPC через WebSocket. Каждое обращение к боту создаёт или продолжает ветку диалога. Ответ агента транслируется в реальном времени в одно обновляемое сообщение Discord на каждый ход диалога. Запросы подтверждений на запуск команд и применение патчей приходят интерактивными кнопками с настраиваемым временем жизни TTL.
Связка работает в режиме одного оператора: команды принимает только пользователь с идентификатором из DISCORD_CONTROLLER_USER_ID. При разрыве соединения супервизор восстанавливает связь с экспоненциальной задержкой до 4 секунд, сохраняя связку тредов в data/state.json.
Для запуска моста необходимы стабильная версия Rust, установленный и авторизованный Codex CLI через команду codex login status, а также бот Discord с включённым разрешением Message Content intent.
Какие задачи решает
- Управлять агентом Codex удалённо со смартфона через Discord
- Одобрять команды и патчи агента кликом по кнопкам в чате
- Сохранять отдельные ветки Discord для каждого диалога Codex
- Следить за выводом работы агента в потоковом режиме
Примеры запросов агенту
- Настрой окружение через скилл codex-discord-bridge-setup
- Запусти bridge и покажи статус подключения к Discord
- Проверь тесты проекта в отдельном треде Discord
Как установить codex-discord-bridge
Через маркетплейс плагинов
/plugin marketplace add hashgraph-online/awesome-codex-plugins/plugin install codex-discord-bridge@awesome-codex-pluginsПо шагам, с командами для каждой платформы: Плагины Claude Code: маркетплейсы, установка и как собрать свой
Вопросы о codex-discord-bridge
Как установить codex-discord-bridge в Claude Code?
Сначала добавьте каталог плагинов командой /plugin marketplace add hashgraph-online/awesome-codex-plugins, затем установите сам плагин вызовом /plugin install codex-discord-bridge@awesome-codex-plugins.
Что делает codex-discord-bridge?
Он запускает мост на Rust, который пересылает сообщения между ботом в Discord и codex app-server по WebSocket, превращая чат в пульт управления агентом.
Кто может отправлять команды боту?
Мост обрабатывает сообщения исключительно от одного владельца, чей Discord ID прописан в переменной DISCORD_CONTROLLER_USER_ID в файле конфигурации .env.
Исходный текст
codex-discord-bridge · MIT
# codex-discord-bridge Control Codex CLI from Discord. A Rust bridge (serenity) that connects a Discord bot to the Codex app-server over WebSocket, so you can run coding tasks from your phone. ``` Discord thread <-> bridge (serenity) <-> JSON-RPC over WebSocket <-> codex app-server ``` ## How it works - Message the bot: it starts a Codex thread and streams the agent's output back into one live Discord message per turn. - One Discord thread per Codex conversation. Follow-ups inside the thread continue the same conversation instead of starting a new one. - Approval requests (command execution, patches) arrive as buttons with a configurable TTL, so Codex can ask permission mid-task while you are away from the desk. - Autothread mode: each conversation gets its own Discord thread under a category you choose, titled from the first message. - A 20s JSON-RPC keepalive and a bounded supervisor (readiness timeout, backoff capped at 4s) reconnect the app-server without dropping your Discord session or the thread mappings. Access is single-controller: only the Discord user id set in `DISCORD_CONTROLLER_USER_ID` can talk to the bot. ## Requirements - Rust stable - A Discord application with a bot token (enable the Message Content intent) - Codex CLI installed and authenticated (`codex login status`) ## Setup 1. Clone the repo, copy `.env.example` to `.env`, and fill it in: ``` DISCORD_BOT_TOKEN= # from the Discord developer portal DISCORD_APPLICATION_ID= # your application id DISCORD_GUILD_ID= # your server id DISCORD_CONTROLLER_USER_ID= # your Discord user id CODEX_COMMAND=codex CODEX_APP_SERVER_LISTEN_URL=ws://127.0.0.1:8837 RUST_LOG=info ``` 2. Copy `bridge.json.example` to `bridge.json`. The defaults are fine to start. Turn on `autoThread.enabled` and set `autoThread.categoryId` if you want each conversation in its own thread. 3. Build and run: ``` cargo build --release ./target/release/codex-discord-bridge ``` 4. Invite the bot to your server and send it a message. ## State and logs - Thread mappings live in `data/state.json`. Stop the bridge before editing that file by hand. - The bridge logs to stdout. `RUST_LOG=debug` in `.env` for verbose output. ## Install as a Codex plugin This repo ships a plugin manifest (`.codex-plugin/plugin.json`), a setup skill (`skills/codex-discord-bridge-setup`), and its own marketplace file, so Codex can install it directly: ``` codex plugin marketplace add yaffalhakim1/codex-discord-bridge codex plugin add codex-discord-bridge@codex-discord-bridge ``` ## Development - `cargo test` runs the full suite, including reconnect, routing, and stream regression tests. State-touching tests use temp dirs via `BridgeState::with_path`, and a guard test fails if any test writes the production state file. - `cargo clippy --all-targets -- -D warnings` is kept clean. ## License MIT
© Yafi Alhakim · MIT · hashgraph-online/awesome-codex-plugins