Skip to content

Install

ctx is a single static binary. The install scripts download a prebuilt release from GitHub, verify its SHA-256 against the release’s checksums.txt, drop it in a user-writable directory, and put that directory on your PATH. No Go toolchain, no sudo, no package manager.

Terminal window
curl -fsSL https://raw.githubusercontent.com/sugihAF/Contexo/main/scripts/install.sh | sh

Both scripts are idempotent — re-running is safe, and re-running is not how you update (that’s ctx update).

ctx version
ctx 0.5.1 (9f31c07, 2026-07-28)

Scripts and CI want just the number:

ctx version --short
0.5.1

If ctx version prints ctx dev (none, unknown), you have an unstamped build — see go install below.

Platform Default location Override
macOS, Linux $HOME/.local/bin/ctx CONTEXO_INSTALL_DIR
Windows %LOCALAPPDATA%\Programs\contexo\ctx.exe $env:CONTEXO_INSTALL_DIR
go install $(go env GOPATH)/bin/ctx GOBIN

Both scripts check whether a different ctx is already on your PATH and warn you about it rather than silently letting PATH order decide which one runs. If you see that warning, delete the stale copy.

macOS and Linux. If the install directory isn’t already on your PATH, the script appends a PATH line to the rc file for your login shell — ~/.zshrc for zsh, ~/.bashrc on Linux or ~/.bash_profile on macOS for bash (both get export PATH=…), ~/.config/fish/config.fish for fish (set -gx PATH …). It checks first, so a second run doesn’t duplicate the line. Any other shell gets a message telling you to add the directory yourself. Open a new terminal (or source the rc file) afterwards.

Windows. The script writes the install directory into your user Path environment variable — persistent, no admin rights, no machine-wide change — and also appends it to the current session’s $env:Path so ctx works immediately in the window you ran it from. Terminals that were already open need a restart.

Both scripts resolve the latest release tag from the GitHub API, download ctx_<version>_<os>_<arch>.(tar.gz|zip) plus checksums.txt, and compare the archive’s SHA-256 against the listed digest. A missing or mismatched checksum aborts the install — the binary is never written.

The shell script needs curl or wget to download, tar to unpack, and one of sha256sum, shasum or openssl to hash. If none of the three hashing tools is present it stops rather than install a binary it couldn’t check.

The macOS/Linux script additionally verifies a minisign signature over checksums.txt, but only when a public key is configured (hardcoded in the script or passed as CONTEXO_MINISIGN_PUBKEY). With no key configured, the checksum is the whole gate. The PowerShell script has no signature step at all.

Prebuilt targets are linux/amd64, linux/arm64, darwin/amd64, darwin/arm64 and windows/amd64. There is no windows/arm64 build yet — the release config skips it, so on an ARM64 Windows machine the script finds no matching archive. Build from source with go install there. Any other OS or architecture exits with an “unsupported” error rather than installing something that won’t run.

go install github.com/sugihAF/contexo/cmd/ctx@latest builds from source and works fine, with one consequence worth knowing: release metadata is injected at build time with -ldflags, so a go install binary reports version dev.

That’s not cosmetic. ctx update refuses to self-update a dev build — it tells you to reinstall with the script or re-run go install — and the background “update available” nudge stays silent. Use the install scripts unless you specifically want to build from source.

ctx update downloads the latest verified binary and replaces the running one in place; ctx update --check only reports. If ctx is running from a Homebrew or Scoop path, ctx update won’t touch it — it points you at brew upgrade or scoop update so the package manager’s metadata stays consistent.

To remove ctx, delete the binary and the PATH line the installer added. To undo ctx init in a project — MCP entries, capture hooks, the .gitignore line — use ctx detach. It prints its plan and waits for a yes.