Cotalker - VS Code Extension
Cotalker is a Visual Studio Code extension that allows you to easily send prompts to the VSCode Copilot Chat Extension.
Features
- Send Custom Prompts: Quickly send custom prompts to Copilot Chat
- Send Selected Code: Send selected code with optional context to Copilot Chat
- Keyboard Shortcuts: Fast access via customizable keyboard shortcuts
- Context Menu Integration: Right-click to send selected code to Copilot Chat
Commands
cotalker.sendToChat
Opens an input box where you can type a custom prompt to send to Copilot Chat.
Default Keyboard Shortcut: Ctrl+Shift+C (Windows/Linux) or Cmd+Shift+C (macOS)
cotalker.sendSelectionToChat
Sends the currently selected text to Copilot Chat with optional additional context.
Default Keyboard Shortcut: Ctrl+Shift+Alt+C (Windows/Linux) or Cmd+Shift+Alt+C (macOS)
Usage
Method 1: Command Palette
- Open the Command Palette (
Ctrl+Shift+P or Cmd+Shift+P )
- Type "Cotalker" to see available commands
- Select either "Send to Copilot Chat" or "Send Selection to Copilot Chat"
Method 2: Keyboard Shortcuts
- Press
Ctrl+Shift+C (or Cmd+Shift+C on macOS) to send a custom prompt
- Press
Ctrl+Shift+Alt+C (or Cmd+Shift+Alt+C on macOS) to send selected text
- Select some code in the editor
- Right-click to open the context menu
- Choose "Send Selection to Copilot Chat"
Requirements
- Visual Studio Code 1.74.0 or higher
- GitHub Copilot Chat extension must be installed and activated
Installation
From Source
- Clone this repository
- Run
npm install to install dependencies
- Run
npm run compile to build the extension
- Press
F5 to open a new Extension Development Host window
- Test the extension in the new window
Package and Install
- Install
vsce globally: npm install -g vsce
- Package the extension:
vsce package
- Install the generated
.vsix file: code --install-extension cotalker-1.0.0.vsix
How It Works
The extension attempts to interact with Copilot Chat using several methods:
- Direct Integration: Tries to use VS Code's chat API to send prompts directly
- Command Execution: Opens the Copilot Chat panel using VS Code commands
- Clipboard Fallback: If direct methods fail, copies the prompt to clipboard for manual pasting
Customization
Keyboard Shortcuts
You can customize the keyboard shortcuts by:
- Opening VS Code settings (
Ctrl+, or Cmd+, )
- Go to "Keyboard Shortcuts"
- Search for "cotalker"
- Click the pencil icon to edit the shortcuts
Commands
All commands are available in the Command Palette and can be bound to custom shortcuts or buttons.
Known Issues
- The extension uses various methods to interact with Copilot Chat, as the VS Code API for chat integration may vary between versions
- If automatic sending fails, the extension will copy the prompt to clipboard as a fallback
Contributing
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature )
- Commit your changes (
git commit -m 'Add some amazing feature' )
- Push to the branch (
git push origin feature/amazing-feature )
- Open a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Changelog
1.0.0
- Initial release
- Basic prompt sending functionality
- Selected text sending with context
- Keyboard shortcuts and context menu integration
| |