Copilot for CodeMirror logo

Copilot for CodeMirror

Summary

Copilot for CodeMirror is an open-source extension that adds GitHub Copilot-style autocompletion to the CodeMirror text editor, powered by OpenAI's GPT models. As you type, it offers inline code suggestions based on the surrounding code context, which you accept with Tab, helping you write code faster and with fewer errors.

Key Features

GPT-powered inline autocompletion for the CodeMirror editor
Context-aware suggestions using the code before and after the cursor
Tab to accept ghost-text style completions
Bring your own API: call any backend with prefix and suffix
Works with GPT-3.5 Turbo and other GPT models; no model is mandated
Installable from npm as codemirror-copilot
Open-source MIT-licensed extension

About Copilot for CodeMirror


The extension works by calling your own API with the code prefix and suffix around the cursor, and rendering the returned prediction as ghost text with a hints UI. GPT-3.5 Turbo is recommended for the best suggestions, but no specific model is mandated, so you can wire it to any backend you choose.


It is aimed at developers building web-based editors or IDEs on CodeMirror who want AI-assisted coding without leaving their editor. Installation is a single npm command, and the project is MIT licensed with its source on GitHub.

FAQs about Copilot for CodeMirror

Get more likes & reach the top of search results by adding this button on your site!

Embed button preview - Light theme
Embed button preview - Dark theme
TurboType Banner

Subscribe to the AI Search Newsletter

Get top updates in AI to your inbox every weekend. It's free!