Skip to content

Instantly share code, notes, and snippets.

@coreygo
Last active May 16, 2024 20:38
Show Gist options
  • Save coreygo/ff101d8e3f69c91e4bcf060291033f54 to your computer and use it in GitHub Desktop.
Save coreygo/ff101d8e3f69c91e4bcf060291033f54 to your computer and use it in GitHub Desktop.

Information for macOS Setup and Developer Experience

Last updated, 2024-05-16, applies to macOS 14.x.x (Sonoma) on Intel silicon hardware.

The default Terminal and Shell (zsh) is replaced with iTerm2 and Bash v5.

This document is meant to serve as an aid and reference in preparing a macOS system on Intel silicon hardware, the process is reviewed and completed manually. Apple M silicon hardware has not been tested.

Note: Review associated documentation at each software and service site prior to implementation to avoid unintended side effects. Prior to running brew install commands, run brew info to confirm what and how Homebrew will manage an installation. Some of the information may also apply to Apple silicon hardware but has not yet been verified.

For additional information, feedback, or help please feel free to ping via https://www.coreygo.com.

Keyboard Shortcuts

  • Command (or Cmd)
  • Shift
  • Option (or Alt)
  • Control (or Ctrl)
  • Caps Lock
  • Period (or Full stop) .
  • Function Fn

On non-Apple keyboards, use the Alt key instead of Option, and the Windows logo key instead of Command.

Additional MacOS Keyboard Shortcuts.

System information commands

  • uptime displays current system uptime
  • system_profiler SPHardwareDataType displays hardware overview
  • system_profiler -listDataTypes lists available system_profiler options
  • system_profiler -detailLevel basic > ~/system_profile.txt outputs to text document for sharing

Security

Review the macOS Security and Privacy Guide and Stronghold.

  • Set root password
    • sudo passwd -u root
  • For Development (disable macOS Gatekeeper)
    • sudo spctl --master-disable

Software updates

  • softwareupdate -l
  • sudo softwareupdate -iaR --verbose
  • mas upgrade (assumes use of Mac App Store CLI)

System

  • Set login screen message
    • sudo defaults write /Library/Preferences/com.apple.loginwindow LoginwindowText "<LOGIN TEXT>"
  • Disable screenshot drop shadow
    • defaults write com.apple.screencapture disable-shadow -bool true && killall SystemUIServer
  • Hide Desktop
    • defaults write com.apple.finder CreateDesktop false && killall Finder
  • Show All Files
    • defaults write com.apple.finder AppleShowAllFiles YES
    • Command-Shift-Period ⌘ + ⇧ + .
  • Find App Bundle ID of an app
    • osascript -e 'id of app "<NAME OF APP>"'

Networking

  • Set computer name (System Preferences → Sharing)

    sudo scutil --set ComputerName "<COMPUTER NAME>"
    sudo scutil --set HostName "<COMPUTER NAME>"
    sudo scutil --set LocalHostName "<COMPUTER NAME>"
    sudo defaults write /Library/Preferences/SystemConfiguration/com.apple.smb.server NetBIOSName $(scutil --get LocalHostName)
  • Disable .DS_Store on network shares

    • defaults write com.apple.desktopservices DSDontWriteNetworkStores true

Software

