Install
git clone https://github.com/bennfocus/codex-cli.elInstall command taken from the project's README or registry entry. Always review code before running it.
README excerpt
Read full README on GitHub →codex-cli.el
Run Codex CLI inside Emacs — project‑scoped terminals, predictable windows, and a few high‑leverage helpers for sending prompts, regions, and files. Small surface. Stable defaults.
Single Session in a Side Window
Toggle a Project Session
All Project Sessions (Columns + Paging)
Highlights
- Project‑scoped Codex terminals (multiple sessions per project)
- Side window toggle with fixed width and optional focus
- “Show All Sessions” view with automatic column layout and paging
- Send prompt, active region, or any file under the project
- Smart chunking for large sends + optional per‑session preamble
- Optional log buffer mirroring injected content
Requirements
- Emacs 28+
- Codex CLI on PATH (
codex --version) - Optional:
vterm(falls back to built‑interm)
Install
MELPA or directly from GitHub via :vc:
(use-package codex-cli
;; For MELPA: :ensure t
;; For GitHub (Emacs 29+):
;; :vc (:fetcher github :repo "bennfocus/codex-cli.el")
:bind (("C-c c t" . codex-cli-toggle)
("C-c c s" . codex-cli-start)
("C-c c q" . codex-cli-stop)
("C-c c Q" . codex-cli-stop-all)
("C-c c p" . codex-cli-send-prompt)
("C-c c r" . codex-cli-send-region)
("C-c c f" . codex-cli-send-file)
;; Show-all layout + paging
("C-c c a" . codex-cli-toggle-all)
("C-c c n" . codex-cli-toggle-all-next-page)
("C-c c b" . codex-cli-toggle-all-prev-page))
:init
(setq codex-cli-executable "codex"
codex-cli-terminal-backend 'vterm
codex-cli-side 'right
codex-cli-width 90))
Quick Start
- Verify Codex CLI:
which codex && codex --version
Open a file inside a project in Emacs.
Start/toggle the session window:
M-x codex-cli-toggle(creates if none; toggles otherwise)- Or
C-c c twith the binding above
- Try sending content:
M-x codex-cli-send-prompt→ paste text into the terminal- Select a region →
M-x codex-cli-send-region M-x codex-cli-send-file→ choose any file under the project
- Show all sessions for the project in columns:
M-x codex-cli-toggle-all(C-c c a), then page withC-c c n/C-c c b
Commands
codex-cli-start— start a new session (auto id if unnamed)codex-cli-toggle— project‑aware toggle; prompts to create when none existcodex-cli-restart— kill and start again in the same buffercodex-cli-stop— choose an existing session and terminate itcodex-cli-rename-session— rename a session (and its log buffer)codex-cli-stop-all— stop sessions in bulk (current project or all projects)
Send helpers:
codex-cli-send-prompt— minibuffer → terminalcodex-cli-send-region— active region or whole buffercodex-cli-send-file— pick and send a file under the project
Multi‑session view:
codex-cli-toggle-all— show all sessions as columns; call again to restore layoutcodex-cli-toggle-all-next-page/codex-cli-toggle-all-prev-page— cyclic paging
Tips:
- Use
C-u M-x codex-cli-startto provide a custom session name (blank = auto id). codex-cli-toggle/codex-cli-stopauto‑select when only one session exists.
Window & Sessions
Similar plugs
CLI proxy that reduces LLM token consumption by 60-90% on common dev commands. Single Rust binary, zero dependencies
Bash is all you need - A nano claude code–like 「agent harness」, built from 0 to 1
Documented system prompts from Anthropic - Claude Fable 5.1, Opus 5.5, Claude Design, Claude Code. OpenAI - ChatGPT GPT-6-Astra, Codex. Google - Gemini 3.8 Flash, 3.1 Pro,…
Wrap Antigravity, ChatGPT Codex, Claude Code, Grok Build, Muse Code, Devin as an OpenAI/Gemini/Claude/Codex compatible API service, allowing you to enjoy the free Gemini…