Overview & Prerequisites
What you need before installing LLM CLI tools
What you’re about to install
In the next four lessons, you’ll install and try each of the major LLM CLI tools:
| Tool | Maker | Access | Key strength |
|---|---|---|---|
| Claude Code | Anthropic | API key or Anthropic account | Deep codebase understanding, long context |
| Gemini CLI | Google account | Open source, generous usage tier, huge context | |
| Codex CLI | OpenAI | API key | Autonomous task execution |
| GitHub Copilot CLI | GitHub/Microsoft | GitHub account with Copilot | Integration with GitHub ecosystem |
You don’t need to install all of them. But we recommend trying at least two — each has different strengths, and knowing multiple tools makes you a more flexible orchestrator.
Prerequisites
All of these tools need Node.js installed. Node.js is a platform that lets JavaScript run outside the browser — it powers the installer (npm) that all CLI tools use.
Everything in this module assumes you’re in a bash or zsh shell — the default on macOS, Linux, and WSL. If you’re on Windows, make sure you’re in your WSL terminal (Ubuntu), not PowerShell. If you’re connected to a remote server via SSH or VS Code Remote, you’re already in a Linux shell. If you’re not sure, run echo $SHELL — it should show /bin/bash or /bin/zsh.
Preflight check
Before installing anything, let’s make sure your environment can reach the tools you need. Run each of these:
# Can you reach the npm registry?curl -s https://registry.npmjs.org/ | head -c 100
# Do you have git?git --version
# What shell are you in?echo $SHELLIf curl to the npm registry fails, you may be behind a corporate proxy or firewall — see the troubleshooting section at the bottom of this lesson.
Check if you already have Node.js
node --versionIf you see something like v20.11.0 or higher, you’re good — skip to the “API Keys” section below.
If you see “command not found,” install it using the method below.
Installing Node.js with nvm (recommended)
nvm (Node Version Manager) is the best way to install Node.js because:
- It doesn’t require
sudoor admin rights - It installs Node in your home directory (no permission issues)
- You can easily switch between Node versions later
This works on macOS, Linux, and WSL:
# Install nvmcurl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
# Reload your shell (or close and reopen your terminal)source ~/.bashrc
# Install the latest LTS version of Node.jsnvm install --lts
# Verifynode --versionnpm --versionBoth should print version numbers. You’re ready.
Close your terminal completely and reopen it. The nvm install script adds itself to your shell config file (~/.bashrc or ~/.zshrc), but that only takes effect in new terminal sessions. If you’re in VS Code, open a new terminal panel.
Alternative: Direct install (if nvm doesn’t work)
If you can’t use nvm (corporate restrictions, etc.):
macOS with Homebrew:
brew install nodeUbuntu/Debian (WSL or server):
sudo apt update && sudo apt install -y nodejs npmOr download from nodejs.org — grab the LTS version.
What’s npx?
You’ll see npx in some installation instructions. The difference:
npm install -g tool— downloads and permanently installs a toolnpx tool— downloads and runs a tool temporarily
For CLI tools you’ll use regularly, npm install -g is better so you don’t re-download every time.
This usually means Node.js was installed system-wide instead of via nvm. Fix: prefix with sudo on Linux/macOS (sudo npm install -g tool), or better yet, install nvm and switch to it. If you used nvm, global installs should work without sudo.
API keys — what they are and how to handle them
Most AI CLI tools require an API key — a secret string that identifies your account and lets the tool talk to the AI service. You’ll get this from each provider’s website.
Key safety rules
- Never share your API key with anyone
- Never paste it into a public chat, email, or code repository
- Never put it in a file that gets committed to git (add
.envto your.gitignore) - If you accidentally expose a key, revoke it immediately from the provider’s dashboard
Storing keys safely
Most CLI tools store your key in a local config file automatically. But if you need to set one manually:
# Set for your current sessionexport ANTHROPIC_API_KEY="sk-ant-your-key-here"
# Make it permanent (add to your shell config)echo 'export ANTHROPIC_API_KEY="sk-ant-your-key-here"' >> ~/.bashrcsource ~/.bashrcIf other users can access the same machine, be careful with API keys in your shell config. Your ~/.bashrc is only readable by you (by default), but check with ls -la ~/.bashrc — the permissions should be -rw------- (only you can read/write). If not, run chmod 600 ~/.bashrc. Consider asking your instructor about shared training keys instead.
Authentication over SSH (the browser problem)
Some tools (like claude or gh auth login) want to open a web browser for authentication. If you’re SSH’d into a remote server, there’s no browser to open. Solutions:
- Device flow: Some tools show a URL and a code. Open the URL on your local machine’s browser, enter the code, and the remote tool gets authenticated.
- API key directly: Set the API key as an environment variable before starting the tool — this bypasses browser-based auth entirely.
- Authenticate locally first, then copy: Run the tool on your local machine to authenticate, then copy the generated config file to your remote server (usually in
~/.config/or a tool-specific directory).
Each tool lesson will cover authentication specifically.
Troubleshooting: Proxy and network issues
If you’re on a university network, corporate VPN, or government network, you may hit issues with SSL certificates or blocked registries.
Symptom: npm install fails with certificate errors
error SELF_SIGNED_CERT_IN_CHAINThis usually means your network is doing SSL inspection. Fixes:
# Option 1: Tell npm to use your system's certificate bundlenpm config set cafile /etc/ssl/certs/ca-certificates.crt
# Option 2: If you have a specific corporate cert filenpm config set cafile /path/to/your/corporate-ca.pem
# Option 3 (last resort, NOT recommended for production):npm config set strict-ssl falseSymptom: Network timeout / can’t reach registry
Your network might require a proxy:
npm config set proxy http://proxy.example.com:8080npm config set https-proxy http://proxy.example.com:8080Ask your IT team for the proxy address. Or use GitHub Codespaces to bypass network restrictions entirely.
Ready?
If you can run node --version and npm --version and see version numbers, you’re set. Let’s install your first tool.