@statiolake/coc-github-copilot
statiolakeGitHub Copilot extension for coc.nvim with inline completion support
Published Package Summary
@statiolake/coc-github-copilot
GitHub Copilot integration for coc.nvim with inline completions and Language Model API support.
Features
- 🤖 GitHub Copilot Integration: Official GitHub Copilot Language Server integration
- 🔐 Device Authentication: Secure GitHub device authentication flow
- ⚡ Inline Completions: Automatic code suggestions via Language Server
- 🗨️ Language Model API: Provides chat models for other extensions
- 📊 Status Monitoring: Real-time authentication and service status
- 🛠️ Simple Configuration: Works out of the box with minimal setup
Installation
Prerequisites
- coc.nvim 0.0.82+
- Node.js 16+
- GitHub Copilot subscription
- @statiolake/coc-lm-api: Required dependency
Install via coc.nvim
:CocInstall @statiolake/coc-lm-api @statiolake/coc-github-copilot
Install via npm
npm install -g @statiolake/coc-lm-api @statiolake/coc-github-copilot
Setup
- Install both required extensions
- Run
:CocCommand copilot.signInto authenticate with GitHub - Follow the device authentication flow in your browser
- Start coding with Copilot suggestions!
Status Bar
The extension displays the current Copilot status in the coc.nvim status bar:
Copilot: N/A- Not authenticated or service unavailableCopilot: Ready (username)- Authenticated and ready
Language Model API Integration
This extension automatically registers GitHub Copilot chat models with the LM API, making them available to other extensions like @statiolake/coc-lm-chat.
Available Models
The extension provides access to GitHub Copilot's chat models:
gpt-4.1- Latest GPT-4 varianto1-preview- Reasoning model previewo1-mini- Lightweight reasoning model
Usage
Inline Completions
Once authenticated, Copilot will automatically provide suggestions in the coc.nvim completion popup as you type.
Language Model Access
Other extensions can access Copilot models through the LM API:
import type { LmApi } from '@statiolake/coc-lm-api';
const lmApi: LmApi = extensions.getExtensionById('@statiolake/coc-lm-api').exports;
const models = lmApi.selectChatModels({ vendor: 'GitHub' });
Troubleshooting
Authentication Issues
- Make sure you have a valid GitHub Copilot subscription
- Try signing out and signing in again:
:CocCommand copilot.signOutthen:CocCommand copilot.signIn - Check the status:
:CocCommand copilot.status
No Completions
- Verify Copilot is enabled:
:CocCommand copilot.enable - Check your internet connection
- Ensure the file type is supported by Copilot
Extension Dependencies
If you see errors about missing LM API:
- Install the required dependency:
:CocInstall @statiolake/coc-lm-api - Restart coc.nvim:
:CocRestart
Development
# Clone the repository
git clone https://github.com/statiolake/coc-github-copilot.git
cd coc-github-copilot
# Install dependencies
npm install
# Build
npm run build
# Watch mode for development
npm run watch
# Run linting
npm run lint
Related Extensions
- @statiolake/coc-lm-api: Required Language Model API interface
- @statiolake/coc-lm-chat: Interactive chat interface using Copilot models
License
MIT
Repository
Acknowledgments
- GitHub Copilot for AI assistance
- coc.nvim for the extension framework
- @github/copilot-language-server for the language server
- GitHub Copilot extension for coc.nvim with inline completion support
- *
Want to build, test, or contribute to coc.nvim extensions? Explore our official SDK and testing toolkits.
Open Developer GuideVersion History
This published npm package does not include a history.md or changelog.md file. Browse its npm versions or repository releases for available release information.
Contributed Commands
All contributes.commands entries from the published package manifest for @statiolake/coc-github-copilot@2.3.0.
| Command (:CocCommand) | Description |
|---|---|
| copilot.signIn | Sign in to GitHub Copilot |
| copilot.signOut | Sign out from GitHub Copilot |
| copilot.status | Show GitHub Copilot status |
| copilot.enable | Enable GitHub Copilot |
| copilot.disable | Disable GitHub Copilot |
Configuration Schema
All contributes.configuration entries from the published package manifest, including each raw property schema for coc-settings.json.
Raw JSON Schema
{
"type": "boolean",
"default": true,
"description": "Enable GitHub Copilot"
}Raw JSON Schema
{
"enum": [
"off",
"messages",
"trace"
],
"type": "string",
"default": "off",
"description": "Trace GitHub Copilot Language Server communication"
}