|$ curl https://forge-ai.dev/api/markdown?path=docs/os/macos
$cat docs/macos-for-developers.md
updated Recently·18 min read·published
macOS for Developers
Introduction
macOS is a Unix-like operating system based on Darwin and BSD. It ships with a powerful terminal, making it a popular choice for web and mobile developers.
Xcode Command Line Tools
xcode.sh
Bash
| 1 | xcode-select --install |
| 2 | xcode-select -p |
ℹ
info
Command line tools include Git, Clang, Make, and other compilers. They are required for Homebrew and many development workflows.
Homebrew
Homebrew is the de facto package manager for macOS. It installs command-line tools and GUI applications into predictable locations.
homebrew.sh
Bash
| 1 | # Install Homebrew |
| 2 | /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" |
| 3 | |
| 4 | # Install packages |
| 5 | brew install git node yarn python |
| 6 | brew install --cask visual-studio-code docker |
| 7 | |
| 8 | # Update |
| 9 | brew update |
| 10 | brew upgrade |
zsh & Dotfiles
macOS uses zsh as the default shell. Configure it in ~/.zshrc.
zshrc.sh
Bash
| 1 | # ~/.zshrc examples |
| 2 | export PATH="/opt/homebrew/bin:$PATH" |
| 3 | export EDITOR="code -w" |
| 4 | alias gs="git status" |
| 5 | alias gp="git pull" |
Recommended Dev Setup
- Install Xcode Command Line Tools.
- Install Homebrew.
- Install Git, Node.js, Python, and VS Code via Homebrew.
- Configure zsh with aliases and PATH in ~/.zshrc.
- Enable Finder path bar and show hidden files with Cmd + Shift + ..