Homebrew

  • Xcode Command Line Tools

    • xcode-select --install
  • Homebrew

    • /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
    • brew config
  • Homebrew Cask

    • brew tap homebrew/cask
    • brew tap homebrew/services
  • Optional external casks

    • brew tap buo/cask-upgrade (brew cu)
  • Homebrew FAQ (man page)

    • brew update-reset && brew update
    • brew upgrade --greedy
    • brew cleanup -s and brew cleanup --prune=all
    • brew autoremove
    • rm -rf $(brew --cache)
    • brew missing and brew doctor and brew config
    • brew uninstall {{package name}} to uninstall a Homebrew package
    • brew uninstall --zap {{package name}} to uninstall a Homebrew package (removes additional files)
    • brew uninstall --cask {{cask name}} to uninstall a Homebrew cask package
    • brew untap {{cask name}} to untap a Homebrew cask

    Post Install

    cat << 'EOF' >> ~/.secrets
    # Set Homebrew's GitHub access token
    export HOMEBREW_GITHUB_API_TOKEN=<GITHUB API TOKEN>
    EOF

    Additional Post Install

    cat << 'EOF' >> ~/.bashrc
    # Export Homebrew environment variables
    export HOMEBREW_FORCE_VENDOR_RUBY=1
    export HOMEBREW_FORCE_BREWED_GIT=1
    export HOMEBREW_FORCE_BREWED_CURL=1
    
    # Set alias bup to update Homebrew
    alias bup="brew update-reset && brew update && brew upgrade && brew cu && brew cleanup -s && rm -rf $(brew --cache) && brew missing && brew config && brew doctor"
    EOF
  • Search for Formulae

    • brew search google (includes formulae and casks)
  • Search for Casks

Fonts

  • Search installed fonts: system_profiler SPFontsDataType | grep Fura

  • Search Homebrew fonts: brew search /roboto/

  • Install (via brew or source): Fira Code, Hack, Nerd Fonts, Source Code Pro, Roboto, Inter, additional "cloud" fonts can be installed via the Adobe Creative Cloud app

    • brew install --cask font-roboto
    • brew install --cask font-cascadia-code
    • brew install --cask font-fira-code
    • brew install --cask font-source-code-pro
    • brew install --cask font-firacode-nerd-font
    • brew install --cask font-sourcecodepro-nerd-font
    • brew install --cask font-meslo-nerd-font
    • brew install --cask font-inter
    • brew install --cask font-monaspace

Terminal

  • Create ~/.bash_profile if needed and source ~/.bashrc

    • if [[ ! -r ~/.bash_profile ]]; then echo -e '#!/usr/bin/env bash \n\ntest -r ~/.bashrc && . "$_"' >> ~/.bash_profile; fi;
  • iTerm2

    • brew install --cask iterm2@beta
      or — brew install --cask iterm2

    Post Install

    • Run iTerm2 then make it the default Terminal
    • Install iTerm2 shell integration and utilities and update ~/.bashrc with tmux export
    curl -L https://iterm2.com/shell_integration/install_shell_integration_and_utilities.sh | bash
    
    cat << 'EOF' >> ~/.bashrc
    # Enable iTerm2 Shell Integrations
    export ITERM_ENABLE_SHELL_INTEGRATION_WITH_TMUX=1
    test -r "${HOME}/.iterm2_shell_integration.bash" && . "$_"
    EOF
    • Change default profile: 160x48, Solarized Dark, Fira Code 14pt Regular (use ligatures, anti-aliased), Terminal.app compatibility
    • Additional key mapping changes may be required for natural editing (like keyboard shortcuts for cursor movement in Terminal and vim)
    ⌥← # Send escape sequence b
    ⌥→ # Send escape sequence f
    ⌘←Delete # Send hex code 0x15
    ⌥←Delete # Send hex code 0x1b 0x7f
    Del→ # Send hex code 0x4-
    ⌥Del→ # Send escape sequence d

Bash and Command Line Binaries

  • Bash v5

    • brew install bash

    Post Install

    # Switch to using brew-installed bash as default shell
    if ! fgrep -q '/usr/local/bin/bash' /etc/shells; then
      echo '/usr/local/bin/bash' | sudo tee -a /etc/shells;
      chsh -s /usr/local/bin/bash;
    fi;
    • echo $BASH_VERSION
  • Create .bashrc and set default language and source imports and aliases

    cat << 'EOF' >> ~/.bashrc
    #!/usr/bin/env bash
    
    # Set Language
    export LANG="en_US.UTF-8"
    export LC_ALL="$LANG"
    
    # Imports
    test -r "${HOME}/.secrets" && source "$_"
    test -r "${HOME}/.bash_aliases" && source "$_"
    EOF
  • Set default editors

    cat << 'EOF' >> ~/.bashrc
    # Set default editors
    export EDITOR="code --wait"
    export VISUAL="$EDITOR"
    
    # Set editors for Git and Homebrew
    export GIT_EDITOR="$EDITOR"
    export HOMEBREW_EDITOR="$EDITOR"
    EOF
  • Bash Completion

    • brew install bash-completion@2

    Post Install

    cat << 'EOF' >> ~/.bashrc
    # Enable bash tab completion
    export BASH_COMPLETION_COMPAT_DIR="/usr/local/etc/bash_completion.d"
    test -r "/usr/local/etc/profile.d/bash_completion.sh" && . "$_"
    EOF
  • Bash Static Analysis, Linting, and Testing

