Date: 2025-01-09 Status: Research Complete Purpose: Verify chat commands for CursorAIDestination and GitHubCopilotDestination implementations
What commands can be used to programmatically open chat interfaces in VSCode and Cursor IDE for RangeLink auto-paste functionality?
Command: workbench.action.chat.open
Status: ✅ Confirmed working (not officially documented in VSCode API reference, but widely used)
Usage:
// Simple usage (string prompt)
vscode.commands.executeCommand('workbench.action.chat.open', 'Your prompt here');
// Advanced usage (object with options)
vscode.commands.executeCommand('workbench.action.chat.open', {
query: '@participant /hello friend',
previousRequests: [...], // Optional conversation context
});Parameters:
- String form: Direct prompt text
- Object form:
query: string- The prompt text (can include participant references like@workspace)previousRequests?: []- Optional array for conversation context
Source: Stack Overflow: How to call GitHub Copilot Chat from my VS Code extension?
Command: vscode.editorChat.start
Status: ✅ Officially documented
Description: "Invoke a new editor chat session"
Source: VSCode Built-in Commands Documentation
Note: This command is documented but less commonly used than workbench.action.chat.open for opening chat interfaces with pre-filled text.
Status: ✅ VSCode commands should work (Cursor is a VSCode fork)
Findings:
- Cursor IDE is built on VSCode, maintaining compatibility with VSCode extensions
- Extensions work across "VS Code forks such as Insiders, Cursor, or Windsurf" (source: Codex IDE extension)
- Cursor uses
Cmd+L/Ctrl+Las keyboard shortcut to open chat - Forum reports mention "Show Cursor AI Chat" command works
- Some users reported issues with "Cursor: Open Chat" command (bug report from community forum)
Cursor-Specific Commands:
- No documented
cursor.chatorcursor.chat.opencommands found in official Cursor docs - Cursor docs focus on user-defined slash commands (e.g.,
/fix,/explain), not programmatic extension commands - Assumption: Cursor likely uses standard VSCode chat commands due to fork architecture
Sources:
- Cursor Community Forum: Open Chat command not working
- Cursor Docs: Commands (no extension API info)
Command: workbench.action.chat.newChat
Status: Exists but not fully documented
Purpose: Start a new chat session (clears context)
Issue: GitHub issue #261118 mentions this command doesn't always reset chat on first run
Source: GitHub Issue #261118
✅ Use: workbench.action.chat.open with object form
await vscode.commands.executeCommand('workbench.action.chat.open', {
query: paddedText,
});Why:
- Confirmed working for GitHub Copilot Chat
- Widely used pattern in extensions
- Supports pre-filling chat input
❌ Update (Jan 2025): workbench.action.chat.open does NOT work in Cursor
Testing revealed: The command workbench.action.chat.open is not available in Cursor IDE.
Actual Cursor commands found:
aichat.newchataction- Opens chat panel (Cmd/Ctrl+L) but cannot accept text parametersworkbench.action.toggleAuxiliaryBar- Toggles secondary sidebar (fallback)aichat.opensidebar- Opens chat sidebar with most recent sessioncursor.startComposerPrompt- Exists but doesn't accept prompt arguments
Limitation: No working command exists to programmatically send text to Cursor chat as of Jan 2025.
Workaround implemented:
- Copy text to clipboard using
vscode.env.clipboard.writeText() - Open chat panel using
aichat.newchataction(with fallback totoggleAuxiliaryBar) - Show notification prompting user to paste with Cmd/Ctrl+V
Detection: Use vscode.env.appName check (primary method per Q3 answer: Option A)
✅ Uses: workbench.action.chat.open with object parameter { query: text }
- Status: Not yet implemented (planned)
✅ Implemented with clipboard workaround (Jan 2025)
- Clipboard API:
vscode.env.clipboard.writeText() - Chat commands:
aichat.newchataction(primary) →workbench.action.toggleAuxiliaryBar(fallback) - User notification: Shows "RangeLink copied to clipboard. Paste (Cmd/Ctrl+V) in Cursor chat to use."
- Tests: Full coverage with 11 test cases
| Risk | Likelihood | Status | Mitigation |
|---|---|---|---|
workbench.action.chat.open doesn't work in Cursor |
✅ Resolved | Implemented clipboard workaround | |
| Command is undocumented and may change | Medium | Ongoing | Wrap in try/catch; graceful failure pattern |
| Chat opens but doesn't focus input | Low | Acceptable | User sees chat opened with notification |
| Clipboard workaround adds friction | Medium | Acceptable | One extra keystroke (Cmd/Ctrl+V) is minimal UX cost |
- VSCode fork ≠ full API compatibility: Cursor doesn't support all VSCode commands
- Extension APIs limited: Cursor's chat API is not exposed to extensions as of Jan 2025
- Clipboard workaround is standard: Multiple extensions use this pattern when direct API unavailable
- Community forums valuable: Found actual command names (
aichat.newchataction) through forum research - Test early: Initial assumption about
workbench.action.chat.openwas incorrect
If Cursor adds extension API for chat:
- Monitor Cursor changelog for chat API additions
- Replace clipboard workaround with direct API call
- Keep tests for both implementations (backward compatibility)
References for tracking:
- Cursor Feature Request: Adding text to chat from extension
- Cursor Feature Request: Command for passing prompt to chat