AI First Programming Extension
A companion extension for the AI First Programming 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
- Book Content Browser: Navigate through book content organized by book, section, chapter, and example in a convenient sidebar tree view
- Example Viewer: View detailed prompts and code responses with syntax highlighting
- Copy Functionality: Easily copy prompts and responses to use in your code editor
- AI First Programming Model: A custom language model that returns exact code examples from the books
- Language-Aware Matching: Automatically matches prompts based on your active editor's programming language
- Zero Token Cost: Use the AI First Programming model without consuming your Copilot token quota
Requirements
- Visual Studio Code version 1.102.0 or later
- GitHub Copilot (Free or Pro plan) - Note: Enterprise licenses may not support the "Manage Models" feature
Installation
You can find the AI First Programming extension in the VS Code Extension Marketplace.
- Open VS Code
- Click on the Extensions icon in the left toolbar (represented by 4 squares)
- Type "ai first programming" or "ai first book" in the search bar
- Look for the extension published by Stephen Chin, Cassandra Chin, and Jennifer Reif (the authors of the AI First series)
- 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.
Note: The extension is available in the VS Code Extension Marketplace.
Using the Plugin
Browsing Book Content
- Click the AI First Programming icon in the sidebar (the book icon with "A" and "I")
- Navigate through the hierarchical structure:
- Books → Sections → Chapters → Examples
- 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:
- Example Title and Description
- Prompts: The exact prompts used in the book
- Responses: The corresponding code responses with syntax highlighting
Copying Prompts and Responses
Each example view includes copy buttons:
- Copy Prompt: Copies the prompt text to your clipboard
- Copy Response: Copies the code response to your clipboard
You can then use the prompt in either of two ways:
Inline chat (recommended for inserting code directly):
- Open a new editor (
Ctrl+N / Cmd+N)
- Press
Ctrl+I / Cmd+I to open the inline chat above your cursor
- Paste the prompt and press Enter — the book example is inserted with a native Keep/X review overlay
Chat panel (recommended for reading and comparing):
- Open GitHub Copilot Chat with
Ctrl+Shift+I / Cmd+Shift+I
- Paste the prompt and press Enter
- The response appears as a code block with Insert at Cursor / Apply buttons
Tip: We recommend always trying the prompt first, but don't hesitate to use the book response if needed!
Enabling the AI First Programming 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
- Open any file in VS Code
- Bring up an AI prompt by typing:
- Mac:
Cmd+I
- Windows/Linux:
Ctrl+I
Step 2: Access Model Selection
- Click on the model drop-down dialog in the chat interface, or
- 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
- In the model selection drop-down, click on "Manage Models…" (usually the last item)
- This opens the Manage Language Models dialog
Step 4: Enable AI First Programming
- In the Manage Language Models dialog, expand the "AI First" provider group (it should be near the top alphabetically)
- Locate the "AI First Programming" model row
- Click the eye icon next to the model — when the row appears in bold, the model is visible in the chat picker. (The older "checkbox" UI was replaced in recent Copilot Chat builds.)
- Close the Manage Models dialog — your selection is saved automatically
Step 5: Select the Model
- Return to your AI prompt
- Click the model selection drop-down again
- You should now see "AI First Programming" as an available option
- 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:
- ✅ Exact book examples: Get the same code as shown in the book
- ✅ No token costs: Complete all book exercises without using your Copilot quota
- ✅ Language-aware: Automatically matches prompts based on your active editor's language
- ✅ Inline editing: Use
Ctrl+I / Cmd+I to insert book examples directly into your file with the native Keep/X diff review
- ✅ Practice mode: Perfect for learning AI-assisted coding without worrying about limits
Caution: The AI First Programming 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 Programming 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:
- Enabling the AI First Programming model
- Exploring the book content
- Opening examples
- Copying example code
- 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
- Open AI Prompt:
Cmd+I (Mac) / Ctrl+I (Windows/Linux)
- Model Selection:
Cmd+Alt+. (Mac) / Ctrl+Alt+. (Windows/Linux)
- Focus on AI First Books Panel: Use the command
ai-first-programming.focus or click the sidebar icon
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:
License
The extension source, documentation, generated artifacts, and distributable
examples are released under the Apache License 2.0. See
NOTICE for attribution.
The license does not grant rights to the AI First names or logos. See
TRADEMARKS.md.
Enjoy learning with AI First Programming!