AI Code Interface CLI
An Emacs package that gives Codex, Claude Code, Gemini CLI and other agents one shared menu and the same commands
- 294 ★ on the repository
- Last commit
- Apache-2.0
Broad access
Why this level
- Starts agent CLIs that edit files and run commands, and the package itself runs generated shell commands after your actions
- Passes code, diffs, git history and screenshots from the editor to agents
- Automatic test runs after edits are switched on by the ai-code-auto-test-type setting
Install
- Works in
Manual install
(ai-code-set-backend 'codex)A line for init.el inside use-package ai-code. Other backends: claude-code, gemini, github-copilot-cli, opencode, cursor.
Access and checks
How we reviewBroad accessThe tool can change data, run commands or handle secrets.
- Starts agent CLIs that edit files and run commands, and the package itself runs generated shell commands after your actions
- Passes code, diffs, git history and screenshots from the editor to agents
- Automatic test runs after edits are switched on by the ai-code-auto-test-type setting
This is third-party code. Review the repository files before installing.
What it does
AI Code Interface for Emacs gives one workflow across different coding agents. The backend can change while context selection, edit requests and review work the same way. The package does not reimplement agents: each CLI owns its own prompts, permissions and retries. Everything opens with one key, C-c a, in a contextual menu. From there you can start or resume a session, change selected code or hand the agent a TODO from a comment. The same menu runs a TDD cycle and a pull request review with difftastic. Prompts assemble in an AI Compose buffer where you see them before sending. To switch between agents there is a handoff through an Org task file. C-c a H writes the current state, and in a new session another agent reads it as context. There are more than ten backends, among them Codex, Claude Code, Aider and Cursor CLI.
Who it is for. For Emacs developers who use several coding agents and want one set of commands, context and review.
Good fit when
- You work in Emacs and want to call Codex or Claude Code from the editor with the current function as context
- You switch between agents and need a task handoff without losing state
- You want a guided TDD cycle, refactoring and pull request review in one menu
- You want to hand a TODO comment to an agent with one command
- You want to review and edit a prompt in a separate buffer before sending it to the agent
Not a fit when
- You do not use Emacs: the package works only inside the editor
- You need the deepest possible integration with one specific agent: a dedicated client fits better
- You need a network gateway to control agent calls: the package drives them from the editor
- You lack Emacs 29.1 or newer and cannot install magit and transient
Example request
Select a function, press C-c a c and describe: add result caching for 5 minutes and write a testLimitations
The package is an intermediary: the selected agent's CLI must be installed and configured, and its plan and keys remain yours. Some commands, such as applying a prompt to the current file, work only with CLI backends and are unavailable for agent-shell and ECA. The session terminal needs vterm, eat or ghostel. Ghostel changes fast, and the author advises installing its latest version. Known pitfalls: Esc in Claude Code slash commands, frequent approval prompts in TDD mode and slow Gemini CLI replies.
How to disable. Remove the ai-code package via `M-x package-list-packages` and delete the use-package block with the backend choice from init.el. The C-c a binding can be reassigned or removed.
FAQ
How do I install AI Code Interface?
Add MELPA to package-archives, run M-x package-install and choose ai-code. In init.el load the package with use-package, choose a backend with ai-code-set-backend and bind the menu to C-c a. For straight, point to the tninja/ai-code-interface.el repository.
Which agents are supported?
Natively Codex, Pi, Antigravity CLI, Muse Code, Opencode, Claude Code, GitHub Copilot CLI, Gemini CLI, Kilo, Grok CLI, Cursor CLI, Open Interpreter, Kiro, CodeBuddy and Aider. External backends cover ECA, agent-shell, claude-code-ide.el and claude-code.el.
What does C-c a H do?
It depends on the buffer. In an Org task file it asks the agent to append a structured handoff with the goal, progress, changed files and test results. With the C-u prefix it loads the whole file as context for a new session. In a session buffer it sends a checkpoint prompt.
Can I review a prompt before it is sent?
Yes. Prompts from composed actions open in an AI Compose buffer with a character count in the header. C-c C-c sends and C-c C-k cancels.
Do I need a subscription for the agent?
The package is free under Apache-2.0 but only launches agents. Plans and keys for Codex, Claude Code, Gemini CLI and others are set by their vendors.
Discussion
No questions or reviews yet.
Related
CLI toolsA Python terminal coding agent in the manner of Claude Code: reads the repository, edits files, runs commands, with memory, sub-agents and MCP
A CLI that gives six coding agents project context, over 80 skills, verification and resumable tasks across sessions
Work modes for AI coding agents: a light solo mode for daily tasks and /man with a plan, checks and review for big changes
An MCP server and CLI in Go: the agent keeps an index of code and database schema in the repository, versions it in Git and reads it whole before each task
Context Engine: code search and memory for an agent
Context Engine
A skill that teaches an agent to query the Context Engine code index and symbol graph before reading files directly
MiniCode is a compact TypeScript terminal coding agent like Claude Code: tool loop, TUI, skills, MCP and sub-agents, built for study and tinkering
README in short
The README presents the package as a workflow layer on top of agents. A quick start, MELPA installation, common scenarios and detailed setup for each backend follow, and the end collects questions about individual agents.