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.
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.
node --versionnpm install -g @anthropic-ai/claude-codeclaude — browser opens for OAuthclaude --version ✓npm install -g @google/gemini-cligemini — Google OAuth in browsergemini --version ✓winget install GitHub.cli (or brew)gh auth logingh extension install github/gh-copilotgh auth — no separate logingh copilot --version ✓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
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).
# 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
# 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
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.
# 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
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
# Check version
claude --version
# Run your first real command (works in any directory)
claude "What files are in this directory?"
Gemini CLI Setup
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
# 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
# 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
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.
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
gemini --version
gemini "What files are in this directory?"
GitHub Copilot CLI Setup
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
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
# 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
# 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.
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.
.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
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.
# 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/
# 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
# 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)
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.
# 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
# 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
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.
"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.
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.
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.
Knowledge Check
0 / 6 answeredclaude. What's the fix?-Scope CurrentUser works without admin rights. This also fixes Gemini CLI on Windows.Set-ExecutionPolicy RemoteSigned -Scope CurrentUser — no reinstall or exclusions needed.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.gh auth, which uses GitHub OAuth. Claude Code uses ANTHROPIC_API_KEY and Gemini uses GEMINI_API_KEY for BYOK.CLAUDE.md. You want to try Gemini CLI on the same project. What's the fastest way to set up Gemini's context?gh copilot suggest "summarize the last 3 files I modified and explain what they do". What will Copilot CLI most likely do?find or git log command and prompt you to run it.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.gh extension and requires the GitHub CLI as a prerequisite. Claude Code and Gemini CLI install directly via npm without any additional CLI tools.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.env: GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }} in your workflow.