Skip to content

Installation

You can install asksh with the install script, from a GitHub Release archive, or from source with Go.

Install script (macOS and Linux)

Run the installer:

curl -fsSL https://setup.asksh.ai | sh

The script does the following:

  1. Detects your OS (darwin or linux) and architecture (amd64 or arm64, switching to arm64 automatically when running under macOS Rosetta).
  2. Downloads asksh_<version>_<os>_<arch>.tar.gz and checksums.txt from GitHub Releases and verifies the SHA-256 checksum.
  3. Installs the asksh binary to ~/.local/bin/asksh (with mode 0755).
  4. Runs asksh setup if you have an interactive terminal and no config.toml exists yet.
  5. Adds PATH and asksh init <shell> to your shell startup file for zsh, bash, or fish.

Installer environment variables

Set any of these variables before piping to sh to customize the install:

Variable Effect
ASKSH_VERSION Install a specific release version (for example 0.2.1 or v0.2.1) instead of latest
ASKSH_INSTALL_DIR Target binary directory (defaults to ~/.local/bin)
ASKSH_NO_SETUP Set to 1 or true to skip running asksh setup
ASKSH_NO_MODIFY_SHELL Set to 1 or true to skip editing your shell startup file
ASKSH_SHELL Override $SHELL detection (zsh, bash, or fish)
ASKSH_CONFIG_DIR Override where the installer checks for an existing config.toml

Prebuilt archives

Prebuilt binaries for macOS, Linux, and Windows (amd64 and arm64) are published on GitHub Releases. Each archive includes asksh (or asksh.exe on Windows), LICENSE, README.md, and config.example.toml.

  1. Download the archive for your platform and checksums.txt.
  2. Verify the SHA-256 checksum (sha256sum -c on Linux or shasum -a 256 -c on macOS).
  3. Extract the archive and move asksh into a directory on your PATH.
  4. Run asksh setup and install the shell integration below.

Windows support

install.sh exits with an error on MINGW, MSYS, and CYGWIN shells. Download the .zip archive from GitHub Releases manually.

Build from source

Building from source requires Go matching go.mod (Go 1.27.1 or newer):

git clone https://github.com/askshell/asksh.git
cd asksh
CGO_ENABLED=0 go build -o asksh ./cmd/asksh

Move the compiled asksh binary to a directory on your PATH, then run asksh setup.

Install the shell integration

If you ran the install script without ASKSH_NO_MODIFY_SHELL, your startup file is already configured. Otherwise, add the hook for your shell manually:

Add to ~/.zshrc (or $ZDOTDIR/.zshrc):

eval "$(asksh init zsh)"

Add to ~/.bashrc (or ~/.bash_profile on macOS if you use login shells):

eval "$(asksh init bash)"

Bash 4.0+ required for keybindings

macOS ships Bash 3.2 by default. Command recording still works on Bash 3.x, but the ? and Alt+? bindings require Bash 4.0 or newer (BASH_VERSINFO[0] >= 4). Install a newer Bash (for example via Homebrew) if you use those keybindings.

Add to ~/.config/fish/config.fish:

asksh init fish | source

Upgrade

Update an installed release binary in place with:

asksh update

asksh upgrade is an alias for asksh update. The updater checks the latest tag on GitHub Releases, verifies the archive checksum against checksums.txt, and atomically replaces the running executable. On macOS running under Rosetta, it downloads the arm64 binary.

By default, the interactive TUI also checks for a new release once every 24 hours and caches the result in ~/.local/share/asksh/update.json. Set ASKSH_NO_UPDATE_CHECK=1 to disable background checks.

Uninstall

See Uninstalling asksh.