Module 2 of 10 · CLI Comparison Track
20%
MODULE 02 · SETUP

Get All Three Running —
Setup Comparison

Install Claude Code, Gemini CLI, and GitHub Copilot CLI from zero. Understand auth patterns, project config files, and why the first command you type reveals each tool's fundamental design philosophy.

Claude Code Gemini CLI Copilot CLI ~40 min Beginner Windows & Mac/Linux

Overview — Installing All Three

Before you write a single prompt, you need all three tools on your machine and authenticated. This module walks you through each installation side-by-side, including the differences in auth models and project config files that will shape everything you do later in the course.

The installs are intentionally straightforward — Node.js is the only shared prerequisite for two of the three tools. GitHub Copilot CLI adds one extra dependency: the GitHub CLI itself. We'll cover that in the Copilot section.

Install Timeline — All Three Tools
Claude Code
Verify Node.js 18+: node --version
0:00
Install: npm install -g @anthropic-ai/claude-code
0:30
Run claude — browser opens for OAuth
1:00
Authorize in Claude.ai — token saved locally
2:00
Verify: claude --version
2:30
Done in ~5 min total
Gemini CLI
Windows only: fix execution policy first
0:00
Install: npm install -g @google/gemini-cli
0:45
Run gemini — Google OAuth in browser
1:15
Sign in with Gmail — free tier activated
2:00
Verify: gemini --version
2:30
Done in ~5 min total
Copilot CLI
Install GitHub CLI: winget install GitHub.cli (or brew)
0:00
Auth GitHub CLI: gh auth login
2:00
Install extension: gh extension install github/gh-copilot
4:00
Copilot reuses gh auth — no separate login
4:30
Verify: gh copilot --version
5:00
Done in ~10 min total
Claude Code: ~5 min
Gemini CLI: ~5 min
Copilot CLI: ~10 min (GitHub CLI dependency)
Do you need all three right now?

No. Install the one you plan to use first, then come back for the others as you reach modules that compare them. The setup steps are independent and won't interfere with each other.

Claude Code Setup

Claude Code
by Anthropic

Prerequisites

  • Node.js 18 or higher — check with node --version
  • Claude.ai account — create free at claude.ai (for OAuth login)
  • OR: Anthropic API key — for BYOK/CI/CD setups

Installation & First Launch

Both platforms use the same npm package. The only difference is the PowerShell execution policy step on Windows (explained below).

PowerShell
# WHAT: Fix Windows script execution policy (one-time, per user)
# WHY:  npm global CLIs run .ps1 scripts; blocked by default on Windows
# GOTCHA: -Scope CurrentUser does NOT require admin; -Scope LocalMachine does
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser

# WHAT: Install Claude Code globally via npm
# WHY:  -g makes `claude` available in any directory
# GOTCHA: Requires Node.js 18+. Check with: node --version
npm install -g @anthropic-ai/claude-code

# WHAT: Start Claude Code (triggers auth flow on first run)
# WHY:  First launch opens browser for Anthropic OAuth
claude
bash / zsh
# WHAT: Install Claude Code globally via npm
# WHY:  -g makes `claude` available from any directory
# GOTCHA: If you get a permissions error, use `sudo npm install -g`
#         or switch to a user-managed Node.js (nvm recommended)
npm install -g @anthropic-ai/claude-code

# WHAT: Start Claude Code — triggers OAuth browser flow on first run
# WHY:  Anthropic stores your auth token locally; no password needed again
claude

Authentication Options

1
Claude.ai OAuthOAuth (Open Authorization) is a protocol that lets you grant an app access to your account without sharing your password. The app gets a token instead; you can revoke it at any time from your account settings. Recommended
Browser-based login using your existing claude.ai subscription. Tokens are managed automatically — no expiry headaches. Best for individual developers doing interactive work.
2
API Key (BYOKBYOK = Bring Your Own Key. You supply an API key from the provider's console rather than using an OAuth flow. Common in CI/CD, headless servers, and enterprise setups where a browser isn't available.)An API key is a secret string (like a password) that identifies your account to the Anthropic API. Set it as the ANTHROPIC_API_KEY environment variable — never hardcode it in source files.
Set ANTHROPIC_API_KEY as an environment variable. Use this for CI/CD pipelines, headless servers, or when you need per-token billing visibility. Billed per token at Anthropic API rates.
Free tier reality: Claude Code requires Claude Pro ($20/mo) or Anthropic API credits. There is no meaningful free tier for agentic, multi-step use. The npm install itself is free; the model access is not.

Project Configuration: CLAUDE.md

