tninja/ai-code-interface.el

Unified Emacs interface supporting OpenAI Codex, Antigravity CLI, Claude Code, Pi agent, Muse Code, and more

What it solves

AI coding agents change quickly and each has its own interface and runtime behavior. If you use or evaluate several agents (Claude Code, OpenAI Codex, Gemini CLI, and many others), keeping a consistent development workflow across all of them is painful. AI Code Interface solves this by placing a stable Emacs workflow layer on top of any supported coding agent: the backend can change, but your Emacs workflow does not have to. Context handling, prompting, code changes, review, TDD, Git, tasks, and session management all stay the same regardless of which agent is underneath.

How it works

You configure one backend once in Emacs Lisp, for example (ai-code-set-backend 'codex), and then use the same set of Emacs commands no matter which agent is underneath. The main entry point is a transient menu bound to C-c a that groups every capability: starting, resuming, or jumping back into an AI CLI session, swapping backends, asking questions, changing code, implementing TODOs, explaining code, managing AI context, and Git utilities.

The package launches and manages the agent's terminal session using vterm (default), eat, or ghostel. It deliberately does not reimplement agent runtimes: each native CLI keeps its own interaction model, tool execution, retries, permissions, and queueing behavior. Structured external backends (like agent-shell/ACP) can provide deeper lifecycle and UI integration when available, but that is not a requirement for every backend.

Inside the AI session buffer, file references, nearby code symbols, and URLs become underlined and clickable - file links jump to the exact location, symbols trigger code navigation, and web links open in your browser. Commands automatically capture the surrounding function, region, or clipboard contents to keep prompts precise. A session dashboard shows active sessions with status, time in state, uncommitted changes, and a summary of the last prompt. A checkpoint prompt can ask the AI to summarize the goal, changes, hypothesis, test results, blockers, and next action. The assemble prompt always opens in a review buffer before being sent. Input can be enhanced with prompt completion, snippets, gptel-generated headlines, and speech-to-text via whisper.

Who it's for

Emacs users who use or evaluate multiple AI coding agents and want one consistent Emacs workflow rather than a different workflow per agent. If you want the deepest possible integration with one specific agent runtime, a dedicated client may be a better fit.

Highlights

  • Transient menu hub (C-c a): one keystroke opens a contextual menu grouping CLI control, code actions, agile workflows, utilities, and help.
  • AI CLI session management: start, resume, jump back into, or swap AI CLI sessions; multiple sessions per project; install backend skills; upgrade backends; edit backend configs; a dashboard with status, uncommitted changes, and prompt summaries.
  • Clickable session links: in-repo file references, nearby code symbols, and URLs are underlined and interactive, with fallback navigation via xref, helm-gtags, or file search.
  • Context-aware code actions: change code, implement TODOs, ask questions, explain code, send free-form commands, and manage AI context with automatically captured scoped references; Dired integration uses marked files in buffer order.
  • Code annotation support: manage source-file and Magit hunk annotations and ask AI about them, with review lists, preview, edit, delete, and scoped question actions.
  • Ghostel terminal backend: inline image previews for local image paths printed by an AI CLI via Kitty graphics protocol, with pixel-level scrolling and optional ultra-scroll integration.
  • Optional integrations: gptel headline generation and prompt classification, whisper speech-to-text, flycheck error fixing, yasnippet snippets, helm/cape/company completion, projectile, and platform-specific screenshot capture.

Related

  • Project
  • Project
  • Project
  • Project