iOS Development

What is the CLI? A Beginner's Guide

"Open the terminal and run brew install ruby." If that sentence felt opaque, this post is for you. The CLI is one of the highest-leverage skills a returning developer can pick back up, and it's much friendlier than people remember.

What CLI means

CLI = Command-Line Interface. Instead of clicking buttons and menus (a GUI — Graphical User Interface), you type commands. The computer reads the command, runs it, and prints the result.

The CLI lives in an application called the terminal (or Terminal.app on Mac, also: iTerm2, Ghostty, Warp, Kitty). The thing reading your commands inside the terminal is called the shell — typically zsh on Mac, bash on Linux. They're all variations on the same idea.

Why developers use it (and why you should too)

  • Faster than GUIs for repetitive tasks. One git commit beats five menu clicks.
  • Scriptable. You can save commands in a file and run them again.
  • Universal. The same commands work on servers, Docker containers, CI pipelines, anywhere with a shell.
  • Required for serious dev tools. Claude Code is a CLI. Git is a CLI. Node, Python, Ruby, Homebrew, Railway, gh — all CLIs.
  • Shows you what's actually happening. GUIs hide complexity. The CLI doesn't.

Opening the terminal

  • Mac: Cmd+Space → "Terminal" → Enter. Or in Finder: Applications → Utilities → Terminal.
  • Better Mac terminals (free): iTerm2, Ghostty, Warp, Kitty. Drop-in replacements with better features.
  • Windows: "Terminal" from the Start menu. Inside, you'll typically use PowerShell or install WSL (Windows Subsystem for Linux) for a Linux-style experience.
  • Linux: Already there.

When you open it, you'll see a prompt — something like daniel@MacBook ~ % followed by a cursor. That's where you type commands.

The 20 commands you actually need

CommandWhat it does
pwdPrint working directory — where am I?
lsList files in current directory
ls -laList with details + hidden files
cd folderChange directory into folder
cd ..Go up one level
cd ~Go to home directory
mkdir folderMake a new directory
touch file.txtCreate an empty file
cp source destCopy file from source to dest
mv source destMove or rename a file
rm fileDelete a file. Careful — no undo.
rm -rf folderDelete folder and contents. Very careful.
cat filePrint file contents to terminal
less fileView file with scroll (press q to quit)
grep "text" fileSearch for text in a file
find . -name "*.swift"Find files matching a pattern
open .(Mac) Open current folder in Finder
historyShow recent commands
which commandWhere is a command installed?
man commandRead the manual page for any command

That's 95% of daily CLI usage. Memorize these and you're competent.

How paths work

  • Absolute path: starts with /. Example: /Users/daniel/Documents
  • Relative path: starts from where you are. Example: Documents/Resume.pdf
  • Home directory: ~ is shorthand for /Users/your-username
  • Current directory: .
  • Parent directory: ..

Pipes and redirection (the power tools)

  • Pipe (|): send output of one command into another. cat log.txt | grep "ERROR" finds error lines.
  • Output redirect (>): save command output to a file. ls > files.txt
  • Append (>>): add to a file without overwriting.

Once you grasp pipes, the CLI becomes wildly more powerful. You can chain 5 simple commands to do work that would take 30 minutes of manual clicking.

CLI tools you'll meet as an iOS dev

  • git — version control. See our GitHub guide.
  • brew — Homebrew, Mac package manager. brew install <package>
  • xcodebuild — build iOS apps from the command line.
  • xcrun simctl — control the iOS Simulator.
  • node, npm, npx — Node.js + JavaScript ecosystem.
  • python, pip — Python + its packages.
  • gh — GitHub CLI for repos, PRs, issues.
  • railway — deploy backends to Railway.
  • claude — Claude Code itself, the agentic CLI for development.

Getting comfortable

  1. Use it daily. Open the terminal first thing each work session. Force yourself.
  2. Tab completion. Press Tab after partial commands or filenames. The shell auto-completes.
  3. Up arrow. Cycles through your previous commands.
  4. Ctrl+R. Reverse-search through command history.
  5. Ask Claude. "How do I do X on macOS terminal?" The model knows every command.
  6. Don't fear breaking things. Most commands are safe. The dangerous ones (rm -rf, sudo) you'll learn to respect over time.

Three weeks of daily use and the CLI feels normal. The keyboard-first muscle memory pays back for the rest of your career.


See: What is an IDE?, GitHub for Beginners, Docker for Beginners.