An open API service indexing awesome lists of open source software.

https://github.com/stealthylabshq/codex-rpc

Discord Rich Presence for the OpenAI Codex ecosystem on Windows (CLI + desktop, model + effort)
https://github.com/stealthylabshq/codex-rpc

chatgpt codex codex-cli discord discord-rpc openai rich-presence

Last synced: about 1 month ago
JSON representation

Discord Rich Presence for the OpenAI Codex ecosystem on Windows (CLI + desktop, model + effort)

Awesome Lists containing this project

README

          


Codex RPC logo

Codex RPC


Windows and macOS tray Discord Rich Presence for OpenAI Codex.
Detects Codex CLI and Codex desktop, shows model/effort, and lets you control
Discord activity from a local Tauri settings window.


Features |
Install |
Usage |
Development |
Changelog

## Features

- Native Windows/macOS tray app built with Tauri and Rust.
- Single process app: no `codex-rpc-daemon.exe` sidecar.
- Native Windows process scan for `codex.exe`, no PowerShell polling.
- macOS process scan for Codex CLI and Codex desktop.
- Detects Codex CLI vs Codex desktop.
- Discord RPC modes: Playing, Watching, Listening, Competing.
- Discord buttons support in Watching mode.
- Optional 5h and weekly usage display toggles.
- Live autosave for settings.
- Local preview of the Discord activity, including button preview.
- Tray quick toggles for RPC mode and usage visibility.
- Dark, System, and Light themes.
- Resizable settings window.

## Install

Download the latest release:

https://github.com/StealthyLabsHQ/codex-rpc/releases/latest

Recommended asset:

- `Codex RPC_0.3.4_x64-setup.exe`
- `Codex RPC_0.3.4_aarch64.dmg` or `Codex RPC_0.3.4_x64.dmg` on macOS

Portable asset:

- `codex-rich-presence.exe`
- `codex-rich-presence-macos-arm64` or `codex-rich-presence-macos-x64`

Run the app once. It starts in the system tray. Left-click the tray icon to open
settings, or right-click for quick toggles and Quit.

## Usage

The settings window controls:

- RPC mode: Playing, Watching, Listening, Competing.
- Two optional Discord buttons. Buttons are sent only in Watching mode.
- 5h usage visibility.
- Weekly usage visibility.
- Theme.

The tray menu controls:

- Open settings.
- Mode: Watching.
- Mode: Playing.
- Mode: Listening.
- Mode: Competing.
- Show 5h usage.
- Show week usage.
- Quit.

Settings are saved under:

```text
%LOCALAPPDATA%\codex-rich-presence\rpc-buttons.json
~/Library/Application Support/codex-rich-presence/rpc-buttons.json
```

The live status file is:

```text
%LOCALAPPDATA%\codex-rich-presence\status.txt
~/Library/Application Support/codex-rich-presence/status.txt
```

## Detection

Codex CLI and Codex desktop can have similar process names, so Codex RPC does
not rely on process name alone.

Detection uses:

- executable path;
- parent process name;
- native Windows process creation time.

CLI is detected when the path contains `node_modules/@openai/codex`, or when
the parent is a terminal/editor shell such as `cmd.exe`, `pwsh.exe`, `wt.exe`,
`Code.exe`, `cursor.exe`, `zsh`, `bash`, Terminal, iTerm2, Warp, Alacritty,
Hyper, Tabby, or ConEmu.

Everything else with a valid Codex executable path is treated as Codex desktop.

## Codex Metadata

Codex RPC reads local Codex files only:

- `~\.codex\config.toml` for model and reasoning effort.
- `~\.codex\sessions\**\rollout-*.jsonl` for repo name and usage snapshots.

No Codex data is sent anywhere except the Discord Rich Presence payload through
the local Discord IPC pipe.

## Environment

Optional overrides:

| Variable | Default | Description |
| --- | --- | --- |
| `DISCORD_CLIENT_ID` | bundled app id | Override Discord Application ID. |
| `SCAN_INTERVAL_MS` | `5000` | Codex process scan interval. Minimum `2000`. |
| `IDLE_GRACE_MS` | `10000` | Keep last active state before clearing RPC. |

Settings refresh every 500ms so UI changes apply quickly. Process scanning stays
at 5s by default to avoid unnecessary polling.

## Development

Requirements:

- Node.js 22+
- Rust/Cargo via rustup
- Windows: Visual Studio 2022 Build Tools with MSVC v143, Windows SDK, WebView2 Runtime
- macOS: Xcode Command Line Tools

Install dependencies:

```bash
npm install
```

Run checks:

```bash
npm run build
npm test
cd src-tauri
cargo check
```

Build Windows app:

```bash
npm run tauri:build:windows
```

Outputs:

```text
bin\codex-rich-presence.exe
src-tauri\target\release\bundle\nsis\Codex RPC_0.3.4_x64-setup.exe
```

Build macOS app:

```bash
npm run tauri:build:macos
```

Outputs:

```text
bin/codex-rich-presence-macos-arm64
src-tauri/target/release/bundle/macos/Codex RPC.app
src-tauri/target/release/bundle/dmg/Codex RPC_0.3.4_aarch64.dmg
```

## Security

- Button URLs are limited to `http://` and `https://`.
- Discord IPC frame size is capped.
- RPC text fields are sanitized before they reach Discord.
- Process scanning uses native Windows APIs instead of shelling out.
- The app only reads local Codex config/session files and local Discord IPC.

## License

MIT