More than automcomplete on steroids - AI tools that provide helps you write code and other tricks.
NOTE: Content here are my personal opinions, and not intended to represent any employer (past or present). “PROTIP:” here highlight information I haven’t seen elsewhere on the internet because it is hard-won, little-know but significant facts based on my personal research and experience.
On an airplane, a “co-pilot” (aka first officer) takes over when the captain goes to the bathroom or becomes incapacitated.
But in the world of software development, a “co-pilot” is a collaborator who works like a pair programming session when two people are working on the same code at the same time.
Big tech companies have been working to create AI capabilities: Microsoft, Google, OpenAI, Anthropic, and others.
VIDEO: wind.surf windsurf.ai editor, VIDEO combines its AI agents with Copilot to provide “Flows” that collects context to automate tasks. AI Agents are “agentic” in that they can perform tasks autonomously, such as open files it identifies on its own, search the web, and run code. VIDEO
Codeium has a $10/month plan that includes FIM (Fill In Middle) code suggestions they call “Supercomplete”. The plan also includes access to larger Codeium models and unlimited access to GPT-4o, Claude Sonnet (Chat, Codeium extensions).
Their “Cascade” agentic capabilities enable collaboration between AI and human, making it the ultimate partner for complex coding workflows.
CoPilots leverage the context of you’re typing to provide suggestions that help you write code faster.
VSCode makes suggestions automatically. But
to trigger a suggestion: Alt + \ or Option (⌥) + \
VSCode shows suggestions on the right.
To accept a suggestion, press the Tab key on a keyboard.
To dismiss inline code suggestion: Esc.
To see a list of suggestions to choose from, press ^ + Return on a Mac keyboard or Ctrl + Enter on Windows.
To open suggestions in a separate pane: Ctrl + Enter.
Show next suggestion — Alt + ] or Option (⌥) + ]
Show previous suggestion — Alt + [ or Option (⌥) + [
Most AI tools only give suggestions when there is no meaningful text after the cursor on the current line (ignoring single closing braces or colons).
PROTIP: To avoid suggestions, type a period and cursor left to type in front of it.
That’s unless you’re using Codeium, which has a “FIM” (Fill In Middle) feature.
REMEMBER: With Copilot: Reject with the left-arrow key. Accept suggestions by pressing the Tab key.
More frequent use of the left-arrow and Esc keys made keyboard automation more worthwhile.
PROTIP: It’s difficult to reach the arrow key, so I remapped the Caps Lock key to it.
PROTIP: Even better, I mappped my 3-key foot pedal to left-arrow on the left and Tab on the right.
A. Word Completion: As you type a word the AI recognizes, the AI suggests that word. Press Tab to accept the suggestion.
ai-word-completion.png
B. Code Completion: As you type code to call a known function name it recognizes, the AI generates code for that function.
This helps you avoid manually searching through public repositories for examples.
C. Generate Code: Under a function def, type a docstring in natural language (English) description of what that function does, and the AI generates the code described.
D. Autofill Repetitive Code: Type a few examples of the pattern. The AI adds other items following the pattern seen.
E. Run Tests:
F. Create an Application. See the PowerToys project. LogRocket uses Node.js app using React.js to generate a simple quote-generating app.
F. Translation: Translate one language to others (Duolingo uses GPT-3 to correct grammar)
G. Boilerplate Code: Generate RegEx code when presented with data
H. Explain code: Highlight code and it responds with questions about it
I. Convert descriptions of colors into hex codes
J. Create Alt Text for image.
For $20/month, $40/mo for OpenAI zero-data retention https://www.cursor.com/pricing from https://deepgram.com/ai-apps/cursor Cursor is a AI-first code editor designed for pair-programming. It provides features like chat, code generation, editing assistance, and debugging support. With the ability to understand your codebase, Cursor offers real-time suggestions and can generate code snippets based on your instructions. It integrates with popular code editors and is compatible with vscode extensions.
Amazon Q (for JetBrains, Visual Studio (VS) Code, Visual Studio, macOS Command Line) is a chatbot developed by Amazon for enterprise use. Based on both Amazon Titan and GPT generative artificial intelligence, it was announced on November 28, 2023. It is able to help troubleshoot issues in cloud apps or group chats, or summarize documents. As of November 2023, it costs $20 per month.
GitHub Copilot uses “generative AI” into an editor extension that suggests code in real-time.
See my explanation of Generative AI at https://wilsonmar.github.io/genai
Microsoft funded OpenAI to create GPT-3, a language model used to generate complex text from complex queries. OpenAI’s Codex translates natural language into programming code. GPT-3 (Generative Pre-trained Transformer 3&4) uses large models created using Deep Learning techniques to produce human-link text.
https://blogs.microsoft.com/blog/2023/03/16/introducing-microsoft-365-copilot-your-copilot-for-work/
GitHub Copilot uses the OpenAI (foundational) Codex to suggest code and entire functions in real-time.[1]
Microsoft co-opted the word “Copilot” as a brand name for AI tools that Microsoft has embedded in its line of products:
Microsoft’s AI is eerily smart becuase it knows your user metadata from all the above apps Microsoft has been saving in its Microsoft Graph database that combines email, calendar, contacts, and files into a single GraphQL database.
WARNING: For a long time, Microsoft, Google, Facebook, etc. are always listening. It’s always watching. It’s always learning. It’s always recording. It’s always saving. It’s always sharing. It’s always spying. It’s always tracking. It’s always analyzing. It’s always predicting. It’s always profiling. It’s always targeting.
CoPilots combines:
The GitHub Copilot certification exam assesses your proficiency in utilizing the AI-powered code completion tool across different programming languages, certifying your ability to streamline software development processes effectively.
Microsoft no longer has a waitlist for GitHub Copilot exam registration. The Copilot certification exam is available October 2024.
The official (detailed) documentation is at https://docs.github.com/copilot
https://docs.github.com/en/copilot/quickstart
https://github.com/
Take the 7 hr 38 min 11 (text-based) modules of the LEARN: GitHub Universe Cloud Skills Challenge
$119 3.5 hour Microsoft: AI-Powered Programming Video Course published by Pearson 11/14/2023.
Among GitHub learning pathways are Essentials of GitHub Copilot by Ryan Salva. It consists of “guides”:
https://aka.ms/GitHubCopilotAI redirects to https://github.com/microsoft/Mastering-GitHub-Copilot-for-Paired-Programming - an 8 Lesson course teaching everything you need to know about harnessing GitHub Copilot and an AI Paired Programing resource.
Microsoft does not offer a free trial but (unlike Azure and others) not a limited license for GitHub Copilot. Microsoft offers 3 plans at monthlies of: $10 Individual, $19 Business, and $39 Enterprise.
Business and Enterprise licenses add:
Only the Enterprise license requires GitHub Enterprise Cloud and provides:
If you have a student or educator email address, get Enterprise free:
Provide the validation information requested. Students may need to hold up to the camera their student ID or letter from the school.
Shortcut | Description |
---|---|
⌘I | Start Inline Chat to send a chat request to Copilot directly from the editor. Use natural language or use / commands to give instructions to Copilot. |
⌃⌘I | Open the Chat view and start a chat conversation with Copilot by using natural language. |
⇧⌘I | Open the Copilot Edits view and start a code editing session across multiple files. |
⇧⌥⌘L | Open Quick Chat and ask a quick question to Copilot. |
Type @ in chat or select to view the list of chat participants, which are domain experts that can help you in a specific area. Extensions can also contribute additional participants. Example: @workspace how is auth implemented?
Cheatsheet:GitHub Copilot in VS Code
GitHub Copilot X is Microsoft’s vision for the future of AI-powered software development adopting OpenAI’s newest GPT-4 models.
This assumes you have an email and GitHub account.
GitHub Copilot is available through GitHub personal accounts with GitHub Copilot for Individuals or through organization or enterprise accounts with GitHub Copilot for Business.
Sign up for for access to Copilot for Microsoft’s various tools: VS Code, Outlook, and OneNote.
Developed in collaboration with OpenAI, GitHub Copilot is powered by OpenAI Codex, an AI system created by OpenAI. OpenAI Codex has broad knowledge of how people use code and is more capable than GPT-3 in code generation, in part, because it was trained on a data set that includes a larger concentration of public source code.
Consider cost vs. features:
https://docs.github.com/en/copilot/overview-of-github-copilot/about-github-copilot About GitHub Copilot for Individuals says
This says “GitHub Copilot for Business automatically blocks common insecure code suggestions by targeting issues such as hard coded credentials, SQL injections, and path injections.”
https://github.com/settings/billing
“You are eligible to use GitHub Copilot for free.”
PROTIP: Start with GPT-3.5 to get started, then upgrade to GPT-4 when your users and use cases are better understood.
Regions: At time of writing (Aug 8, 2023) GitHub Copilot is available only in Regions listed at:
https://azure.microsoft.com/en-us/pricing/details/cognitive-services/openai-service/
US East, North Central US (GPT-4 only), South Central US,
Switzerland North (GPT-4 only), France Central, West Europe,
Japan East (GPT-4 only), Australia East (GPT-4 only).
If “GitHub Copilot for Business” is used, the Administrator establishes a policy for its use of at the enterprise-level. DOC:
Assign users:
Under “User permissions,” to enable GitHub Copilot for all users in your organization, select Allow for all members.
<ul>Alternately, select “Selected teams/users”.</ul>
Save.
Each user: Enable GitHub Copilot as VS Code extension:
Copilot is available as extensions on several IDEs:
https://plugins.jetbrains.com/plugin/17718-github-copilot
https://github.com/github/copilot.vim
https://marketplace.visualstudio.com/items?itemName=GitHub.copilot discussed below
Install VSCode using my instructions at
wilsonmar.github.io/text-editors/#VSCode
Extensions are also available for Microsoft’s licensed Visual Studio, If you prefer vim’s keyboard (for less mouse), Neovim and the JetBrains suite of integrated development environments (IDEs).
Click “Extensions” in the menu, then scroll down to click “Copilot”.
Copilot Voice is voice recognition software that allows you to speak code into your computer.
Alternately, in settings.json
"editor.inlineSuggest.enabled": true,
Open the VS Code Command Palette.
Scroll down:
- Is `win-ca` installed?: false - Is `mac-ca` installed?: false
??? select GitHub Copilot: Collect Diagnostics from the list
Troubleshooting guidance:
https://docs.github.com/en/copilot/troubleshooting-github-copilot/viewing-logs-for-github-copilot-in-your-environment
https://github.com/skills/copilot-codespaces-vscode
Microsoft Security Copilot at https://aka.ms/SecurityCopilot is an AI assistant for threat/vulnerability investigation and improving security posture.
VIDEOS: Overview,
DEMO:
It provides a prompt bar for English-language queries.
Drop additional files to ask questions about them.
Click the “Pin” icon to save a query for later. It dynamically updates.
A “Prompt Book”.
It can reverse-engineer a script and generates a flowchart to explain what it does. For example:
In a typical incident, this boost translates into gains in the quality of detection, speed of response and ability to strengthen security posture.
It makes use of a security-specific foundational LLM model trained by Microsoft, which added a learning system to create and tune new skills. It is a closed-loop learning system, which means it’s continually learning from users and giving them the opportunity to give explicit feedback with the feedback feature that is built directly into the tool. It continues to learn from interactions, adjusting its responses to create more coherent, relevant, and useful answers.
Security Copilot aims to catch what other approaches might miss. and augment an analyst’s work.
GitHub Advisory Database Security vulnerability database inclusive of CVEs and GitHub originated security advisories from the world of open source software.
PROTIP: Write tests to ensure that you’re getting what you want.
Microsoft offers paid Business licenses which include a “Copilot” license, at $50 per user per year. Such a license enables suggestions based only on private information – to block use of public code.
https://learn.microsoft.com/en-us/training/modules/introduction-to-github-copilot/2-github-copilot-your-ai-pair-programmer
[1] https://learn.microsoft.com/en-us/training/modules/introduction-to-github-copilot/
https://github.com/features/copilot
https://docs.github.com/en/copilot/overview-of-github-copilot/about-github-copilot#using-github-copilot Using GitHub Copilot
Level Up with GitHub Copilot 2023-04-03 by Rizel Scarlett (@blackgirlbytes, https://github.com/galaxy-bytes).
https://www.youtube.com/watch?v=2nPoiUJpDaU GitHub Copilot in VSCode: Top 10 Features Explained by Max Rohowsky (Max on Tech)
https://www.youtube.com/watch?v=RDd71IUIgpg “CoPilot Review: My Thoughts After 6 Months” by ThePrimeagen
https://www.youtube.com/watch?v=Wap2tkgaT1Q “Why I’m no longer using Copilot” by Dreams of Code
https://www.youtube.com/watch?v=S_RorY_FRvo “GitHub Copilot just got promoted to Captain” by Fireship
https://github.com/alekspopovic/simple-react-timeline