Sol SPM Sign inCreate account

spm, in your terminal

Add and install packages with a lock file, put tools on your PATH, publish, move big files, and set git up for SPM's repos. One small program for Linux, macOS and Windows.

Install it

Linux and macOS
curl -fsSL https://get.mathiassol.dev/spm | sh
Windows, in PowerShell
irm https://get.mathiassol.dev/spm | iex

It goes in ~/.spm/bin, checked against its published SHA-256, and that folder goes on your PATH. Later, spm self-update fetches the newest.

Start

spm login                      # sign in, in your browser
spm init                       # an spm.toml for this project
spm add @owner/name            # add a package, and install it
spm install                    # exactly what spm.lock says
spm update                     # newer versions within the ranges
spm install -g @owner/tool     # a tool's commands, onto your PATH

Packages go in spm_modules/@owner/name, or where the package (or --path) says. spm.lock keeps every version and its SHA-256: commit it, and every install of that commit is the same.

Publish

spm init --package @you/name   # a package's spm.toml
spm publish --dry-run          # what would go in it
spm publish                    # pack it, upload it, publish it
spm publish --target linux-amd64=dist/linux --target darwin-arm64=dist/mac
spm yank @owner/[email protected]     # keep new installs off a version

Files and repos

spm upload big.iso             # in parts that resume; prints its link
spm download <link>            # resumes too, checked by hash
spm repo create name           # a repo of yours
spm repo clone @owner/name     # with git and git lfs set up for SPM
spm repo setup                 # the same, in a repo you have

After spm login, git asks spm for SPM's password. In a repo cloned or set up with spm, git lfs sends big files through spm too, of any size.