Command Line Binaries

Replace and augment MacOS default binaries

  • brew install vim

  • brew install coreutils

    Post Install coreutils (optional, will cause warning from brew doctor)

    # All commands have been installed with the prefix 'g'.
    # If you really need to use these commands with their normal names:
    
    cat << 'EOF' >> ~/.bashrc
    # Set local opt coreutils bin $PATH
    export PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH"
    EOF
  • brew install curl

    Post Install curl

    cat << 'EOF' >> ~/.bashrc
    # Set local opt curl bin $PATH
    export PATH="/usr/local/opt/curl/bin:$PATH"
    EOF
  • brew install diffutils

  • brew install findutils

  • brew install gawk

  • brew install gnu-sed

  • brew install gnu-tar

  • brew install gnu-which

  • brew install gnutls

  • brew install grep

  • brew install gzip

  • brew install htop or brew install btop

  • brew install openssh

  • brew install rsync

  • brew install screen

  • brew install tmux

  • brew install tree

  • brew install watch

  • brew install wdiff

  • brew install wget

    Post Install command line binaries

    cat << 'EOF' >> ~/.bashrc
    # Set local system bin $PATH
    export PATH="$PATH:/usr/local/sbin"
    EOF

Additional command line binaries, dependencies, and packages

  • brew install --cask emacsemacs

    Post Install emacs (optional)

  • brew install pandocpandoc

  • brew install basictexbasictex

    Post Install pandoc and basictex

    sudo tlmgr update --self
    sudo tlmgr install collection-fontsrecommended
  • brew install librsvglibrsvg

Git

  • brew install git

  • brew install git-lfs then git lfs install

  • brew install gh

  • brew tap microsoft/git && brew install --cask git-credential-manager-core

    Post Install

    git config --global user.name "<FULL NAME>"
    git config --global user.email <EMAIL>
    git config --global user.signingkey <SIGNING KEY>
    git config --global github.user <GITHUB USERNAME>
    git config --global core.editor vim
    git config --global color.ui auto
    git config --global commit.gpgsign true
    git config --global init.defaultBranch main

    Additional Post Install

    cat << 'EOF' >> ~/.secrets
    # Set GitHub user and access token
    # https://github.com/settings/tokens
    export GITHUB_USER=<GITHUB USERNAME>
    export GITHUB_TOKEN=<GITHUB PERSONAL ACCESS TOKEN>
    EOF

Applications

Google Applications

  • Google Chrome
    • brew install --cask google-chrome@beta
      and/or for side by side installation —
      brew install --cask google-chrome@canary
      and/or for side by side installation —
      brew install --cask google-chrome
  • Google Drive
    • brew install --cask google-drive
  • Google Android File Transfer
    • brew install --cask android-file-transfer
      and/or consider OpenMTP
      brew install --cask openmtp
  • Google Android Platform Tools
    • brew install --cask android-platform-tools

Web Applications

  • Firefox Developer Edition
    • brew install --cask firefox@developer-edition
      and/or for side by side installation —
      brew install --cask firefox
  • Microsoft Edge
    • brew install --cask microsoft-edge@dev
      and/or for side by side installation —
      brew install --cask microsoft-edge
  • Brave Browser
    • brew install --cask brave-browser
      and/or for side by side installation —
      brew install --cask brave-browser@dev
  • Tor Browser
    • brew install --cask tor-browser

VPN and Networking

Communications and File Sharing