Create a CLAUDE.md file in your project root. Claude Code reads it automatically every time you start a session in that directory — it's your persistent context injection.

CLAUDE.md (example)
# Project: my-api

## Stack
- Node.js 20, Express 5, PostgreSQL 16
- All code in TypeScript (strict mode)

## Conventions
- Use async/await, never callbacks
- All DB queries go through `src/db/` — never raw SQL in routes
- Error responses: `{ error: string, code: string }` format

## Commands
- `npm run dev` — start dev server with hot reload
- `npm test` — run Jest tests
- `npm run db:migrate` — run pending Prisma migrations

## Do not modify
- `src/generated/` — auto-generated Prisma types
- `dist/` — build output

Windows Gotcha: Execution Policy

PowerShell script execution is blocked by default

If you see "running scripts is disabled on this system" when running claude, run this once: Set-ExecutionPolicy RemoteSigned -Scope CurrentUser. This affects Claude Code and Gemini CLI equally. Copilot CLI is unaffected because it runs through the gh native binary.

Verification

PowerShell / bash
# Check version
claude --version

# Run your first real command (works in any directory)
claude "What files are in this directory?"

Gemini CLI Setup

Gemini CLI
by Google

Prerequisites

  • Node.js 18 or higher — same requirement as Claude Code
  • Google account — any Gmail works for the free tier
  • OR: Gemini API key — from aistudio.google.com for Pro model access

Installation & First Launch

PowerShell
# WHAT: Fix execution policy (same issue as Claude Code — do this once)
# WHY:  npm CLI shims use .ps1 scripts, blocked by Windows default policy
# GOTCHA: Skip this if you already did it for Claude Code
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser

# WHAT: Install Gemini CLI globally
# WHY:  Makes `gemini` available system-wide
npm install -g @google/gemini-cli

# WHAT: First launch — triggers Google OAuth browser flow
# WHY:  Google uses the same OAuth 2.0 flow you know from Google Sign-In
gemini
bash / zsh
# WHAT: Install Gemini CLI globally
# WHY:  No execution policy needed on Mac/Linux
# GOTCHA: Use nvm to avoid permissions issues with global npm installs
npm install -g @google/gemini-cli

# WHAT: First launch — browser-based Google login
gemini

Authentication Options

1
Google OAuth Recommended
Uses your existing Google/Gmail account. Free tier is granted automatically: 1,500 requests/day on Gemini 2.5 Flash. No credit card required. Best option for solo devs and students.
2
GEMINI_API_KEYGet your Gemini API key from aistudio.google.com. Free-tier keys have the same 1,500 req/day limit. Paid keys unlock Gemini 2.5 Pro and higher rate limits.
Required to access Gemini 2.5 Pro models and for headless/CI use. Get a key at aistudio.google.com. Set as GEMINI_API_KEY environment variable.
Free tier reality: 1,500 requests/day with Gemini 2.5 Flash. Genuinely free for solo developers. No credit card needed. Flash is fast, competent, and sufficient for most daily tasks.

Project Configuration: GEMINI.md

Create GEMINI.md in your project root — nearly identical structure to CLAUDE.md. If you already have a CLAUDE.md, you can copy it and rename it. The format is the same; only the reading tool changes.

💡
90% portability: CLAUDE.md → GEMINI.md

The section structure, tone, and most content from your CLAUDE.md transfers directly. The main difference: Gemini may reference its own tool names (e.g., web search, code execution) in the instructions section. We cover this fully in Module 03.

Verification

PowerShell / bash
gemini --version
gemini "What files are in this directory?"

GitHub Copilot CLI Setup

GitHub Copilot CLI
by Microsoft / GitHub

Prerequisites

  • GitHub account — free GitHub account is sufficient to install
  • Active Copilot subscription — $10/mo individual or $19/mo business (to actually run commands)
  • GitHub CLIThe GitHub CLI (gh) is an official command-line tool for GitHub that lets you manage repos, PRs, issues, and more from the terminal. Copilot CLI is installed as an extension on top of it, not as a standalone tool. — must be installed first; Copilot CLI is a gh extensionA gh extension is a plugin for the GitHub CLI, installed with `gh extension install`. Extensions add new subcommands to `gh`. Copilot CLI adds `gh copilot suggest` and `gh copilot explain`., not a standalone npm package
🛈
Architecture note: extension, not standalone

Unlike Claude Code and Gemini CLI (independent npm packages), Copilot CLI is a plugin that rides on top of the existing gh tool. This is intentional — GitHub designed it to integrate deeply with gh auth, repos, and Actions rather than operate as an independent agent.

