ai-code-interface.el  by tninja

Unified Emacs interface for diverse AI coding assistants

Created 11 months ago
250 stars

Top 100.0% on SourcePulse

GitHubView on GitHub
Project Summary

An Emacs package, ai-code-interface.el, provides a unified interface for interacting with various AI coding assistants like OpenAI Codex, GitHub Copilot CLI, and Claude Code. It targets Emacs users who leverage multiple AI tools, offering a consistent user experience and workflow portability, allowing seamless switching between backends without altering core Emacs commands or interaction patterns.

How It Works

This package acts as a meta-interface, abstracting the complexities of different AI coding CLIs and external backend packages. It focuses on providing a stable Emacs workflow by standardizing context gathering, prompt formatting, and command execution across diverse AI services. Its core advantage lies in workflow portability, ensuring that user-defined actions and interactions remain consistent regardless of the underlying AI model or CLI being used.

Quick Start & Requirements

Installation is typically done via MELPA. Add MELPA to your package-archives in init.el, then run M-x package-install ai-code. Configure using use-package and set a default backend, e.g., (ai-code-set-backend 'codex). The primary interaction point is the C-c a keybinding, which opens a contextual transient menu.

Required dependencies include Emacs 29.1 or later, org, magit, transient, and a terminal emulator like vterm (default), eat, or ghostel.

Highlighted Details

  • Transient-Driven Hub: A single keybinding (C-c a) accesses a comprehensive, contextual menu for all AI coding actions, eliminating the need to memorize scattered keybindings.
  • Context-Aware Code Actions: Automatically captures relevant code context (current function, region, visible files, clipboard) to ensure precise AI prompts.
  • Agile Development Workflows: Integrates features for refactoring, Test-Driven Development (TDD) cycles, and pull request reviews.
  • MCP (Model Communication Protocol) Tools: Includes a built-in Emacs MCP server for debugging Emacs Lisp issues, inspecting editor state, and enabling AI-driven fixes via eval_elisp.
  • Harness Engineering: Implements automated feedback loops for code changes, including automatic testing and follow-up actions, to create a more robust AI development process.
  • Portable Agent Handoff: Utilizes Org-mode task files to facilitate transferring development context and progress between different AI coding backends.

Maintenance & Community

The project actively tracks GitHub contributors. Community interaction and support are primarily managed through GitHub issues and pull requests.

Licensing & Compatibility

The project is licensed under the Apache-2.0 License, permitting commercial use and modification with attribution. It integrates with the broader Emacs Lisp ecosystem.

Limitations & Caveats

The ghostel terminal backend may truncate long conversations due to its default scrollback limit, requiring manual configuration. Certain backends, like ECA and agent-shell, do not support the ai-code-apply-prompt-on-current-file command. Desktop notifications are experimental and may appear in the minibuffer on non-Linux platforms.

Health Check
Last Commit

17 hours ago

Responsiveness

Inactive

Pull Requests (30d)
26
Issues (30d)
12
Star History
15 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.