AI First VS Code Extension

The AI First Programming VS Code extension is a companion tool for the book series that provides easy access to book examples, prompts, and code responses. The extension includes a Language Model Chat Provider that returns exact code examples from the books, allowing you to practice with AI features in VS Code without using your Copilot token quota.

Features

Requirements

Installation

You can find the AI First Programming extension in the VS Code Extension Marketplace.

  1. Open VS Code
  2. Click on the Extensions icon in the left toolbar (represented by 4 squares)
  3. Type “ai first programming” or “ai first book” in the search bar
  4. Look for the extension published by Stephen Chin, Cassandra Chin, and Jennifer Reif (the authors of the AI First series)
  5. Click Install

After installation, you’ll see a new icon in the sidebar with a picture of a book that has “A” and “I” on the pages. Click this icon to open the extension.

Using the Plugin

Browsing Book Content

  1. Click the AI First Programming icon in the sidebar (the book icon with “A” and “I”)
  2. Navigate through the hierarchical structure:
    • BooksSectionsChaptersExamples
  3. Click on any example to view its details in a webview panel

Viewing Examples

When you click on an example, a panel will open showing:

Copying Prompts and Responses

Each example view includes copy buttons:

You can then:

  1. Open a new editor (Ctrl+N / Cmd+N)
  2. Paste the prompt into GitHub Copilot Chat (Ctrl+Shift+I / Cmd+Shift+I)
  3. Use the generated code, or if it doesn’t match the book example, paste the response from the plugin

Tip: We recommend always trying the prompt first, but don’t hesitate to use the book response if needed!

Enabling the AI First Book Examples Model

The AI First Programming extension includes a custom language model that returns exact code examples from the books. This feature allows you to practice using AI features in VS Code without using your Copilot token quota.

Step 1: Open an AI Prompt

  1. Open any file in VS Code
  2. Bring up an AI prompt by typing:
    • Mac: Cmd+I
    • Windows/Linux: Ctrl+I

Step 2: Access Model Selection

  1. Click on the model drop-down dialog in the chat interface, or
  2. Type the keyboard shortcut:
    • Mac: Cmd+Alt+.
    • Windows/Linux: Ctrl+Alt+.

This will bring up a pick list of available models.

Step 3: Open Manage Models

  1. In the model selection drop-down, click on “Manage Models…” (usually the last item)
  2. This opens the Manage Language Models dialog

Step 4: Enable AI First Book Examples

  1. In the Manage Language Models dialog, find “AI First Book Examples” (it should be near the top alphabetically)
  2. Click on it to open the model settings
  3. Check the checkbox to enable the model
  4. Click “OK” to save your changes

Step 5: Select the Model

  1. Return to your AI prompt
  2. Click the model selection drop-down again
  3. You should now see “AI First Book Examples” as an available option
  4. Select it to start using the book examples model

Using the Model

Once enabled and selected, all your prompts will return the exact code responses that match the book text. Benefits include:

Caution: The AI First Book Model only works with individual GitHub plans like Free and Copilot Pro. If you have an enterprise GitHub license from your work, the “Manage Models…” menu item will be missing from the drop-down. To use the AI First Book Model, you will need to create a separate GitHub account and associate it with Copilot.

Getting Started Walkthrough

When you first install the extension, VS Code will offer a getting started walkthrough that guides you through:

  1. Enabling the AI First Book Examples model
  2. Exploring the book content
  3. Opening examples
  4. Copying example code
  5. Using examples with GitHub Copilot Chat

You can access this walkthrough anytime from the VS Code welcome page or by searching for “Get Started with AI First Programming” in the Command Palette.

Keyboard Shortcuts

GitHub Repository

The extension is open source and available on GitHub:

View on GitHub →

You can report issues, contribute, or learn more about the extension’s development.

Support

For issues, questions, or contributions, please visit the GitHub repository.

Authors

This extension is created by the authors of the AI First Programming book series:


Enhance your AI First learning experience with the VS Code extension!