Installation

PowerShell
# STEP 1 — WHAT: Install the GitHub CLI via winget
# WHY:  Copilot CLI is a gh extension — gh must exist first
# GOTCHA: winget is built into Windows 10/11. If absent, install from
#         github.com/cli/cli/releases
winget install GitHub.cli

# STEP 2 — WHAT: Authenticate with GitHub
# WHY:  `gh auth login` stores a GitHub OAuth token locally
#       Copilot CLI reuses this token — no separate auth needed
gh auth login

# STEP 3 — WHAT: Install the Copilot CLI extension
# WHY:  Adds `gh copilot` subcommands to an existing gh installation
# GOTCHA: Requires an active Copilot subscription ($10/mo+) to run commands
gh extension install github/gh-copilot
bash / zsh
# STEP 1 — Install GitHub CLI via Homebrew
brew install gh

# STEP 2 — Authenticate (opens browser or device flow)
gh auth login

# STEP 3 — Install Copilot CLI as a gh extension
gh extension install github/gh-copilot

Authentication

Copilot CLI authenticates entirely through gh auth login — GitHub OAuth. There is no separate COPILOT_API_KEY environment variable. The Copilot subscription is tied to your GitHub account, verified automatically when you run a command.

Free tier reality: GitHub Free accounts get 2,000 Copilot completions/month — but that's for the IDE plugin only. Copilot CLI requires a paid Copilot subscription. The install steps above work for free; actually running gh copilot suggest requires $10/mo.

Project Configuration

Copilot CLI does not read a project config file during terminal sessions. There is no equivalent to CLAUDE.md or GEMINI.md. However, for GitHub repository context (PRs, issues), you can create .github/copilot-instructions.md.

copilot-instructions.md.github/copilot-instructions.md provides repository-level guidance to GitHub Copilot. It's read in IDE context (code completions, PR reviews) but is NOT loaded into Copilot CLI terminal sessions the way CLAUDE.md is for Claude Code. has limited scope

.github/copilot-instructions.md influences Copilot in the IDE and during PR/code review, but it is not injected into gh copilot suggest terminal sessions. If project-level context injection matters to your workflow, this is a meaningful limitation vs. Claude Code or Gemini CLI.

Verification

PowerShell / bash
gh copilot --version

# Copilot CLI's primary use case: shell command translation
gh copilot suggest "list all running Docker containers"

Installation Comparison Table

Quick reference for every dimension that matters when getting set up. Save this for when you're helping a teammate get started.

Step / Attribute Claude Code Gemini CLI Copilot CLI
Prerequisites Node.js 18+ Node.js 18+ Node.js + GitHub CLI
Install command npm i -g @anthropic-ai/claude-code npm i -g @google/gemini-cli gh extension install github/gh-copilot
Auth method Anthropic OAuth / API key Google OAuth / API key GitHub OAuth (via gh)
Windows policy fix Required Required Not needed
Free tier ❌ No ✓ 1,500/day ⚠ IDE only
Project config file CLAUDE.md GEMINI.md .github/copilot-instructions.md
Config injected in terminal? ✓ Yes ✓ Yes ❌ No
Time to first command ~5 min ~5 min ~10 min

Config Files Compared

Here's the same project described in all three config formats. Pay attention to how much carries over from CLAUDE.md to GEMINI.md — and how different (and limited) the Copilot version is.

Config File Side-by-Side Diff
CLAUDE.md
# Project: order-api

## Stack
Node.js 20, Express 5
PostgreSQL 16, Prisma ORM
TypeScript strict mode

## Conventions
- async/await only
- Errors: { error, code }
- DB queries in src/db/

## Commands
- npm run dev
- npm test
- npm run db:migrate

## Do not modify
- src/generated/
- dist/
GEMINI.md (~same + web toggle)
# Project: order-api

## Stack
Node.js 20, Express 5
PostgreSQL 16, Prisma ORM
TypeScript strict mode

## Conventions
- async/await only
- Errors: { error, code }
- DB queries in src/db/

## Commands
- npm run dev
- npm test
- npm run db:migrate

## Do not modify
- src/generated/
- dist/

## Gemini tools
- Use web search for
  external API docs
- Code execution OK
  for npm scripts
.github/copilot-instructions.md
# order-api

Node.js/TypeScript REST
API for order tracking.

Follow existing patterns
in src/routes/ when
suggesting new endpoints.

Use Prisma ORM for all
database access.

Prefer async/await.


