- install.sh: POSIX sh installer that detects OS/arch (incl. Rosetta), resolves the newest vX.Y.Z release via the GitHub API (skipping ownership-snapshot-current), verifies SHA256SUMS, sanity-runs the binary, and installs atomically into ~/.local/bin without sudo. Supports --version/--dir and IDX_* env overrides; prints a PATH hint, a NixOS flake suggestion, and helper-tool install hints instead of calling package managers. - scripts/install-sh-test.sh: fixture tests against a local fake release server (latest, pinned, piped, checksum mismatch, missing release, unsupported OS, PATH hint, reinstall). - ci.yml: install-script job (ShellCheck, sh + dash on Linux, sh on macOS). - release.yml: attach install.sh to each release. - README + docs/INSTALL.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017a5Cv5Z1NzdYKgKnTiAF4E
2.4 KiB
Install script
install.sh installs a prebuilt idx binary from GitHub Releases. It is the
fastest path on Linux and macOS and needs no Rust toolchain, Node, or sudo.
curl -fsSL https://raw.githubusercontent.com/0xrsydn/idx-cli/main/install.sh | sh
Each release also carries a copy of the script as a release asset, so a versioned URL stays stable:
curl -fsSL https://github.com/0xrsydn/idx-cli/releases/download/v0.2.4/install.sh | sh
What it does
- Detects the OS and CPU with
uname(Rosetta shells on Apple Silicon get the native arm64 build). - Resolves the newest
vX.Y.Zrelease through the GitHub API. It does not use/releases/latest, because this repo also publishes non-app releases such asownership-snapshot-current. - Downloads the binary and
SHA256SUMS, and refuses to install on a checksum mismatch. - Runs
idx versionfrom the download to confirm it executes here. - Moves the binary into the install directory in one step, replacing any previous install.
- Prints a PATH hint when needed, plus notes about optional helper tools.
It never edits shell profiles and never calls a system package manager. On
NixOS it suggests the flake instead, and when mutool or curl_chrome* are
missing it prints the matching package-manager command so you can install
them yourself.
Options
| Flag | Environment | Default |
|---|---|---|
--version <tag> |
IDX_VERSION |
newest vX.Y.Z release |
--dir <path> |
IDX_INSTALL_DIR |
$HOME/.local/bin |
IDX_GITHUB_URL |
https://github.com (for mirrors) |
|
IDX_GITHUB_API |
https://api.github.com (for mirrors) |
Pass flags through the pipe with sh -s --:
curl -fsSL https://raw.githubusercontent.com/0xrsydn/idx-cli/main/install.sh | sh -s -- --version v0.2.3 --dir ~/bin
Supported platforms
Same assets as the npm package: idx-linux-x64, idx-linux-arm64 (static
musl builds), idx-darwin-arm64, idx-darwin-x64. Windows users can run the
script inside WSL.
Uninstall
rm ~/.local/bin/idx
Config and cache live in ~/.config/idx/ and ~/.cache/idx/.
Tests
scripts/install-sh-test.sh runs the script against a local fake release
server, so it needs no network. CI runs it with sh and dash on Linux and
with sh on macOS, plus ShellCheck.
scripts/install-sh-test.sh
INSTALL_SH_SHELL=dash scripts/install-sh-test.sh