GitHub Copilot CLI: a real session in the terminal

GitHub Copilot Real Sessions · Session 9 of 9

In this post we are going to cover the GitHub Copilot CLI: Copilot in the terminal. This is session 9 of the GitHub Copilot real sessions series.

The Copilot CLI is the same Copilot agent, but you talk to it in the terminal and not in the VS Code chat panel. It can read your files, run commands with your approval, and answer one-line prompts. In this post we use it on the demo repository from the earlier sessions.

Everything here comes from a real session in VS Code, recorded in November 2026. I show what I typed, what Copilot answered, and what the terminal printed. Copilot words its answers differently each time, so your screen will not match mine word for word.

Session 9 of the GitHub Copilot in VS Code: Real Sessions series on TechBrothersIT.

Step 1: Check that the Copilot CLI is installed

Terminal
gh copilot --version
Output
GitHub Copilot CLI 1.0.114.
Run 'copilot update' to check for updates.
Keep in mind

In my GitHub Codespace the CLI was already installed and already signed in. On your own computer you may have to install it and sign in first. The official GitHub documentation has the current steps.

Step 2: Start it

Terminal
copilot

The terminal turns into a chat. At the top there are tabs: Current, Sessions, Issues, Pull requests and Gists. At the bottom is the prompt line, with the folder and git branch above it and the mode below it: Interactive, Manual Approval. Manual approval means it asks before it runs anything.

Step 3: Ask a question about the repository

Prompt
Which Python files in this repo have no tests? Give a short list. Do not change anything.

It shows its work as it goes:

What Copilot did
Search "**/*.py"       9 files found
Search "**/test_*.py"  4 files found
Search "**/*_test.py"  No matches found
Search "**/tests/**"   No matches found

Read test_billing.py   13 lines read
Read test_legacy.py    16 lines read
Read test_pipeline.py  36 lines read
Read test_dates.py     31 lines read

tasks/find_errors.py has no corresponding test file.

That is correct. On the right of the prompt line it showed the cost of the session so far: 0.28 AIC (AI credits).

Step 4: Let it run a command, with your approval

Prompt
Run python pipeline.py and tell me which customer has the highest total.

Copilot shows the exact command and asks:

Approval prompt
Run the order pipeline

  python pipeline.py

Do you want to run this command?
> 1. Yes
  2. No, and tell Copilot what to do differently (Esc to stop)

I pressed Enter for Yes. It ran the script, read the output, and answered:

Copilot's answer
Sara has the highest total: 1650.0.

Step 5: Look at the slash commands

Type / and a list of commands opens. These are some of the first ones on my screen:

Slash commands
/add-dir     Allow file access to a directory
/agent       Browse and select agents
/allow-all   Enable all permissions (tools, paths, and URLs)
/ask         Ask a side question without adding to history

The start screen also mentions /model to switch models. /exit closes the session.

Step 6: Run a one-line prompt without the chat

With -p you give the prompt on the command line and get the answer back in the terminal.

Terminal
copilot -p "Explain sql/fix_slow.sql in one sentence."
Output
`sql/fix_slow.sql` creates an index on `big_orders.customer_id` to speed up queries that filter or join by customer.

Changes     +0 -0
AI Credits  0.22 (5s)

At the end it also prints the tokens used and a copilot --resume=... command, in case you want to continue that session later.

Key points to remember

  • copilot starts the chat in the terminal
  • Manual Approval: it shows each command and asks before it runs
  • copilot -p "..." answers one prompt and exits
  • It shows the AI credits each session used
  • Read the command before you say yes

This is an independent tutorial, not written or reviewed by GitHub. It shows one real session recorded in November 2026 with the GitHub Copilot Free plan in a GitHub Codespace. Features, menus, plans and models change often, and Copilot gives a differently worded answer each time.