(terminal sessions do not
read this file — IDE and
PR reviews only)
💡 Key insight: CLAUDE.md and GEMINI.md are ~90% identical. Copy and rename when switching. The Copilot version is simpler and only reaches terminal sessions indirectly (through IDE suggestions, not gh copilot suggest).

The practical implication: if you're evaluating Gemini CLI against Claude Code on a project you already use Claude Code on, your setup cost is nearly zero. Just copy CLAUDE.md to GEMINI.md and add any Gemini-specific tool guidance.

Auth Patterns Deep Dive

All three tools support multiple auth methods, but they're designed for different use cases. Here's when to reach for each pattern.

Pattern 1 — OAuth (Personal Accounts)

Best for: individual developers, interactive terminal use. Tokens are managed automatically — you authenticate once and the CLI refreshes tokens in the background. No env var management needed.

All three tools support this. Gemini CLI's free tier is only available via Google OAuth (API keys require aistudio.google.com). Copilot CLI only supports OAuth (via gh auth); there is no API key path.

Pattern 2 — API Key (BYOK)

Best for: CI/CD pipelines, automated scripts, headless servers, teams that need per-token billing visibility. Set the key as an environment variable — never in source files.

PowerShell
# WHAT: Set API keys for Claude Code and Gemini CLI
# WHY:  $env: sets a process-level variable (current session only)
#       For permanent: use System env vars in Windows Settings
# GOTCHA: $env: variables are NOT inherited by child processes in some cases
#         Add to your PowerShell $PROFILE for persistence

# Claude Code
$env:ANTHROPIC_API_KEY = "sk-ant-..."

# Gemini CLI (for Pro model access or CI/CD)
$env:GEMINI_API_KEY = "AIza..."

# Copilot CLI uses gh auth — no env var path
# To auth in a CI environment:
echo "YOUR_GITHUB_TOKEN" | gh auth login --with-token
bash / zsh
# WHAT: Export API keys for Claude Code and Gemini CLI
# WHY:  `export` makes variables available to child processes
# GOTCHA: These are session-only — add to ~/.bashrc or ~/.zshrc for persistence

# Claude Code
export ANTHROPIC_API_KEY="sk-ant-..."

# Gemini CLI
export GEMINI_API_KEY="AIza..."

# Copilot CLI — uses gh auth, not env vars
# For CI: pipe a token into gh auth
echo "$GITHUB_TOKEN" | gh auth login --with-token

Pattern 3 — Enterprise SSO

Best for: corporate environments with managed identities, policy controls, and audit requirements. Each tool has its own enterprise offering:

  • Claude Code: Anthropic Teams/Enterprise plans — SSO, audit logs, usage policies, Constitutional AI policy controls
  • Gemini CLI: Google Workspace integration — uses your org's Google account, respects Workspace data governance settings
  • Copilot CLI: GitHub Enterprise — Copilot Business ($19/seat/mo), managed through GitHub org settings
🛈
CI/CD auth summary

For automated pipelines: Claude Code and Gemini CLI both use standard environment variable API keys — straightforward for GitHub Actions secrets. Copilot CLI uses gh auth login --with-token piped from a GITHUB_TOKEN secret. All three have well-documented CI integration paths.

First Commands Compared

Let's run the exact same prompt in all three tools and see what happens. This isn't just a demo — the responses reveal each tool's architectural philosophy more clearly than any description.

The Prompt

"List the 3 most recently modified files in this directory and summarize what each one does"

A simple question that mixes file system access with natural language summarization. All three tools can technically handle this — but they interpret "handle" very differently.

Same Prompt — Three Different Interpretations
Prompt "List the 3 most recently modified files in this directory and summarize what each one does"
Claude Code
Reading directory...
→ package.json (2m ago)
→ src/routes/orders.ts (5m ago)
→ .env.local (12m ago)
 
package.json: Project manifest,
Node 20, 4 deps, start script.
 
orders.ts: REST handlers for
GET/POST /orders, uses Prisma.
 
.env.local: Local env overrides
(not reading — .env excluded)
Gemini CLI
Scanning filesystem...
→ package.json (2m ago)
→ src/routes/orders.ts (5m ago)
→ .env.local (12m ago)
 
package.json: Node.js project
manifest (npm, Express 5).
 
orders.ts: Order route handlers
with Prisma ORM integration.
 
.env.local: Dev environment
config (DB URL, ports).
Copilot CLI — different output
Suggested shell command:
 
find . -maxdepth 1 -type f \
-printf '%T@ %p\n' | \
sort -rn | head -3 | \
awk '{print $2}'
 
→ Run this? (y/n)
 
