copilot-emacs/copilot.el
An unofficial Copilot plugin for Emacs.
What it solves
copilot.el is an Emacs plugin that integrates GitHub Copilot's AI-powered coding assistance directly into the editor. It eliminates the need for switch between the editor and a separate browser or AI tool by providing real-time code completions, an interactive chat interface, and automated code review and commit message generation within Emacs.
How it works
The plugin communicates with the official GitHub Copilot language server via JSON-RPC using jsonrpc.el. It bypasses standard LSP clients like eglot to handle the Copilot protocol's non-standard elements and maintain a single global server across all buffers and projects.
Who it’s for
Emacs users who have a GitHub Copilot subscription and want AI-assisted coding, chat-based refactoring, and automated documentation within their preferred editor.
Highlights
- Inline Completions: Provides ghost text for real-time code suggestions.
- Interactive Chat: A dedicated chat buffer with streaming responses, support for multi-line messages, and the same context as the current buffer.
- Agent Mode: Allows Copilot to execute tools such as shell commands, file edits, and workspace searches (via ripgrep).
- One-Shot Tasks: Quick commands for reviewing, fixing, optimizing, and documenting code, as well as writing unit tests.
- Code Review: Integrates native Copilot Code Review for structured feedback on uncommitted changes or specific regions.
- Coded-based Utilities: Generates commit messages from staged changes and provides diff-style previews for code rewrites.
- Session Persistence: Ability to save and restore chat history across Emacs restarts.
Related
- Project
- Project
- Project
- Project