Security Applications

  • Bitwarden

    • brew install --cask bitwarden
  • 1Password

    • brew install --cask 1password@beta
      or for non-beta version —
      brew install --cask 1password
      and for 1Password CLI —
      brew install --cask 1password-cli

      Post Install to enable 1Password for SSH & Git (optional)

      cat << 'EOF' >> ~/.bashrc
      # Set SSH Identity Agent socket for 1Password
      # https://developer.1password.com/docs/ssh
      export SSH_AUTH_SOCK="~/Library/Group\ Containers/2BUA8C4S2C.com.1password/t/agent.sock"
      
      # Set Biometric unlock for 1Password CLI 2
      # https://developer.1password.com/docs/cli
      OP_BIOMETRIC_UNLOCK_ENABLED=true
      
      # Enable 1Password shell completion
      source <(op completion bash)
      EOF
  • GPG Suite

    • brew install gpg pinentry-mac
      or for GPG Suite install
      brew install --cask gpg-suite-no-mail

      Post Install

      cat << 'EOF' >> ~/.gnupg/gpg-agent.conf
      # Enable gpg-agent keychain access via pinentry
      pinentry-program /usr/local/bin/pinentry-mac
      EOF
  • Keybase
    (requires KEXT - System Preferences → Security & Privacy → General)

    • brew install --cask keybase
  • Yubico YubiKey Manager

    • brew install --cask yubico-yubikey-manager
  • Yubico YubiKey Personalization GUI

    • brew install --cask yubico-yubikey-personalization-gui

Development Applications

  • Visual Studio Code

    • brew install --cask visual-studio-code@insiders
      or for non-Insiders build —
      brew install --cask visual-studio-code

    Post Install Visual Studio Code — Insiders (optional as this is now managed by VSCode directly)
    (extensions list and settings information)

    • To reinstall all extensions from a terminal
      curl -fsSL https://git.io/fjpD1 | bash
  • Apple Xcode

    • mas install 497799835 (AppID for com.apple.dt.Xcode)
  • JetBrains Toolbox

    • brew install --cask jetbrains-toolbox
  • Eclipse IDE

    • brew install --cask eclipse-installer
  • Arduino

    • brew install --cask arduino

Virtualization and Containerization

  • VirtualBox
    (requires KEXT - System Preferences → Security & Privacy → General)

    • brew install --cask virtualbox
    • brew install --cask virtualbox-extension-pack
  • Docker

  • Kubernetes — (k8s docs)

    Post Install (via edge release of Docker Desktop for Mac)

    • Docker → Preferences → Kubernetes → check all three boxes to enable → Apply
    • For kubectl bash completion kubectl completion bash > $(brew --prefix)/etc/bash_completion.d/kubectl
  • Helm

    • brew install kubernetes-helm
  • Skaffold

    • brew install skaffold
  • Vagrant

    • brew install --cask vagrant
  • Packer

    • brew install packer
  • Terraform

    • brew install terraform

Virtualization Networking