Does not read files or
provide summaries.
The architecture difference made visible: Claude Code and Gemini CLI interpret "list and summarize" as an agentic task — read the files, answer the question. Copilot CLI interprets it as "suggest a shell command that lists files." It produces a correct, executable shell command, but it never reads the files or provides a summary. This isn't a bug — it's the design intent.

What This Means In Practice

This distinction compounds over time. When you ask Claude Code or Gemini CLI to "refactor this module", they read the code, understand the context, and make targeted edits. When you ask Copilot CLI the same question, it either reformulates it as a shell command or suggests you run the refactor through the IDE instead.

Key Insight

Copilot CLI is a shell translator, not an autonomous agent

This is neither good nor bad — it's a deliberate architecture choice. Copilot CLI's design bet: give developers correct shell commands they can verify before running, rather than an agent that edits files autonomously. That's exactly right for shell command discovery. It's limiting for "understand and modify this codebase" tasks.

Claude Code
$ claude "list 3 recently modified files..."
→ Reads files via tool calls
→ Provides natural language summary
→ Notes .env exclusion (safety)
Reads + reasons. Agentic by default. Most thorough for code understanding tasks.
Gemini CLI
$ gemini "list 3 recently modified files..."
→ Reads filesystem + files
→ Natural language summary
→ May use web search for context
Similar to Claude Code for this task. Larger context window shines with many files.
Copilot CLI
$ gh copilot suggest "list 3 recently modified files..."
→ Returns: find . | sort -rn | head -3
→ Does NOT read files
→ Does NOT summarize
Shell command translator. Perfect for "how do I do X in bash?" — not for code understanding.

Knowledge Check

0 / 6 answered
Question 1
You're on Windows and get "running scripts is disabled on this system" when you type claude. What's the fix?
Correct! npm CLI shims use PowerShell scripts (.ps1), which Windows blocks by default. -Scope CurrentUser works without admin rights. This also fixes Gemini CLI on Windows.
Not quite. The error is a PowerShell script execution policy issue. Run Set-ExecutionPolicy RemoteSigned -Scope CurrentUser — no reinstall or exclusions needed.
Question 2
Which tool is the only one that does NOT have an API key authentication path?
Correct! Copilot CLI authenticates only through gh auth login (GitHub OAuth). There's no COPILOT_API_KEY environment variable. For CI/CD, you pipe a GitHub token into gh auth login --with-token.
Wrong. Copilot CLI is the exception — it only authenticates through gh auth, which uses GitHub OAuth. Claude Code uses ANTHROPIC_API_KEY and Gemini uses GEMINI_API_KEY for BYOK.
Question 3
You already use Claude Code and have a well-written CLAUDE.md. You want to try Gemini CLI on the same project. What's the fastest way to set up Gemini's context?
Correct! The formats are ~90% compatible. Copy CLAUDE.md to GEMINI.md, then optionally add a section that enables or configures Gemini-specific capabilities like web search or code execution tools.
Not quite. The formats are nearly identical — copy CLAUDE.md to GEMINI.md and add any Gemini-specific tool config. Gemini CLI reads GEMINI.md (not CLAUDE.md), and copilot-instructions.md is a different system entirely.
Question 4
You run: gh copilot suggest "summarize the last 3 files I modified and explain what they do". What will Copilot CLI most likely do?
Correct! Copilot CLI's design is to translate natural language into shell commands — it doesn't read files or provide summaries autonomously. It would suggest a find or git log command and prompt you to run it.
Not correct. Copilot CLI is a shell command translator, not an agentic tool. It would suggest a shell command to find recently modified files, then ask if you want to run it. It doesn't read file contents or provide summaries.
Question 5
Which tool requires an additional CLI to be installed first before you can install it?
Correct! Copilot CLI is a gh extension — you must have the GitHub CLI installed and authenticated first. Claude Code and Gemini CLI install directly via npm with no additional CLI prerequisites.
Correct answer: Copilot CLI. It's a gh extension and requires the GitHub CLI as a prerequisite. Claude Code and Gemini CLI install directly via npm without any additional CLI tools.
Question 6
You're setting up a GitHub Actions workflow to run automated code review using Gemini CLI. Which auth method should you use?
Correct! OAuth requires a browser — not available in headless CI. Store GEMINI_API_KEY as a repository secret in GitHub Actions and inject it as an env var in your workflow YAML. The same pattern applies to ANTHROPIC_API_KEY for Claude Code.
OAuth requires an interactive browser flow — impossible in CI/CD. Use an API key stored as a GitHub Actions secret and expose it via env: GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }} in your workflow.