Skip to main content

Installation

Choose the installation method that works best for you.

The easiest way to install on macOS or Linux:

brew install benjaminabbitt/tap/scm

Go Install

If you have Go 1.21+ installed:

go install github.com/benjaminabbitt/scm@latest

Make sure ~/go/bin is in your PATH:

export PATH=$PATH:$(go env GOPATH)/bin

Download Binary

Download precompiled binaries from the releases page.

macOS

# Apple Silicon (M1/M2/M3)
curl -L https://github.com/benjaminabbitt/scm/releases/latest/download/scm_0.0.8_darwin_arm64.tar.gz | tar xz
sudo mv scm /usr/local/bin/

# Intel
curl -L https://github.com/benjaminabbitt/scm/releases/latest/download/scm_0.0.8_darwin_amd64.tar.gz | tar xz
sudo mv scm /usr/local/bin/

Linux

# x86_64
curl -L https://github.com/benjaminabbitt/scm/releases/latest/download/scm_0.0.8_linux_amd64.tar.gz | tar xz
sudo mv scm /usr/local/bin/

# ARM64
curl -L https://github.com/benjaminabbitt/scm/releases/latest/download/scm_0.0.8_linux_arm64.tar.gz | tar xz
sudo mv scm /usr/local/bin/

Build from Source

For development or to get the latest unreleased features:

Prerequisites

  • Go 1.21+
  • just command runner (optional)

Clone and Build

# Clone the repository
git clone https://github.com/benjaminabbitt/scm.git
cd scm

# Option 1: Using just
just install

# Option 2: Using go directly
go build -o scm .
sudo mv scm /usr/local/bin/

Build Options

CommandDescription
just installBuild and install to ~/go/bin
just install-localBuild static and install to ~/.local/bin
just uninstallRemove from ~/.local/bin

Verify Installation

scm --version

Expected output:

scm version 0.0.8

Shell Completion

Generate shell completion scripts for better CLI experience:

Bash

# Current session only
source <(scm completion bash)

# Permanent (Linux)
scm completion bash > /etc/bash_completion.d/scm

# Permanent (macOS with Homebrew)
scm completion bash > $(brew --prefix)/etc/bash_completion.d/scm

Zsh

# Add to fpath and restart shell
scm completion zsh > "${fpath[1]}/_scm"

Fish

scm completion fish > ~/.config/fish/completions/scm.fish

PowerShell

scm completion powershell | Out-String | Invoke-Expression

Updating

Homebrew

brew upgrade scm

Go Install

go install github.com/benjaminabbitt/scm@latest

Binary

Download the latest release and replace the existing binary.

Troubleshooting

Command not found

Ensure the installation directory is in your PATH:

# For go install
echo $PATH | grep -q "$(go env GOPATH)/bin" || export PATH=$PATH:$(go env GOPATH)/bin

# For manual install
echo $PATH | grep -q "/usr/local/bin" || export PATH=$PATH:/usr/local/bin

Permission denied

Use sudo when installing to system directories, or install to a user directory:

# Install to user directory instead
mkdir -p ~/.local/bin
mv scm ~/.local/bin/
export PATH=$PATH:~/.local/bin

Next Steps

After installation:

  1. Quick Start - Get up and running
  2. Configuration - Set up your environment