CLI Setup Guide¶
Quick reference for setting up developer CLIs in your terminal. Each section covers one CLI — install whichever ones you need.
Prerequisites¶
Claude Code¶
Anthropic's AI coding CLI. Requires a Claude Pro, Max, or Team subscription.
Official docs: code.claude.com/docs/en/quickstart
Install¶
macOS / Linux¶
Open Terminal and run:
Windows PowerShell¶
Open PowerShell and run:
Windows CMD¶
Set Up Your PATH¶
Your PATH is a list of folders your computer checks when you type a command. If Claude Code's folder isn't in that list, your terminal won't recognize the claude command.
After installation, you may need to configure your PATH so claude works from any directory.
macOS / Linux¶
The installer usually updates your shell profile automatically. If claude isn't recognized:
- Close and reopen your terminal, or
- Run one of these commands depending on your shell:
If the command still isn't found, add Claude Code to your PATH manually:
# For zsh
echo 'export PATH="$HOME/.claude/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc
# For bash
echo 'export PATH="$HOME/.claude/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
Windows¶
The installer should add Claude Code to your PATH automatically. If claude isn't recognized:
To add it manually: 1. Press Win + R, type sysdm.cpl, press Enter 2. Go to Advanced > Environment Variables 3. Under "User variables", select Path > Edit 4. Click New and add %USERPROFILE%.local\bin 5. Restart your terminal
Windows users
You need Git for Windows installed — it provides Git Bash, which Claude Code requires. If Git Bash isn't detected, open PowerShell and run:
Log In¶
Start Claude Code and log in with your Claude account:
You'll be prompted to authenticate in your browser. Follow the prompts to connect your Claude subscription.
Once logged in, your credentials are stored and you won't need to log in again.
Verify Installation¶
Test that everything is working:
Then start a conversation with Claude:
Ask Claude a question to confirm it's working:
Troubleshooting¶
"command not found: claude" - Close and reopen your terminal - On Mac, run source ~/.zshrc or source ~/.bashrc - Check the PATH setup section above
Authentication fails - Make sure you have an active Claude Pro, Max, or Team subscription - Try running /login inside Claude Code to re-authenticate - Check your browser completed the authentication flow
Permission denied during install (Mac/Linux) - The install script may need sudo access - Try: curl -fsSL https://claude.ai/install.sh | sudo bash
Slow or hanging responses - Check your internet connection - Try exiting (Ctrl+C) and starting a new session
Installation succeeded but claude command hangs - Ensure you're in a directory with a project (not an empty folder) - Try claude --help to verify the CLI responds
Ask AI for help
If you're stuck, paste this into ChatGPT, Claude, or Gemini:
I'm trying to install [Claude Code / Codex CLI / Gemini CLI] on [Mac / Windows / Linux] and getting this error: [paste the error message]. I followed the installation steps. What should I try next?
Essential Commands¶
| Command | What it does |
|---|---|
claude | Start interactive mode |
claude "task" | Run a one-time task |
claude -c | Continue most recent conversation |
claude commit | Create a Git commit |
/help | Show available commands (inside Claude Code) |
/login | Re-authenticate (inside Claude Code) |
exit or Ctrl+C | Exit Claude Code |
Resources¶
OpenAI Codex CLI¶
OpenAI's command-line coding agent. Requires Node.js 22+ and an OpenAI API key.
Install¶
Authenticate¶
Verify¶
Resources¶
Gemini CLI¶
Google's command-line AI coding assistant. Requires Node.js 18+ and a Google account.
Install¶
Verify¶
Resources¶
GitHub CLI¶
Manage GitHub pull requests, issues, and repos from your terminal. Requires a GitHub account.
Install¶
macOS¶
Windows¶
Linux (Debian/Ubuntu)¶
For other Linux distributions, see the official install instructions.
Authenticate¶
Follow the browser prompts to connect your GitHub account.