This section is entirely optional for a specialized virtualization networking environment
  • dnsmasq

    • brew install dnsmasq

    Post Install

    # Backup example dnsmasq.conf
    cp $(brew --prefix)/etc/dnsmasq.conf $(brew --prefix)/etc/dnsmasq.conf.example
    # Create and enable dnsmasq.d configuration directory
    mkdir -p $(brew --prefix)/etc/dnsmasq.d
    echo -e "\n# Include all files in a directory which end in .conf\nconf-dir=/usr/local/etc/dnsmasq.d/,-.conf" >> $(brew --prefix)/etc/dnsmasq.conf
    # Create and enable configuration(s)
    # Networking Note: 10.254.254.254 for Docker/K8s support, otherwise 127.0.0.1
    echo -e "address=/.lo/fdff::1\naddress=/.lo/10.254.254.254" >> $(brew --prefix)/etc/dnsmasq.d/lo.conf
    echo -e "address=/local.coreygo.dev/fdff::1\naddress=/local.coreygo.dev/10.254.254.254" >> $(brew --prefix)/etc/dnsmasq.d/local.coreygo.dev.conf
    # Start dnsmasq with launchd now and restart at startup
    sudo brew services start dnsmasq
    # Create and enable DNS resolver(s) for dnsmasq
    sudo mkdir -p /etc/resolver
    sudo bash -c 'echo -e "nameserver ::1\nnameserver 127.0.0.1" >> /etc/resolver/lo'
    sudo bash -c 'echo -e "nameserver ::1\nnameserver 127.0.0.1" >> /etc/resolver/local.coreygo.dev'
    • Create persistent lo0 alias
    cat << 'EOF' | sudo tee -a /Library/LaunchDaemons/com.coreygo.lo0.plist
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
        <key>Label</key>
        <string>com.coreygo.lo0</string>
        <key>RunAtLoad</key>
        <true/>
        <key>ProgramArguments</key>
        <array>
          <string>bash</string>
          <string>-c</string>
          <string>/sbin/ifconfig lo0 alias 10.254.254.254 &amp;&amp; /sbin/ifconfig lo0 inet6 alias fdff::1</string>
        </array>
    </dict>
    </plist>
    EOF
    • Enable the launchd service to activate persistent lo0 alias
      sudo launchctl load /Library/LaunchDaemons/com.coreygo.lo0.plist

Utilities, Productivity, and Other Applications

  • Obsidian
    • brew install --cask obsidian
  • Zettlr
    • brew install --cask zettlr
  • Zotero
    • brew install --cask zotero
  • DevUtils
    • brew install --cask devutils
  • Mac App Store CLI
    • brew install mas
  • Appcleaner
    • brew install --cask appcleaner
  • TestFlight
    • mas install 899247664 (AppID for com.apple.TestFlight)
  • Microsoft OneNote
    • mas install 784801555 (AppID for com.microsoft.onenote.mac)
  • Raycast
    • brew install --cask raycast
  • Rectangle
    • brew install --cask rectangle
      or for paid alternative
    • Magnet
      • mas install 441258766 (AppID for com.crowdcafe.windowmagnet)
  • Evernote
    • brew install --cask evernote
  • Keka
    • brew install --cask keka
  • CyberDuck
    • brew install --cask cyberduck
  • Transmission Remote GUI
    app used for remotely connecting to a Transmission BitTorrent daemon
    • brew install --cask transmission-remote-gui
      to create torrent files, see also
    • mktorrent
      • brew install mktorrent

Process, Security, and Network Utilities

  • Radio Silence
    • brew install --cask radio-silence
  • Little Snitch
    • brew install --cask little-snitch
  • OverSight
    (requires KEXT - System Preferences → Security & Privacy → General)
    • brew install --cask oversight

    Workaround for installer hang

    • Open GUI and activate run in 'headless' mode
  • LuLu
    • brew install --cask lulu
  • KnockKnock
    • brew install --cask knockknock
  • TaskExplorer
    • brew install --cask taskexplorer
  • ClamAV

    Review ClamAV documentation and the ClamAV repository before starting the process

    • brew install clamav

    Post Install

    • cp /usr/local/etc/clamav/freshclam.conf.sample /usr/local/etc/clamav/freshclam.conf
    • sed -ie 's/^Example/#Example/g' /usr/local/etc/clamav/freshclam.conf
    • mkdir -p /usr/local/var/lib/clamav && freshclam -v

    Basic Commands

    • For latest definitions
      freshclam -v
    • For an on-demand directory/file scan
      clamscan -r -i --bell ~/
    • For an on-demand "complete" scan
      clamscan -r -i --bell --cross-fs=no --detect-pua=yes /

Creative Applications

  • Adobe Creative Cloud
    • brew install --cask adobe-creative-cloud

    Post Install

    • open '/usr/local/Caskroom/adobe-creative-cloud/<VERSION>/Install.app'
  • Figma
    • brew install --cask figma@beta or for stable —
      brew install --cask figma
  • Sketch
    • brew install --cask sketch
  • Inkscape
    • brew install --cask inkscape

