Skip to main content

GitHub Copilot CLI Workshop

Version

Tested against: GitHub Copilot CLI v0.0.415. Check releases for newer versions. Some features may change or new ones may be added.

Welcome to this hands-on workshop for mastering GitHub Copilot CLI! This workshop will take you from installation to advanced automation techniques.

Prerequisites

  • GitHub account with an active Copilot subscription (Pro, Pro+, Business, or Enterprise)
  • Node.js v22+ and npm v10+ (for npm installation method)
  • Basic command-line experience
  • A code editor (VS Code recommended)
  • Git installed and configured

Learning Objectives

By the end of this workshop, you will be able to:

  • Install and configure Copilot CLI on any platform
  • Use interactive and programmatic modes effectively, including slash commands
  • Manage sessions and delegate tasks to cloud agents
  • Create custom instructions with AGENTS.md and llm.txt
  • Control tool permissions and use --yolo mode safely
  • Configure and use MCP servers
  • Create and use skills from agentskills.io
  • Build custom agents for specialized workflows
  • Set up hooks for lifecycle automation
  • Manage context effectively with /context and /compact
  • Use autopilot mode for autonomous task execution
  • Leverage fleet command for parallel multi-agent workflows

Workshop Modules

#ModuleDurationDescription
01Installation15 minInstall via npm, Homebrew, or script
02Operating Modes & Commands30 minInteractive chat, slash commands, programmatic, and /delegate
03Session Management15 minContinue, resume, clear, and track sessions
04Custom Instructions25 minAGENTS.md, llm.txt, copilot-instructions.md
05Tools & Permissions20 minBuilt-in tools, allow/deny, --yolo mode
06MCP Servers25 minConfigure remote and local MCP servers
07Agent Skills20 minCreate and use skills, agentskills.io
08Plugins15 minPlugins and the marketplace ecosystem
09Custom Agents25 minBuild specialized agents and subagents
10Hooks20 minLifecycle hooks and automation
11Context Management15 min/context, /compact, token optimization
12Advanced Topics30 minAutopilot, Fleet, environment, CI/CD, LSP config, tips

Total estimated time: ~4.25 hours

Workshop Flow

How to Use This Workshop

  1. Follow in order - Modules build on each other
  2. Complete exercises - Hands-on practice reinforces learning
  3. Check expected outcomes - Verify your understanding
  4. Use the references - Official docs have more detail

Quick Reference Card

Essential Commands

# Start interactive session
copilot

# Programmatic mode (single prompt)
copilot -p "your prompt here"

# Allow specific tools
copilot --allow-tool 'shell(git)'

# Full autonomy (use carefully!)
copilot --yolo

# Resume last session
copilot --resume

Essential Slash Commands

CommandDescription
/helpShow all available commands
/clearClear session context
/contextView token usage
/compactCompress session history
/planCreate implementation plan before coding
/reviewRun code review agent
/diffReview changes made in current directory
/delegateHand off to cloud agent
/modelSwitch AI model
/mcpManage MCP servers
/initInitialize Copilot config for repo
/instructionsView and toggle custom instruction files
/cwdChange working directory

Environment Setup Check

Before starting, verify your environment:

# Check Node.js version (need v22+)
node --version

# Check npm version (need v10+)
npm --version

# Check Git
git --version

# Check GitHub CLI (optional but recommended)
gh --version

Ubuntu/Debian Quick Setup

If you are missing prerequisites (for example, in a fresh Docker container):

# Basic tools
apt-get update && apt-get install -y curl git jq gh

# Install uv (Python package manager)
curl -LsSf https://astral.sh/uv/install.sh | sh
source $HOME/.local/bin/env

# Install nvm and Node.js LTS
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
source ~/.bashrc
nvm install --lts

Getting Help


Ready to begin? Continue to Module 1: Installation