Skip to content

nh4ttruong/macsetup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MacSetup

A lightweight, idempotent shell script for provisioning a fresh macOS development machine. Install everything in one shot, or pick only the groups you need.

macsetup — one script, one fresh Mac

Purpose

This project exists so that setting up a new MacBook never means hunting through old notes or remembering which tools, fonts, and apps to install. Running ./setup (or ./setup all) restores a known-good development environment in a single, repeatable step: Homebrew, shell config, Node.js, CLI tools, GUI apps, fonts, and git identity profiles are all provisioned automatically. No more manual installs, no more "what was that one tool I always need?".

Highlights

  • One-click install - all provisions every group with no further prompts.
  • Modular groups - Homebrew, shell, Node.js, CLI tools, apps, fonts, git profiles.
  • Per-group item picker - opt into specific packages instead of the whole group.
  • Idempotent - safe to re-run; existing installs and config blocks are skipped.

Requirements

  • macOS (Apple Silicon or Intel)
  • Apple Command Line Tools (auto-installed if missing)
  • Internet access

Install

One-shot via curl:

curl -fsSLO https://raw.githubusercontent.com/nh4ttruong/macsetup/main/setup && zsh setup

or clone for manually:

git clone https://github.com/nh4ttruong/macsetup.git
cd macsetup
./setup

Usage

./setup                Interactive menu
./setup all            One-click - install everything, no prompts
./setup <group>...     Install one or more specific groups
./setup -l | --list    List available groups
./setup -h | --help    Show help

When you select a multi-item group (cli, apps, fonts), the script asks how to proceed:

  • a (or Enter) - install all items
  • 1 3 5 - install only those items
  • n - skip the group
  • b - back to the main menu (interactive mode only)

The main menu also accepts q to quit without changes. Choosing all from the main menu suppresses every per-group prompt.

Examples

./setup all              # install everything, no prompts
./setup brew cli git     # Homebrew + chosen CLI tools + git profiles
./setup apps             # prompts for which apps to install

Groups

Group Summary
brew Install or update Homebrew
zsh zsh-completions and shell config block in ~/.zshrc
node nvm + Node.js (prompts for version, default 24)
cli Common CLI tools - expand below
apps GUI apps (Homebrew casks) - expand below
fonts Developer fonts - expand below
git N renamable profiles (default 2) + /usr/local/bin/gitswitch

brew is a prerequisite for every other group and is installed automatically when missing. Missing per-group dependencies (e.g., git for the git group) are detected and you're prompted to install them in place.

Tip

For a curated walkthrough of every bundled app, CLI tool, and font — with one-line notes on why each one is here — see AWESOME-MAC-APPS.md.

cli - included packages

git, make, jq, yq, nano, nanorc, pnpm, telnet

Nano syntax highlighting is enabled automatically after install.

apps - included casks
fonts - included casks
  • font-hack-nerd-font
  • font-fira-code
  • font-fira-code-nerd-font
  • font-dejavu
  • font-dejavu-sans-mono-nerd-font
  • font-hack
  • font-source-code-pro

Git profiles

The git group asks how many profiles you want (default 2) and lets you rename each one (defaults: personal, work).

  • The first profile is set as the global git identity.
  • All profiles are written to ~/.gitswitch.conf (chmod 600).
  • The bin/gitswitch script is installed to /usr/local/bin/gitswitch (sudo may be required) and is immediately available on $PATH.

After setup, switch the local-repo identity in any project:

gitswitch personal     # or whatever you named your profile
gitswitch work
gitswitch list         # show configured profiles

Profile labels can be any [a-zA-Z0-9_-]+. Re-run ./setup git to update profiles.

Note

./setup all (one-click) skips the git group because it requires interactive input. Run ./setup git separately to configure profiles.

Additional

Config the input source with XKey preset

Note

This section is for user who needs the application for Vietnamese input source

After installing XKey (via the apps group), import presets/XKey-Settings.plist from the XKey settings panel.

Import iTerm2 profile

After installing iTerm2 (via the apps group), import presets/iterm2profile.json from the iTerm2 settings panel. "Edit" -> "Profile Preferences" -> "Import" (or just drag the JSON file onto the window)

Note

You can use coolnight.itermcolors](presets/coolnight.itermcolors) for a coolnight theme.

coolnight Color Scheme

Manual macOS settings

A few preferences are still easier to configure by hand in System Settings:

  • iCloud - sign in and complete setup.
  • Dock - enable auto-hide; adjust size.
  • Keyboard - raise key repeat rate; add input sources (e.g. ABC, Vietnamese).
  • Trackpad - tune tracking speed and gestures.

Contributing

See CONTRIBUTING.md.

License

MIT


Made by @nh4ttruong

About

A lightweight, idempotent shell script for setting up a fresh macOS development machine, installing everything in a simple way

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Contributors

Languages