GitHub Copilot in VS Code

What GitHub Copilot in VS Code is

GitHub Copilot is an AI coding assistant that lives directly inside Visual Studio Code. It uses OpenAI models, context from your editor and GitHub knowledge to suggest whole lines, functions and tests, or to answer questions about your codebase.

In my workflow I think of Copilot as a pair programmer inside VS Code: it drafts code for me, explains unfamiliar code, and helps me move faster through boilerplate while I stay responsible for architecture, correctness and security.

What I use it for

  • Generating boilerplate — CRUD handlers, test scaffolding, configuration objects.
  • Refactoring — propose alternative implementations that I then review and tune.
  • Explaining code — quick summaries of legacy code or unfamiliar libraries.
  • Working in new languages — using patterns from documentation without copy-paste.
  • Documentation — drafting comments, README snippets and basic examples.

The key discipline is to treat suggestions as proposals, not truth: I always review for correctness, security and style, and keep tests as the main safety net.

Quickstart and setup

Good starting guide from GitHub:

From that guide, the basic flow is:

  1. Ensure you have a GitHub account with a Copilot subscription or trial.
  2. Install the GitHub Copilot and (optionally) GitHub Copilot Chat extensions in VS Code.
  3. Sign in to GitHub from VS Code when prompted.
  4. Open a project folder and start typing in a supported language.
  5. Accept, reject or cycle through suggestions as they appear.
// Typical UX inside VS Code
// 1. Start typing a function or comment.
// 2. Copilot shows a gray suggestion inline.
// 3. Press Tab to accept, Esc to dismiss, or Alt+\ (Ctrl+Enter on some setups) to see more.
            

Core concepts in VS Code

Microsoft's documentation captures the main concepts well:

Key ideas I keep in mind:

  • Inline suggestions — completions as you type in the editor.
  • Chat — ask Copilot questions about files, symbols or errors.
  • Context — Copilot uses open tabs, the current file and possibly repo context.
  • Prompts as comments — natural language comments to guide generated code.
  • Controls — enable/disable per language, and manage what Copilot can see.
// Example: guiding Copilot with a comment
// Implement a function to validate an email address using a regular expression.
function isValidEmail(email) {
  // Copilot will propose a full implementation here based on the comment.
}
            

GitHub Copilot CLI and workflows

Beyond the editor, GitHub Copilot also has a CLI that lets you use AI assistance from your terminal. This is described in the GitHub Copilot CLI repository:

Conceptually, the CLI gives you commands like:

# Example patterns (check the repo for current syntax)

# Ask Copilot to explain a shell command before you run it
copilot explain "kubectl get pods --all-namespaces"

# Ask Copilot to help craft a command
copilot suggest "List all files modified in the last 2 days, sorted by modification time"
            

I treat this as complementary to VS Code: use the editor integration for code, and the CLI for shell and operational workflows.

Training videos and demos

Some useful videos to see Copilot in action:

When watching these, I focus on how people structure their prompts, how often they accept or modify suggestions, and how they keep tests and linters in the loop.