Image Processing and Screen Capture

  • ImageOptim
    • brew install --cask imageoptim
  • gif.ski
    • brew install gifski
  • Gifski
    • mas install 1351639930 (AppID for com.sindresorhus.Gifski)
  • Kap
    • brew install --cask kap
  • Skitch
    • brew install --cask skitch

Media Streaming and Production

  • Open Broadcaster Software
    • brew install --cask obs

    Post Install

    "This plugin adds simple audio/video input and output over IP using NewTek's NDI™ technology."

    "Plugin for OBS Studio to add Audio Monitor dock and filter. It allows you to put the audio of a OBS source to an audio device by adding the Audio Monitor filter on the Source in OBS Studio."

  • Soundflower
    for loopback audio from desktop output (requires KEXT - System Preferences → Security & Privacy → General)
    • brew install --cask soundflower
  • Reincubate Camo
    for using an iPhone or iPad as a camera on MacOS, compare with Elgato EpocCam
    • brew install --cask camo-studio
  • Elgato EpocCam
    for using an iPhone or iPad as a camera on MacOS, compare with Reincubate Camo
    • brew install --cask epoccam
  • Avidemux
    • brew install --cask avidemux
  • ffmpeg
    • brew install ffmpeg
  • yt-dlp
    • brew install yt-dlp

Audio/Video Playback and Management

  • VLC
    • brew install --cask vlc
  • Plexamp
    • brew install --cask plexamp
  • MusicBrainz Picard
    • brew install --cask musicbrainz-picard

    Post Install

    • brew install flac mp3gain
    • MusicBrainz Picard Preferences → Plugins → Install ReplayGain → Enable → Make It So
    • Path to metaflac /usr/local/bin/metaflac
    • Path to mp3gain /usr/local/bin/mp3gain
  • XLD (X Lossless Decoder)
    • brew install --cask xld
  • SoX (Sound eXchange)
    • brew install sox

eBook Reading and Management

Conferencing and Remote Computing

Gaming

  • Steam
    • brew install --cask steam
  • OpenEMU
    • brew install --cask openemu

Programming Environments

Dependencies

  • asdf

    "asdf is a tool version manager. All tool version definitions are contained within one file (.tool-versions) which you can check in to your project's Git repository to share with your team, ensuring everyone is using the exact same versions of tools."

    • brew install asdf
    • brew upgrade asdf to update asdf

    Post Install

    cat << 'EOF' >> ~/.bashrc
    # Enable asdf to manage multiple runtime versions of programming environments
    test -r "$(brew --prefix asdf)/libexec/asdf.sh" && . "$_"
    # Workaround potential brew doctor warning with Python installed via asdf
    alias brew="env PATH=\"\${PATH//.asdf/shims:/}\" brew"
    EOF
    cat << 'EOF' >> ~/.asdfrc
    # See the docs for explanations: https://asdf-vm.com/manage/configuration.html
    legacy_version_file = yes
    EOF
    • source ~/.bashrc or restart terminal session
    • asdf info to verify and print asdf debug information
    • asdf help to list all commands available in asdf
    • asdf plugin list all to list all plugins in short name repository
    • asdf plugin list --urls to list installed plugins with URL
    • asdf plugin update --all to update all installed plugins
    • asdf plugin update <name> to update a specific installed plugin
    • asdf latest <name> <version> to list latest available version of a package
    • asdf reshim <name> <version> to recreate shims for packages or a package version
    • asdf current to list current global versions of all installed packages
  • direnv

    • asdf plugin add direnv to add the direnv plugin
    • asdf direnv setup --shell bash --version latest to install latest direnv version
    • asdf global direnv latest to set global direnv to latest version
    • direnv status to verify current direnv configuration

    Post Install

    cat << 'EOF' >> ~/.envrc
    use asdf
    EOF
    • asdf exec direnv allow

Node.js & TypeScript

  • Node.js — via asdf

    Set Default Global NPM Packages

    cat << 'EOF' >> ~/.default-npm-packages
    corepack
    create-next-app
    create-react-app
    eslint
    gatsby-cli
    gulp-cli
    json5
    netlify-cli
    npm
    npm-check
    pm2
    pnpm
    prettier
    terser
    typescript
    vercel
    wrangler
    yarn
    zx
    EOF
  • asdf install nodejs lts to install latest active Node.js LTS version
    or for a specific version asdf install nodejs latest:<version>

    • asdf list nodejs to list installed Node.js versions
    • asdf latest nodejs list latest available Node.js version
    • asdf list all nodejs lts list all available Node.js LTS versions
    • asdf list all nodejs <version> list all available Node.js versions for a specific version
  • asdf global nodejs lts to set global Node.js to LTS version

  • asdf current nodejs && node --version to verify current Node.js version

  • asdf reshim nodejs after using npm or yarn to install a package and to recreate shims

Global Node.js Packages

  • npm i -g eslint npm-check npm prettier terser typescript yarn zx
  • npm ls -g --depth=0 display top level global packages
  • npm-check -gu check for and/or install latest global packages

Additional Global Node.js Packages

  • npm i -g create-next-app create-react-app gatsby-cli gulp-cli vercel
Using nvm instead of asdf

Note: This section is used if you prefer installing and managing Node.js with nvm instead of asdf. While nvm is older than asdf, it is only used to manage Node.js. Installing other programming environments with asdf while using Node.js via nvm works as expected. If you prefer using one tool to manage all programming environments, use asdf

  • Node Version Manager

    export NVM_DIR="$HOME/.nvm" && (
      git clone https://github.com/nvm-sh/nvm.git "$NVM_DIR"
      cd "$NVM_DIR"
      git checkout `git describe --abbrev=0 --tags --match "v[0-9]*" $(git rev-list --tags --max-count=1)`
    ) && \. "$NVM_DIR/nvm.sh"

    Post Install

    cat << 'EOF' >> ~/.bashrc
    # Enable Node Version Manager
    export NVM_DIR="$HOME/.nvm"
    [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
    [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm bash_completion
    EOF
    • source ~/.bashrc or restart terminal session

    NVM Default Global Packages

    cat << 'EOF' >> "$NVM_DIR/default-packages"
    corepack
    create-next-app
    create-react-app
    eslint
    gatsby-cli
    gulp-cli
    netlify-cli
    npm
    npm-check
    pm2
    prettier
    terser
    typescript
    yarn
    vercel
    zx
    EOF

    NVM Manual Upgrade

    (
      cd "$NVM_DIR"
      git fetch --tags origin
      git checkout `git describe --abbrev=0 --tags --match "v[0-9]*" $(git rev-list --tags --max-count=1)`
    ) && \. "$NVM_DIR/nvm.sh"
  • Node.js — via nvm

    • nvm install lts/* for latest active Node.js LTS or for a specific version nvm install <version>
    • nvm install lts/* --reinstall-packages-from=node install latest active Node.js LTS and reinstall packages from current Node.js
    • nvm version-remote lts/- display latest available Node.js LTS version
    • nvm ls-remote --lts list latest available Node.js LTS versions
    • nvm install node --reinstall-packages-from=node install latest Node.js non-LTS and reinstall packages from current Node.js

    Global Node.js Packages

    • npm i -g eslint npm
    • npm ls -g --depth=0 display top level global packages
    • nvm_npm_global_modules $(nvm current) display top level global packages via nvm
    • npm-check -gu check for and/or install latest global packages

Python

  • Python — via asdf

    Note: Installing via asdf and using pipenv via pip provides a clean and stable Python programming environment. Be sure to review and compare additional Homebrew details prior to installing Python via Homebrew to avoid potential issues. Packages installed with Homebrew will install Python as a dependency, these installs are separate from the macOS system Python version as well as any Python versions installed with asdf. If Python is installed via brew and asdf you may see brew doctor display a warning about additional configuration scripts. The workaround for this is to alias brew as shown in the asdf post install information above

    • asdf plugin add python to add the Python plugin

      Set Default Global Python Packages

      cat << 'EOF' >> ~/.default-python-packages
      pip
      pipenv
      pipx
      EOF
    • asdf install python latest to install latest Python latest version
      or for a specific version asdf install python latest:<version>

      • asdf list python to list installed Python versions
      • asdf latest python list latest available Python version
      • asdf list all python <version> list all available Python versions for a specific version
    • asdf global python latest to set global Python to latest version

    • python --version && pip --version to verify current Python and pip version

    • asdf reshim python after using pip to install a package and to recreate shims

  • pipx — via asdf

    • pip install --user pipx managed Python pip (optional if using asdf with ~/.default-python-packages)

    Post Install for pipx

    cat << 'EOF' >> ~/.bashrc
    # Set local pipx bin $PATH
    export PATH="$PATH:~/.local/bin"
    # Enable pipx shell completion
    eval "$(register-python-argcomplete pipx)"
    EOF
  • pipenv — via asdf

    • pip install --user pipenv managed Python pip (optional if using asdf with ~/.default-python-packages)

    Post Install for pipenv

    cat << 'EOF' >> ~/.bashrc
    # Set pipenv to create .venv in project path
    export PIPENV_VENV_IN_PROJECT=true
    # Enable pipenv shell completion
    eval "$(_PIPENV_COMPLETE=bash_source pipenv)"
    EOF
    • mkdir -p <project name> && cd "$_" to create a new Python project directory and pipenv install to create a new pipfile and virtualenv then pipenv shell to activate the virtualenv, you are now ready to pip install <package name>, and remember to deactivate the shell with exit
    • See pipenv --help or go here for advanced usage details

Go

  • Go — via asdf

    • asdf plugin add golang to add the Golang plugin
    • asdf install golang latest to install latest Golang version
      • asdf list golang to list installed Golang versions
      • asdf latest golang list latest available Golang version
      • asdf list all golang <version> list all available Golang versions for a specific version
    • asdf global golang latest to set global Golang to latest version
    • asdf current golang && go version to verify current Golang version
    • asdf reshim golang after installing any Golang packages and to recreate shims
    • go env to verify current Golang environment details

    Post Install (optional if using asdf with direnv)

    cat << 'EOF' >> ~/.bashrc
    # Enable asdf to manage Golang environment
    export GOPATH=$(asdf where golang)/packages
    export GOROOT=$(asdf where golang)/go
    export GOBIN=$(asdf where golang)/bin
    # Set asdf to manage Golang $PATH
    export PATH="$PATH:$GOBIN"
    • asdf reshim golang after using go get or go install to install a package and to recreate new shims

Ruby

  • Ruby — via asdf

    • asdf plugin add ruby to add the Ruby plugin
    • asdf install ruby latest to install latest Ruby version
      or for a specific version asdf install ruby latest:<version>
      • asdf list ruby to list installed Ruby version
      • asdf latest ruby to list latest available Ruby version
      • asdf list all ruby <version> list all available Ruby versions for a specific version
    • asdf global ruby latest to set global Ruby to latest version
    • asdf current ruby && ruby --version to verify current Ruby version

    RubyGems

    • gem env for RubyGems environment details
    • gem env home check the location where RubyGems are being installed
    • gem outdated and gem update --force
    • gem cleanup
    • gem install bundler

Java

Processing

SDKs & CLIs

Google

  • Google Cloud SDK

    • brew install --cask google-cloud-sdk

    Post Install

    cat << 'EOF' >> ~/.bashrc
    # Enable Google Cloud SDK
    test -r "/usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/path.bash.inc" && . "$_"
    test -r "/usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/completion.bash.inc" && . "$_"
    EOF

Amazon

  • AWS CLI & Python SDK — first follow steps above to install Python 3 including pipenv via Homebrew
    • cd ~ && mkdir -p .aws && cd "$_" && pipenv install awscli boto3 && pipenv run aws --version
    • cd ~/.aws && pipenv run aws --version to confirm the AWS CLI version, for help see pipenv run aws help
    • or run a command like aws configure after activating the shell cd ~/.aws && pipenv shell remember to exit

Microsoft

Netlify and Vercel

Hardware

Logitech

  • brew install --cask logitech-options

Wacom Intuos Tablet

  • brew install --cask wacom-tablet

OpenBCI

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment