Installation
Choose an installation method below. If you already selected a tab on the home page, your selection stays active here.
cabal update && cabal install canontracurl -fsSL https://raw.githubusercontent.com/symtrace/canontra/main/install.sh | bashirm https://raw.githubusercontent.com/symtrace/canontra/main/install.ps1 | iexgit clone https://github.com/symtrace/canontra.git && cd canontra && stack build --fast && stack installOption 1: Install from Hackage (Cabal)
Section titled “Option 1: Install from Hackage (Cabal)”Canontra is published on Hackage (canontra >= 0.4). If you have GHC (>= 9.6) and Cabal (>= 3.0) installed:
cabal updatecabal install canontraMake sure your Cabal binary folder is on PATH:
- Linux / macOS:
~/.cabal/bin(or~/.local/binif you pass--installdir) - Windows:
%APPDATA%\cabal\bin
Option 2: Pre-Built Standalone Binaries
Section titled “Option 2: Pre-Built Standalone Binaries”If you do not have Haskell installed, use the official release scripts. They detect your OS and CPU architecture, install the standalone binary, add it to your user PATH (no admin rights required), and set up shell autocompletions.
Linux and macOS (POSIX)
Section titled “Linux and macOS (POSIX)”curl -fsSL https://raw.githubusercontent.com/symtrace/canontra/main/install.sh | bash- Installs into
~/.local/bin/canontra. - Linux
x86_64binaries are stripped standalone executables. - macOS
aarch64(Apple Silicon) binaries are ad-hoc codesigned. - Adds completions for Bash, Zsh, or Fish when present.
Preview what the script will do without changing any files:
curl -fsSL https://raw.githubusercontent.com/symtrace/canontra/main/install.sh -o install.shbash install.sh --dry-runWindows (PowerShell)
Section titled “Windows (PowerShell)”irm https://raw.githubusercontent.com/symtrace/canontra/main/install.ps1 | iex- Detects
AMD64orARM64and installscanontra.exeinto%LOCALAPPDATA%\Programs\canontra. - Official Windows release binaries are Authenticode self-signed with SHA-256.
- Adds
%LOCALAPPDATA%\Programs\canontrato your UserPATHand registers PowerShell completions in$PROFILE.
Preview without modifying files or environment variables:
.\install.ps1 -DryRunVerify Release Checksums (SHA256SUMS.txt)
Section titled “Verify Release Checksums (SHA256SUMS.txt)”In air-gapped or security-restricted environments, download the binary together with SHA256SUMS.txt from GitHub Releases and verify its SHA-256 checksum before running:
# Linux / macOSsha256sum -c SHA256SUMS.txt --ignore-missing# Windows PowerShellGet-FileHash .\canontra-windows-AMD64.exe -Algorithm SHA256Get-Content .\SHA256SUMS.txtOption 3: Build from Source
Section titled “Option 3: Build from Source”Requires GHC 9.6.6, Stack (LTS 22.28) or Cabal (>= 3.0), and Git. Canontra has no C/C++ library dependencies, so it builds cleanly offline once Haskell packages are cached.
git clone https://github.com/symtrace/canontra.gitcd canontrastack build --faststack installFor an optimized -O2 release binary:
stack build --copy-bins --local-bin-path ./dist-bin --ghc-options="-O2"Verify Installation
Section titled “Verify Installation”canontra versionExpected output for v0.4.0.0:
canontra version 0.4.0