Install the CLI#
Get the midnight binary onto your machine and verify it before you run it.
Before you start#
- A release archive for your platform, or a Go toolchain.
sha256sumon Linux,shasum -a 256on macOS, orGet-FileHashon Windows.
Archives are produced for linux/amd64, linux/arm64, darwin/amd64,
darwin/arm64 and windows/amd64.
Install from a release archive#
Download the archive and the checksum manifest for the same release.
Verify the archive against the manifest. Replace
VERSIONwith the release you downloaded:sha256sum --check midnight_VERSION_SHA256SUMS --ignore-missingExtract and install:
tar -xzf midnight_VERSION_linux_amd64.tar.gzmkdir -p "$HOME/.local/bin"install -m 0755 midnight "$HOME/.local/bin/midnight"Confirm the binary runs:
midnight version
macOS uses shasum -a 256 --check in place of sha256sum. On Windows, verify
the ZIP with Get-FileHash -Algorithm SHA256 and compare the result to the
matching line in the checksum manifest before extracting.
The archives are checksum-protected but carry no detached signature. A checksum downloaded from the same location detects corruption, not a compromised release location. Obtain the manifest through a channel you trust independently if that matters to you.
Homebrew and Scoop are not configured, so brew install and scoop install
are not supported paths.
Install from source#
go install github.com/midnight/midnight/cmd/midnight@latest
midnight version
Shell completion#
Every archive contains a completions/ directory. Install the file for your
shell.
Bash:
mkdir -p "$HOME/.local/share/bash-completion/completions"
install -m 0644 completions/midnight.bash "$HOME/.local/share/bash-completion/completions/midnight"
Start a new shell afterwards. The bash-completion package must be installed
and loaded.
Zsh:
mkdir -p "$HOME/.zfunc"
install -m 0644 completions/_midnight "$HOME/.zfunc/_midnight"
Then add $HOME/.zfunc to fpath in .zshrc and run compinit.
Fish:
cp completions/midnight.fish "$HOME/.config/fish/completions/midnight.fish"
PowerShell: the Windows ZIP contains completions/midnight.ps1. Dot-source it
for the current session, or add the same line with a permanent absolute path to
your profile.
If you installed with go install, generate completion directly instead:
midnight completion bash
zsh, fish and powershell are also accepted.
The Debian package installs Bash, Zsh and Fish completions into their standard system locations automatically.
Verify#
midnight version
The command prints a version. Completion works after starting a new shell.
If it does not work#
| Symptom | Check | Recovery |
|---|---|---|
| Checksum verification fails | That manifest and archive are from the same release | Re-download both; do not run an archive that fails verification |
midnight: command not found |
Whether the install directory is on PATH |
Add it, or install elsewhere on PATH |
| Completion does nothing | Whether you started a new shell | Bash also needs bash-completion installed and loaded |
go install fails |
Your Go version against the module requirement | The module targets a recent Go release |