Ravindra BagaleCourses & study guides Track your progress

Guides · Generative AI

GitHub Copilot CLI for Beginners: Install, Login and First Agent Task

GitHub Copilot CLI is Copilot’s coding agent in your terminal. GitHub made it generally available on 25 February 2026. Install with npm install -g @github/copilot (Node.js 22+), run copilot, and type /login. It asks before running tools or editing files. As of 25 October 2026, it uses your Copilot plan’s requests; check GitHub’s Copilot plans page for what the Free plan includes. Use it in a git repo so you can review and undo.

Suppose Divya in Hyderabad has Copilot through the GitHub Student pack, and Noah in Chicago has Copilot Pro. Both open a practice repo, start copilot, ask it to add a README section and a test, approve each step, and check git diff.

Related pages

See also Codex vs Claude Code, and GitHub Copilot GH-300 Certification.

What you will learn in this guide

  • What Copilot CLI is
  • Install and login
  • Approving tools safely
  • A first task
  • Plans and requests

1. Why: the agent where your code runs

You already run git, tests and builds in the terminal. An agent there can do the same steps for you, with you approving each one.

2. What: key ideas

Item Meaning
copilot Starts the interactive agent
/login Sign in with GitHub
Tool approval Allow once, for the session, or deny
/model Pick a model if your plan allows
Requests Counted against your Copilot plan
Copilot CLI in five steps Steps from top to bottom: 1 Install Node 22 or newer, nodejs.org; 2 npm install the CLI, @github/copilot; 3 Run copilot and login, /login; 4 Ask one small task, Approve each tool; 5 Review with git diff, Commit or undo. 1Install Node 22 or newernodejs.org 2npm install the CLI@github/copilot 3Run copilot and login/login 4Ask one small taskApprove each tool 5Review with git diffCommit or undo

Figure 1. Copilot CLI in five steps: install Node, install the CLI, log in, ask one task, review with git diff.

3. How: install and start

  1. Install Node.js 22 or newer (on Windows you also need PowerShell 6+; WinGet users can run winget install GitHub.Copilot instead).
  2. Run npm install -g @github/copilot.
  3. cd into a git repo and run copilot.
  4. Type /login and finish sign-in in the browser.
  5. Ask one small task and approve tools one by one.

4. Sources (25 Oct 2026)

  • GitHub changelog: Copilot CLI generally available, 25 Feb 2026.
  • GitHub docs: install via npm @github/copilot (Node.js 22+), WinGet or Homebrew; Windows needs PowerShell 6+; an active Copilot plan is required.
  • Your organisation admin may need to enable Copilot CLI.

5. Worked example 1: install (start here)

In a terminal:

node -v
npm install -g @github/copilot
copilot --version

Expected output (yours will be similar, not the same):

v22.11.0
added 1 package in 10s
0.0.x

6. Worked example 2: login and first task

Inside your practice repo:

copilot
> /login
> Add a "How to run" section to README.md with the commands to install
  and test this project. Do not change other files.

Expected output (yours will be similar, not the same):

Copilot shows the planned edit, asks to approve the file write, then confirms the README change.

7. Worked example 3: review

After the task:

git diff README.md
git add README.md && git commit -m "docs: how to run"

Expected output (yours will be similar, not the same):

+## How to run
+pip install -r requirements.txt
+pytest

Names, amounts and companies in the examples are made up for practice.

8. Common mistakes

Mistake Risk Fix
Approving “all tools” on day one Risky commands Approve one at a time
Old Node version Install fails Node 22+
Running outside git Cannot undo Use a repo
Org blocks it Login error Ask your admin
Huge vague task Messy edits Small and specific

9. Try at home

Try at home

  1. Install Copilot CLI.
  2. Ask it to improve README.md.
  3. Review with git diff.

Recap

In short

  1. Copilot CLI is GA since 25 Feb 2026.
  2. npm install -g @github/copilot (Node 22+).
  3. Run copilot, then /login.
  4. Approve tools carefully.
  5. Review diffs before commit.

Approve one step at a time.

Frequently asked questions

Is Copilot CLI free?

It needs an active Copilot plan and uses its requests. Check github.com/features/copilot/plans for what each plan, including Free, allows.

Does it work on Windows?

Yes. GitHub docs list Windows (PowerShell 6 or higher), macOS and Linux.

Is it the same as gh copilot?

The old Copilot in the CLI extension is deprecated. Since January 2026, running gh copilot installs and launches the new Copilot CLI.

Can students get it?

Verified students can get Copilot through GitHub Education; check eligibility.