Visual Studio Code
MyDeskBot for VS Code brings powerful AI assistance to your VS Code editor.
Installation
From VS Code Marketplace
- Open VS Code
- Go to Extensions view (
Ctrl+Shift+X/Cmd+Shift+X) - Search for "MyDeskBot"
- Click Install
From Command Line
code --install-extension mydeskbot.mydeskbot-vscodeConfiguration
Basic Setup
Open settings (Ctrl+, / Cmd+,) and configure:
{
"mydeskbot.apiKey": "sk-...",
"mydeskbot.model": "gpt-4o",
"mydeskbot.temperature": 1.0,
"mydeskbot.maxTokens": 4096
}Environment Variables
Alternatively, use environment variables:
# In your shell profile (.bashrc, .zshrc, etc.)
export OPENAI_API_KEY="sk-..."
export ANTHROPIC_API_KEY="sk-ant-..."Workspace Settings
Configure per-project in .vscode/settings.json:
{
"mydeskbot.model": "gpt-4o",
"mydeskbot.temperature": 0.7,
"mydeskbot.contextFiles": 5
}Features
1. Inline Completions
Get code suggestions as you type:
// Start typing
function calculateA
// MyDeskBot suggests
function calculateAverage(numbers) {
return numbers.reduce((sum, num) => sum + num, 0) / numbers.length;
}Settings:
mydeskbot.inlineCompletions.enabled: Enable/disable inline completionsmydeskbot.inlineCompletions.triggerMode: Manual or Automatic
2. Inline Chat
Ask questions without leaving the editor:
- Press
Ctrl+Shift+M(orCmd+Shift+M) - Type your question
- Get inline responses
Example:
// MyDeskBot: How do I handle errors in async functions?
try {
const data = await fetchData();
return data;
} catch (error) {
console.error("Error:", error);
throw error; // Re-throw for caller to handle
}3. Code Actions
Right-click on selected code for AI actions:
- Explain Code: Get detailed explanation
- Refactor: Improve code quality
- Add Comments: Generate documentation
- Find Bugs: Identify issues
- Generate Tests: Create unit tests
- Optimize: Improve performance
4. Side Panel Chat
Open the dedicated chat panel:
- Click the MyDeskBot icon in the sidebar
- Or press
Ctrl+Shift+P→ "MyDeskBot: Open Chat" - Ask questions in the chat interface
5. Multi-File Context
MyDeskBot understands your entire workspace:
- Current file
- Open files
- Project structure
- Dependencies
- Configuration files
Keyboard Shortcuts
| Action | Windows/Linux | macOS |
|---|---|---|
| Open Chat Panel | Ctrl+Shift+P → "Open Chat" | Cmd+Shift+P → "Open Chat" |
| Inline Chat | Ctrl+Shift+M | Cmd+Shift+M |
| Explain Code | Ctrl+Shift+E | Cmd+Shift+E |
| Refactor | Ctrl+Shift+R | Cmd+Shift+R |
| Generate Tests | Ctrl+Shift+T | Cmd+Shift+T |
| Complete Code | Tab | Tab |
| Trigger Suggestion | Ctrl+Space | Ctrl+Space |
| Quick Fix | Ctrl+. | Cmd+. |
Commands
All commands available via Command Palette (Ctrl+Shift+P / Cmd+Shift+P):
- MyDeskBot: Open Chat: Open the side panel chat
- MyDeskBot: Explain Code: Explain selected code
- MyDeskBot: Refactor Code: Refactor selected code
- MyDeskBot: Add Comments: Generate comments for selection
- MyDeskBot: Generate Tests: Generate tests for selection
- MyDeskBot: Find Bugs: Find bugs in selection
- MyDeskBot: Optimize Code: Optimize selected code
- MyDeskBot: Toggle Inline Completions: Enable/disable inline completions
Workflows
1. Code Review
- Select code to review
- Press
Ctrl+Shift+E(Explain Code) - MyDeskBot provides:
- Code quality assessment
- Potential bugs
- Security issues
- Performance suggestions
2. Refactoring
- Select code to refactor
- Press
Ctrl+Shift+R(Refactor) - Choose refactoring type:
- Simplify logic
- Improve readability
- Extract functions
- Optimize performance
3. Documentation
- Select function or class
- Right-click → "Add Comments"
- MyDeskBot generates:
- JSDoc/TSDoc comments
- Parameter descriptions
- Return value docs
- Usage examples
4. Test Generation
- Select a function or class
- Press
Ctrl+Shift+T(Generate Tests) - MyDeskBot creates:
- Test file structure
- Test cases
- Mocks and stubs
- Assertions
5. Debugging
- Select problematic code
- Right-click → "Find Bugs"
- MyDeskBot analyzes:
- Potential causes
- Edge cases
- Suggested fixes
Settings Reference
Model Configuration
{
"mydeskbot.apiKey": "sk-...",
"mydeskbot.model": "gpt-4o",
"mydeskbot.temperature": 1.0,
"mydeskbot.maxTokens": 4096,
"mydeskbot.streamResponses": true
}Completion Settings
{
"mydeskbot.inlineCompletions.enabled": true,
"mydeskbot.inlineCompletions.triggerMode": "automatic",
"mydeskbot.suggestAfterTypeDelay": 200
}Context Settings
{
"mydeskbot.contextFiles": 5,
"mydeskbot.includeReadme": true,
"mydeskbot.includePackageJson": true,
"mydeskbot.includeGitignore": true
}UI Settings
{
"mydeskbot.showInlineIndicator": true,
"mydeskbot.chatFontSize": 14,
"mydeskbot.lineHeight": 1.5,
"mydeskbot.theme": "dark"
}Integration with VS Code Features
Git Integration
Commit Messages:
# Open Command Palette → "MyDeskBot: Generate Commit Message"
# MyDeskBot analyzes changes and generates a descriptive messagePull Request Reviews:
- Ask MyDeskBot to review PR changes
- Get suggestions for improvements
- Generate review comments
Debugging
Error Analysis:
- When debugging, copy error message
- Ask MyDeskBot in chat
- Get explanations and solutions
Breakpoint Suggestions:
- MyDeskBot suggests where to set breakpoints
- Helps identify suspicious code areas
Testing
Test Runner Integration:
- Generate tests for selected code
- Run tests and ask MyDeskBot to analyze failures
- Fix failing tests with AI assistance
Snippets
MyDeskBot can help you create custom snippets:
// Ask: "Create a React component snippet for a user profile"
// MyDeskBot generates:
{
"User Profile": {
"prefix": "user-profile",
"body": [
"import React from 'react';",
"",
"const UserProfile = ({ user }) => {",
" return (",
" <div className=\"user-profile\">",
" <img src={user.avatar} alt={user.name} />",
" <h2>{user.name}</h2>",
" <p>{user.email}</p>",
" </div>",
" );",
"};",
"",
"export default UserProfile;"
],
"description": "React user profile component"
}
}Workspaces and Profiles
Multiple Workspaces
Different settings for different workspaces:
// workspace-1/.vscode/settings.json
{
"mydeskbot.model": "gpt-4o",
"mydeskbot.temperature": 0.7
}
// workspace-2/.vscode/settings.json
{
"mydeskbot.model": "gpt-3.5-turbo",
"mydeskbot.temperature": 1.0
}Team Profiles
Share settings with your team:
// .vscode/settings.json
{
"mydeskbot.apiKey": "${env:OPENAI_API_KEY}",
"mydeskbot.model": "gpt-4o",
"mydeskbot.teamShared": true
}Troubleshooting
Extension Not Loading
- Check VS Code version (requires 1.75+)
- Reload VS Code (
Ctrl+Shift+P→ "Reload Window") - Check extension logs:
- Open Command Palette
- "Developer: Show Extension Logs"
- Look for MyDeskBot errors
API Key Issues
- Verify API key is correct
- Check account has credits
- Try different API provider
- Check network connectivity
No Suggestions
- Check if inline completions are enabled
- Verify model is configured
- Try manual trigger (
Ctrl+Space) - Check file is not too large
Slow Performance
- Reduce context file count
- Disable streaming
- Increase timeout
- Close unused files
Tips and Tricks
1. Context Awareness
Add file references in comments:
// See also: utils/validation.js
function validateEmail(email) {
// MyDeskBot can reference the validation file
}2. Iterative Refinement
Refine responses with follow-up:
// User: Generate a REST API for users
// [AI generates basic API]
// User: Add authentication
// [AI adds auth middleware]
// User: Add rate limiting
// [AI adds rate limiting]3. Code Templates
Create reusable code templates with MyDeskBot:
Create a TypeScript React component with:
- Props interface
- useState hooks
- useEffect for data fetching
- Loading state
- Error handling4. Learning Mode
Ask MyDeskBot to explain concepts:
// Ask: "Explain how React hooks work"
// Get detailed explanation with examplesEnterprise Features
For teams and organizations:
Shared Configuration
{
"mydeskbot.teamSettings": {
"model": "gpt-4o",
"temperature": 0.7,
"maxTokens": 4096
}
}Usage Analytics
Track AI usage across your team.
Custom Endpoints
{
"mydeskbot.apiEndpoint": "https://api.yourcompany.com/v1"
}Privacy & Security
- Code Privacy: Code is sent only for processing
- No Storage: We don't store your code
- Encrypted: All transmissions use HTTPS
- Local Option: Use local models for complete privacy