Developer Setup

This guide walks you through setting up essential development tools on macOS. Each step includes commands you can copy directly, along with explanations of what they do and how to verify they worked. Track your progress as you go.

1

Xcode Command Line Tools

These tools include compilers and other utilities that many developer tools depend on. Installing them first ensures everything else works smoothly.

Steps

Install the tools

Run this command in Terminal. It will open a dialog asking you to install the tools. Click Install and wait for it to complete (usually takes 5-10 minutes).

xcode-select --install

Verify installation

Check that the tools are installed correctly. This should print a path to the command line tools directory.

xcode-select -p
Expected output
/Library/Developer/CommandLineTools
2

Homebrew Package Manager

Homebrew makes it easy to install and manage software on macOS. It's like an app store for command-line tools and developer utilities.

Steps

Install Homebrew

This downloads and installs Homebrew. The script will explain what it will do and pause before making changes. Press Return to continue when prompted.

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Add Homebrew to your PATH

After installation, Homebrew prints two commands you need to run. They look like this (the exact path may vary based on your Mac):

echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"

If you're on an Intel Mac, the path might be /usr/local/bin/brew instead of /opt/homebrew/bin/brew. Use the exact commands Homebrew shows you.

Verify installation

Check that Homebrew is working. This should print a version number like 4.2.0 or similar.

brew --version
Expected output
Homebrew 4.2.0
3

Git Configuration

Git is version control software that tracks changes to your code. Configuring it with your name and email ensures your commits are properly attributed.

Steps

Install Git

Use Homebrew to install the latest version of Git.

brew install git

Set your name

Replace "Your Name" with your actual name. This appears in your commit history.

git config --global user.name "Your Name"

Set your email

Replace with your actual email address. Use the same email you'll use for GitHub or other Git hosting services.

git config --global user.email "your.email@example.com"

Set default branch name

Modern Git repositories use "main" as the default branch name.

git config --global init.defaultBranch main

Verify configuration

Check that Git is configured correctly. This should show your name, email, and other settings.

git config --list
Expected output (partial)
user.name=Your Name
user.email=your.email@example.com
init.defaultbranch=main
4

Node.js and npm

Node.js lets you run JavaScript outside the browser. npm is its package manager, used to install libraries and tools. Most modern web development depends on both.

Steps

Install Node.js

This installs the latest Long Term Support (LTS) version of Node.js, which includes npm.

brew install node

Verify Node.js installation

Check that Node.js is installed. This should print a version number like v20.11.0 or similar.

node --version
Expected output
v20.11.0

Verify npm installation

Check that npm is installed. This should print a version number like 10.2.4 or similar.

npm --version
Expected output
10.2.4
5

SSH Keys for GitHub

SSH keys let you authenticate with GitHub without typing your password every time. You generate a key pair on your Mac, then add the public key to your GitHub account.

Steps

Generate SSH key

Replace your.email@example.com with your GitHub email. When prompted, press Enter to accept the default location. You can optionally enter a passphrase for extra security.

ssh-keygen -t ed25519 -C "your.email@example.com"

Start ssh-agent and add your key

First, start the ssh-agent in the background:

eval "$(ssh-agent -s)"

Then add your SSH private key to the ssh-agent:

ssh-add ~/.ssh/id_ed25519

Copy your public key

This copies your public key to the clipboard so you can paste it into GitHub.

pbcopy < ~/.ssh/id_ed25519.pub

Add key to GitHub

Now add the key to your GitHub account:

  1. Go to GitHub SSH settings
  2. Click "New SSH key"
  3. Give it a title like "My Mac"
  4. Paste your key (it's already in your clipboard)
  5. Click "Add SSH key"

Test your connection

Verify that GitHub recognizes your key. The first time you connect, you'll be asked to verify GitHub's fingerprint. Type "yes" to continue.

ssh -T git@github.com
Expected output
Hi username! You've successfully authenticated, but GitHub does not provide shell access.
6

VS Code Editor

Visual Studio Code is a powerful, free code editor. It has built-in support for JavaScript, TypeScript, and Node.js, and a rich ecosystem of extensions for other languages and tools.

Steps

Install VS Code

Use Homebrew to install Visual Studio Code as a macOS application.

brew install --cask visual-studio-code

Install the code command

This adds the code command to your PATH so you can open files and folders from Terminal. Open VS Code, press Cmd+Shift+P to open the Command Palette, then type and select:

Shell Command: Install 'code' command in PATH

Verify installation

Check that the code command works. This opens the current directory in VS Code.

code .

If you see VS Code open, the installation is successful.

Setup Complete!

You now have a fully configured development environment on your Mac. You're ready to start building.