Foundations 4 min
The CLI / terminal
A text window where you tell your computer what to do. Where most AI tools live.
The CLI (command-line interface) is a plain text window where you tell your computer what to do — instead of clicking buttons. Most AI coding tools live there because text is the easiest interface for an AI to drive.
Anatomy of a prompt
~/my-project $ █
~/my-project— where you are right now ("current directory")$— your shell waiting for input (sometimes%or›)█— your cursor
The five commands you'll see in every tutorial
| Command | What it does |
|---|---|
pwd | Print Working Directory — "where am I?" |
ls | List files in the current folder |
cd folder/ | Change Directory — "go into that folder" |
cd .. | Go up one folder |
mkdir name | Make a new folder |
cat file.txt | Print the contents of a file |
How to open one (real, on your machine)
- macOS: press ⌘+Space, type "Terminal", hit Enter.
- Windows: press Win, type "Windows Terminal" (or PowerShell), hit Enter.
- Linux: Ctrl+Alt+T in most desktop environments.
Type pwd and press Enter. That's it — you've used a CLI.
Try it (no install)
This is the same pretend terminal you'll see in the coding-CLI lesson. Type list files or /help.
~/sandbox — claude
Welcome to Claude Code (pretend edition).
Try:
/help · fix the bug · list files ~/sandbox ›
Why AI tools love the CLI
- Real file access. Reading and writing files is just text.
- Real command execution. "Run the tests" → it runs them and reads the output.
- Composability. Pipe one tool's output into another with
|. - It's everywhere. Same shell, every machine, every OS.
What's the difference between 'shell', 'terminal', and 'CLI'?
Terminal is the window (Terminal.app, iTerm2, Windows Terminal).
Shell is the program running inside it that interprets your commands (bash, zsh, fish, PowerShell).
CLI is the general concept: command-line interface. People use the three words interchangeably; you can too.
What about Git Bash / WSL on Windows?
Windows historically had a clunky CLI. Two modern fixes: Windows Terminal (Microsoft, native) is fine.
WSL (Windows Subsystem for Linux) gives you a real Linux shell inside Windows — often the smoothest path
when you'll work with AI coding tools.