Welcome to Elastic Copilot! This guide will get you up and running in just 5 minutes. Follow along to learn the essential features and see the power of AI-assisted coding.
Before You Start
Make sure you have:
1. Meet Your AI Assistant (1 minute)
Let’s start with a simple conversation:
Open Elastic Copilot
Click the Elastic Copilot icon in VSCode’s sidebar (or press Ctrl+Shift+E)
Say Hello
Type “Hello! Can you help me understand this project?” in the chat
Watch the Magic
Elastic Copilot will analyze your project and provide insights about its structure and purpose
Elastic Copilot automatically understands your codebase through intelligent analysis - no manual setup required!
2. AI Commands in Action (2 minutes)
The fastest way to get help with your code:
Explain Code
Select Code
Highlight any function or code block in your editor
Use Command
Press Ctrl+L (or right-click → “Elastic: Explain”)
Get Explanation
Elastic Copilot will provide a clear explanation of what the code does
Fix Issues
Find an Error
Look for red squiggly lines indicating errors in your code
Select Problem Area
Highlight the problematic code
Get Fix
Press Ctrl+Shift+F (or right-click → “Elastic: Fix”)
Review Solution
Elastic Copilot will suggest a fix with explanation
Improve Code
Select Code to Improve
Highlight code that could be optimized
Request Improvements
Press Ctrl+I (or right-click → “Elastic: Improve”)
See Suggestions
Get suggestions for performance, readability, or best practices
3. Smart Code Completion (1 minute)
Experience AI-powered autocomplete:
Start Typing
Begin writing a new function or class
Watch for Suggestions
Elastic Copilot will suggest completions as you type
Accept or Dismiss
Press Tab to accept suggestions or Esc to dismiss
Example - try typing this in a JavaScript file:
function calculateTotal ( items ) {
// Start typing and watch for AI suggestions
}
4. Context-Aware Chat (1 minute)
Have a conversation about your code:
Ask About Files “@filename.js What does this file do?”
Request Features “Add a new user authentication system”
Debug Issues “Why is my API call failing?”
Get Recommendations “How can I improve this component’s performance?”
Try This Chat Examples:
"@package.json What dependencies are we using?"
"Create a new React component for a user profile card"
"How do I add error handling to this function?"
"Explain the difference between these two approaches"
Essential Keyboard Shortcuts
AI Commands
Ctrl+L - Explain selected code
Ctrl+Shift+F - Fix selected code
Ctrl+I - Improve selected code
Ctrl+Shift+E - Open Elastic panel
Code Completion
Tab - Accept suggestion
Esc - Dismiss suggestion
Ctrl+Space - Trigger completion
Alt+] - Next suggestion
Quick Wins for Your Workflow
Now that you know the basics, here are some immediate ways to boost your productivity:
Select any function and ask: “Add comprehensive JSDoc comments to this function”
Highlight a function and ask: “Create unit tests for this function using Jest”
Select old code and ask: “Modernize this code using current best practices”
Paste code and ask: “Review this code for security vulnerabilities and performance issues”
Pro Tips
Be Specific : Instead of “fix this”, try “fix the async/await syntax error in this function”
Use Context : Mention file names with @ to give Elastic Copilot more context about what you’re working on
Iterate : Don’t hesitate to ask follow-up questions or request modifications to suggestions
Congratulations! You’re now ready to code with AI assistance. Elastic Copilot will learn your patterns and become even more helpful over time.