Introduction
Terminal (Emulator of Input/Output)
- The lowest layer: emulates a hardware terminal (originally physical devices like teletypes).
- In modern systems, it’s a graphical application (e.g. Terminal.app on macOS, Windows Terminal, iTerm2, GNOME Terminal) responsible for displaying text on screen and capturing keyboard input.
- It doesn’t “understand” commands itself—it merely serves as the I/O bridge between you and the system.
Shell (Interpreter of Commands)
- A program provided by the operating system (e.g. Bash, Zsh, Fish, PowerShell, cmd.exe) that runs inside the terminal.
- Reads the text you type, parses it, executes the corresponding system commands or scripts, and sends their output back to the terminal.
- Offers scripting capabilities (conditionals, loops, functions, variables, pipelines, redirection), making it a powerful tool for automation and interactive tasks.
CLI (Interface of Tools via Text)
- A style of user interface: interacting with software by typing text commands, as opposed to using a graphical user interface (GUI).
- Not a specific program, but any command-line–based interface exposed via a shell or terminal (e.g. the Git CLI, npm CLI).
- For each tool, its “CLI” refers to the set of commands and options it offers (e.g.
git clone
, git commit
, etc.).
How They Fit Together
- You type into the Terminal, which displays text and captures your keystrokes.
- The Shell (running inside the Terminal) interprets your command, locates and runs the appropriate CLI executable (like
ls
, node
, docker
).
- The CLI tool performs its work, outputs text back to the Shell, which sends it to the Terminal for display.
Command-Line Tools on Windows
Windows Terminal
- A modern, highly customizable terminal for Windows.