Skip to content

dukjjang/codex-cli.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 

Repository files navigation

codex-cli.nvim

Lightweight Neovim integration for Codex CLI via tmux send-keys or an embedded terminal UI.

  • Prompt from Neovim, send to a running Codex CLI pane
  • If no Codex CLI pane is found, open a local terminal split
  • Visual selection adds file/line context
  • Auto-reload buffers when Codex edits files

Requirements

  • Neovim >= 0.8
  • Codex CLI available in PATH
  • tmux (optional, for sending to an existing tmux pane)

Installation (lazy.nvim)

{
  "dukjjang/codex-cli.nvim",
  config = function()
    require("codex_cli").setup()
  end,
}

Usage

  • Normal mode: <leader>aa opens a prompt and sends:
    • Context: <current-file>
    • your prompt on the next line
  • Visual mode: <leader>aa does the same but includes the selected range:
    • Context: <current-file> lines <start>-<end>
    • your prompt on the next line
  • Optional: set keymaps.visual to a different key if you want a separate visual-only mapping.

Commands:

  • :CodexSend
  • :CodexAsk
  • :CodexToggle

Configuration

require("codex_cli").setup({
  tmux = {
    command = "codex", -- match process name for pane detection
  },
  split = {
    command = "codex", -- command used to launch Codex CLI
    direction = "right", -- "right" or "below"
    size = 0.4,
  },
  keymaps = {
    enabled = true,
    ask = "<leader>aa",
    visual = "<leader>aa",
    toggle = "<leader>at",
  },
  command = "CodexSend",
  command_ask = "CodexAsk",
  command_toggle = "CodexToggle",
})

Notes

  • Pane detection searches the current tmux session and looks for a codex process in the pane's child process tree.
  • If no tmux pane is found, Codex CLI starts in a terminal split.
  • Buffers auto-reload on focus/enter/cursor hold via checktime.
  • Invalid configuration values fall back to defaults and emit a warning once.

Troubleshooting

  • No codex pane found: set tmux.command to match the process name you see in ps.
  • Not in tmux: tmux integration is optional; the split terminal still works.

About

codex-cli nvim plugin

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages