Skip to content

laniakea2006/ghcli_demo

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 

Repository files navigation

QR code to https://github.com/jeffrey-groneberg/ghcli_demo
πŸ“± Scan to open this repo Β· github.com/jeffrey-groneberg/ghcli_demo

GitHub Copilot CLI β€” 45-Minute Live Demo Script

Based on the official course github/copilot-cli-for-beginners.

πŸ“ Heads up about the dedicated site: The old github.github.io/copilot-cli-for-beginners/ GitHub Pages site is gone (404). The course has been republished on the Awesome Copilot Learning Hub: https://awesome-copilot.github.com/learning-hub/cli-for-beginners/ Use that URL when you point the audience to the web version. Source of truth (and where this demo script comes from) is still the repo.


🎯 Demo Goal

In 45 minutes, take an audience from "never used Copilot CLI" to "I understand the modes, slash commands, hotkeys, custom agents, skills, and MCP β€” and I know what to use when."

The whole demo runs against the sample app samples/book-app-project in the course repo (Python).

🧰 Pre-flight (do this BEFORE the audience joins)

# 1. Clone the course repo
git clone https://github.com/github/copilot-cli-for-beginners
cd copilot-cli-for-beginners

# 2. Confirm install + auth
copilot --version
copilot          # then: /login    (only if not signed in)

# 3. Confirm sample app runs
cd samples/book-app-project && python book_app.py list && cd ../..

# 4. Pre-warm one Copilot session so the first response is snappy
copilot -p "Say hello in one sentence."

If you only have time for one prep step: make sure copilot starts and the book app's list command works.


⏱️ Timeline at a Glance

Time Segment Course Chapter
00:00–03:00 Intro + what Copilot CLI is 00
03:00–10:00 First Steps: 3 demos + 3 modes 01
10:00–18:00 Context & Conversations 02
18:00–26:00 Development Workflows 03
26:00–32:00 Custom Agents & Instructions 04
32:00–37:00 Skills 05
37:00–42:00 MCP Servers 06
42:00–45:00 Putting it together + wrap 07

0) 00:00–03:00 β€” Intro & "Where does this live?"

Talking points (no commands):

  • Copilot CLI = AI pair programmer in your terminal. No IDE switch.
  • Family map (show the README table): Copilot CLI (terminal), Copilot in editors, Copilot on github.com, Copilot cloud/coding agent.
  • One sentence: "Anything you'd open a chat panel or a browser for, you can now do without leaving the prompt."

One-liner to project on screen:

copilot --version

1) 03:00–10:00 β€” First Steps (Chapter 01)

Goal: 3 quick wins, then introduce the 3 interaction modes.

Start the session

copilot

Show the trust prompt β†’ "Trust this folder."

Demo 1 β€” Code review in seconds (~90s)

At the > prompt:

> Review @samples/book-app-project/book_app.py for any security or code quality issues

Narrate as findings stream in: input validation, eval, file handling, etc.

Demo 2 β€” Explain confusing code (~90s)

> Explain @samples/book-app-project/books.py in plain English. What's the data model?

Demo 3 β€” Generate working code (~90s)

> Write a bash script that backs up books.json with a timestamped filename and keeps the 5 most recent backups

Accept the suggestion β†’ run it β†’ show the file appeared.

The Three Modes (~2 min)

Show all three explicitly. Hotkey: Shift+Tab cycles modes (Standard β†’ Plan β†’ Autopilot).

Mode How to enter When to use
Interactive Default when you run copilot Exploration, Q&A, iterative work
Plan /plan or Shift+Tab once Multi-step work β€” review the plan, then go
Autopilot Shift+Tab again, or copilot --autopilot Hands-off execution after a good plan
Programmatic copilot -p "prompt" from shell CI, scripts, one-shot pipelines

Live demo of -p:

copilot -p "List the functions defined in @samples/book-app-project/book_app.py with one-line descriptions"

Exit with:

> /exit

2) 10:00–18:00 β€” Context & Conversations (Chapter 02)

Goal: show how Copilot CLI sees your project. Files, issues, sessions, sharing.

Restart Copilot:

copilot

@ to attach files

> Compare @samples/book-app-project/book_app.py and @samples/book-app-project/books.py β€” where is responsibility split, and where is it leaky?

Hotkey: type @ to trigger the file picker (Tab completes paths).

# to attach an issue or PR

> Summarize #1 from this repo and list any acceptance criteria

! to shell out without leaving Copilot

> !ls samples/book-app-project

/add-dir to widen file access

> /add-dir samples/book-app-project-js

Session management

Command What it does
/clear or /new Start a fresh conversation (drop context)
/compact Summarize history to free context window
/context Show token usage gauge
/rewind (or Esc Esc) Open the timeline picker, jump back to any earlier point
/session Manage saved sessions
/share Get a link + QR code to follow the live session on phone

Live:

> /context
> /share

(Open the QR on your phone for "wow" factor.)

Pasting images

Say one line: "Cmd+V (Mac) / Ctrl+V pastes a screenshot β€” Copilot reads the image."


3) 18:00–26:00 β€” Development Workflows (Chapter 03)

Goal: review, debug, generate tests, ship a PR.

Targeted review

> /review @samples/book-app-project/book_app.py focus on security

Or:

> Review @samples/book-app-project/books.py and group findings as: πŸ”΄ critical, 🟑 should-fix, 🟒 nice-to-have

Debug with a symptom

> @samples/book-app-project/book_app.py β€” when I run `python book_app.py find author "Tolkien"` it returns 0 results even though "The Hobbit" by J.R.R. Tolkien exists. Find the root cause and propose a fix.

Generate tests

> Generate pytest tests for @samples/book-app-project/books.py β€” cover happy paths, edge cases (empty collection, duplicates), and use @pytest.mark.parametrize where it makes sense. Place them under samples/book-app-project/tests/

Run them:

> !cd samples/book-app-project && pytest -q

Git workflow β€” the big three

Command Purpose
/diff Summarize current uncommitted changes
/pr Operate on the PR for the current branch (create / summarize)
/delegate (or prefix &) Hand off a self-contained task to the GitHub Copilot cloud agent β€” it runs in the background and opens a PR

Live (only if branch is ready):

> /diff
> Write a conventional commit message for these changes
> /pr

Delegate example to mention (don't necessarily run live):

> & Add a --json flag to `python book_app.py list` and update the README accordingly

4) 26:00–32:00 β€” Custom Agents & Instructions (Chapter 04)

Goal: show how to make Copilot behave like your team.

Custom instructions (the "always-on" rules)

copilot init   # scaffolds .github/copilot-instructions.md (and/or AGENTS.md)

Open the file, point out:

  • Project description
  • Coding standards
  • Things to never do

Custom agents (personas you switch into)

Show the file structure (.github/agents/<name>.md with frontmatter), then live:

> /agent

Select an agent (e.g. python-reviewer) β€” Copilot is now wearing that hat.

Then:

> Review @samples/book-app-project/books.py

Same prompt as before, noticeably different output because the agent has its own persona, model, and tool allow-list.

Other useful commands here:

Command Purpose
/agent Pick / switch active agent
/model Switch the LLM
/memory Inspect / edit long-term memory the agent has captured
/env Show loaded instructions, agents, skills, MCP servers

5) 32:00–37:00 β€” Skills (Chapter 05)

Goal: skills = modular capabilities that auto-activate based on your prompt.

Show what's loaded

> /skills

Trigger one with a natural prompt

Skills are matched by their description. So a prompt like the following will automatically engage a testing skill if one is registered:

> Following our team's testing conventions, add a test for the add_book function in @samples/book-app-project/books.py

Narrate: "Notice it picked up the testing skill from ~/.copilot/skills/ β€” I never had to name it."

Quick differentiation slide

  • Custom instructions = always-on rules (every prompt)
  • Agents = personas you explicitly switch into (/agent)
  • Skills = modular capabilities that auto-activate when relevant

6) 37:00–42:00 β€” MCP Servers (Chapter 06)

Goal: extend Copilot CLI to talk to GitHub, the filesystem, docs sites, databases, etc.

Show what's connected

> /mcp show

Built-in GitHub MCP

> Using the GitHub MCP, list the last 5 issues opened on this repo and their labels
> What did the most recent commit on main change, and why?

Add a server (talk-through, don't necessarily edit live)

Show the config file path: ~/.copilot/mcp-config.json, then list common ones:

Server What it gives you
github Repos, issues, PRs, code search (built-in)
filesystem Broader file access beyond the cwd
context7 Up-to-date library/docs lookup
microsoft-learn Official Microsoft docs

From a shell (NOT inside Copilot):

copilot mcp list
copilot mcp enable github

Multi-server moment (the punchline)

> Use the filesystem MCP to find every place we touch books.json, then use the GitHub MCP to check if any open PR is already changing those files, then recommend whether I should start a new branch.

7) 42:00–45:00 β€” Putting It All Together (Chapter 07) + Wrap

One idea-to-PR flow in a single session:

copilot
> /plan
> Add a `list-unread` command to @samples/book-app-project/book_app.py that prints books where read=False, with --json support
# Review plan, hit Shift+Tab to autopilot OR accept and continue interactively
> /agent       # switch to python-reviewer
> Implement the plan
> /agent       # switch to pytest-helper
> Generate tests
> !cd samples/book-app-project && pytest -q
> /diff
> /pr

Close with the same slide you opened on: family map β†’ emphasize CLI is now a peer of the editor and cloud agent.


⌨️ Hotkey Cheat Sheet (project this on a side monitor)

Global (interactive UI)

Keys Action
Shift+Tab Cycle mode: Standard β†’ Plan β†’ Autopilot
Tab Tab-complete slash commands, file paths, suggestions
@ Insert a file reference (with picker)
# Reference a GitHub issue or PR
! Run a local shell command without leaving Copilot
? Quick help (on an empty prompt)
Esc Cancel current operation
Esc Esc (double) Cancel in-flight work / open /rewind timeline picker
Ctrl+C Cancel / clear input (twice = exit)
Ctrl+D Shut down
Ctrl+L Clear the screen
Ctrl+G or Ctrl+X e Edit prompt in $EDITOR
Ctrl+V Paste image from clipboard as attachment
Ctrl+R Reverse-search history
Ctrl+Enter / Ctrl+Q Queue a message while agent is busy
Shift+Enter / Option+Enter / Alt+Enter Newline in input
Ctrl+X then / Run a slash command without retyping your prompt
Ctrl+X then b Send the running task to the background
Ctrl+X then o Open the most recent link from the timeline
Ctrl+Z Suspend Copilot to background (Unix)

Timeline

Keys Action
Ctrl+F Search the timeline
Ctrl+O Expand recent timeline items (empty prompt)
Ctrl+E Expand all timeline items (empty prompt)
Ctrl+T Toggle reasoning display
PgUp/PgDn Scroll timeline

Session picker (/session or --continue)

Keys Action
↑/↓ Move selection
Enter Open session
Tab Switch local ↔ remote
s Cycle sort order
d Delete selected session
Esc Close picker

πŸ”€ Slash Command Cheat Sheet (the ones worth showing)

Command Purpose
/login Sign in via device flow
/help Built-in help
/exit /quit Leave the CLI
/clear /new Start a fresh conversation
/compact Summarize history to save context window tokens
/context Visualize token usage
/rewind Open timeline picker to jump back (or press Esc Esc)
/plan Enter Plan mode
/agent Browse / switch active agent
/model Switch the LLM
/memory Inspect / edit Copilot's long-term memory
/skills List available skills
/mcp /mcp show Manage / view MCP servers
/env Show loaded instructions, agents, skills, MCP, plugins
/init Scaffold project-level custom instructions
/add-dir PATH Allow Copilot to read files in another directory
/cwd /cd PATH Show or change the working directory
/review Code review
/diff Summarize current changes
/pr Work with the PR for the current branch
/delegate (or & prefix) Hand off a task to the GitHub Copilot cloud agent
/research Deep research with web + GitHub sources
/share Get a link/QR to follow the session on another device
/session Manage saved sessions
/feedback /bug File feedback
/copy Copy the last response to clipboard
/ask QUESTION Quick "off the record" question (experimental)
/yolo /allow-all Grant full permissions for this session
/terminal-setup Enable multiline (Shift+Enter / Ctrl+Enter) in your terminal

πŸ†˜ Recovery Moves (if something goes sideways live)

Symptom Fix
Copilot is running too long / hallucinating Press Esc Esc β†’ pick an earlier turn
Output is huge and noisy /compact
Wrong mental model / drifted off-topic /clear and restart with tighter prompt
Permissions dialog blocking flow /allow-all on (only for demos!)
Forgot the slash command name Just type / and press Tab
Need to edit a long prompt Ctrl+G (opens $EDITOR)
Want to keep typing while it works Ctrl+Enter to queue the next message

πŸ“š Pointers for the audience (last slide)

About

45-minute live demo script for GitHub Copilot CLI, based on the github/copilot-cli-for-beginners course.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors