Skip to content

Xcode Command Line Tools ​

A new Mac has no git, clang, or make until the Xcode Command Line Tools are installed. xcode-select --install opens a dialog, which nobody can click on a machine you set up over SSH, such as a CI runner prepared with mise bootstrap remote. Ask mise bootstrap to install the tools instead:

[bootstrap.macos]
command_line_tools = true

mise bootstrap then checks for the tools before it installs package manager plugins and system packages, so Homebrew taps can be cloned and formulae without a bottle can be built from source. When the tools are missing, mise installs them with softwareupdate, which can take several minutes. On Linux and Windows the setting is ignored, so a config shared with those machines can keep it. --skip packages skips the check along with the packages.

How mise checks and installs the tools ​

The tools count as installed when xcode-select -p names a directory that exists and /Library/Developer/CommandLineTools/usr/bin/git exists. /usr/bin/git alone proves nothing: until the tools are installed, it only opens the dialog.

To install them, mise runs a helper as root through sudo (see Root privileges and sudo). The helper does what the dialog does behind the scenes. When /Library/Developer/CommandLineTools/usr/bin/git is already on disk, it skips the first four steps:

  1. It creates /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress, which makes softwareupdate offer the tools.
  2. It reads softwareupdate --list and picks a "Command Line Tools for Xcode" label: a release rather than a beta (a beta only when no release is offered), one marked recommended when there is one, and of those the newest version.
  3. It runs softwareupdate --install "<label>" --verbose.
  4. It removes the marker file, even when the install fails.
  5. Unless xcode-select -p already names a directory that exists, it runs xcode-select --switch /Library/Developer/CommandLineTools.

Afterwards mise checks again and fails if the tools are still missing.

Preview and apply ​

The commands work whether or not the config sets command_line_tools:

sh
mise bootstrap macos command-line-tools status
mise bootstrap macos command-line-tools apply --dry-run
mise bootstrap macos command-line-tools apply

status --missing exits with status 1 when the tools are not installed, and status --json prints the state as JSON. mise bootstrap --dry-run says whether it would install the tools. When the config sets command_line_tools = true, mise bootstrap status lists the tools too, and mise bootstrap status --missing fails while they are missing.

Once installed, the tools are updated like any other macOS update, through System Settings or softwareupdate; mise does not upgrade or remove them.

MIT LicenseCopyright © 2026jdx.dev