Inspect shell installers before running.

See what a curl | bash script does without running it.

curl -fsSL https://example.com/install.sh | shxray
Never executes
installer.sh bash
  1. 61 if [ "$(id -u)" -ne 0 ]; then
  2. 70 curl -fsSL "$URL" -o "$TMP/tool.tar.gz"
  3. 71 sha256sum -c "$TMP/checksums.txt"
  4. 72 gpg --verify "$TMP/tool.tar.gz.asc" "$TMP/tool.tar.gz"
  5. 75 $SUDO install -m 755 "$TMP/tool" "$PREFIX/bin/tool"
  6. 77 echo "export PATH=\"$PREFIX/bin:\$PATH\"" >> "$HOME/.bashrc"
  7. 81 apt-get install -y ca-certificates
  8. 87 curl -fsSL https://example.com/hook.sh | bash
Report v1 darwin, freebsd, linux
High risk 88 lines

Installs to $PREFIX/bin/tool (PREFIX defaults to /usr/local; override with PREFIX=... or --prefix), creates $PREFIX/share/tool, appends $HOME/.bashrc, and runs apt-get.

  1. 1. Downloads "$URL" (= https://example.com/tool/releases/download/v${VERSION}/tool-${OS}-${ARCH}.tar.gz) with curl. L70
  2. 2. Checks a checksum with sha256sum on $TMP/checksums.txt. L71
  3. 3. With sudo, installs to $PREFIX/bin/tool (PREFIX defaults to /usr/local; override with PREFIX=... or --prefix). L75
  4. 4. Appends $HOME/.bashrc. L77
  5. 5. If ${SHXRAY_HOOK:-} = 1: pipes into bash: curl -fsSL https://example.com/hook.sh | bash. L87

Built for local inspection.

Reads from stdin or a file, parses the shell grammar, and lists what the script would do.

Detected targets
Normalizes amd64 and arm64 from uname, case, and $OSTYPE branches. linux, darwin, freebsd / x86_64, aarch64
Syntax-aware parser
Parses real Bash and POSIX sh grammar with sh-syntax 0.8.7 (mvdan/sh), never regex scraping. Bash (default), POSIX sh (--posix)
Runtime permissions
Never runs the script and never requests network access. deno run --allow-read --allow-env
Shared schema
Terminal view and browser playground read the same AnalysisReport object. AnalysisReport (version: 1)
Output language
English and Japanese summaries, selected by flag or system locale. --lang en | --lang ja

From raw shell to structured facts.

Every extracted claim keeps its source line so you can verify what triggered it.

installer.sh
11 OS="$(uname -s)"; ARCH="$(uname -m)"
Recognizes operating systems darwin, freebsd, and linux, and architectures aarch64 and x86_64.
70 curl -fsSL "$URL" -o "$TMP/tool.tar.gz"
Downloads "$URL" (= https://example.com/tool/releases/download/v${VERSION}/tool-${OS}-${ARCH}.tar.gz) with curl.
71 sha256sum -c "$TMP/checksums.txt"
Checks a checksum with sha256sum on $TMP/checksums.txt.
75 $SUDO install -m 755 "$TMP/tool" "$PREFIX/bin/tool"
With sudo, installs to $PREFIX/bin/tool (PREFIX defaults to /usr/local; override with PREFIX=... or --prefix).
87 curl -fsSL https://example.com/hook.sh | bash
If ${SHXRAY_HOOK:-} = 1: pipes into bash: curl -fsSL https://example.com/hook.sh | bash.

Try any script in your browser.

Runs locally inside a Web Worker with Wasm. Nothing leaves this tab.

Paste a script or drop a local .sh file here.
Prerendered
High risk 88 lines

Installs to $PREFIX/bin/tool (PREFIX defaults to /usr/local; override with PREFIX=... or --prefix), creates $PREFIX/share/tool, appends $HOME/.bashrc, and runs apt-get.

Downloads from example.com with curl and verifies integrity with gpg and sha256sum.

Checks whether it is root and may run commands with sudo.

Recognizes operating systems darwin, freebsd, and linux, and architectures aarch64 and x86_64.

  1. 1.
    Sets shell options (set -euo pipefail).
  2. 2.
    Sets $OS. Reads the kernel name with uname -s.
  3. 3.
    Sets $ARCH. Reads the machine hardware with uname -m.
  4. 4.
    Branches on $OS (Linux, Darwin, FreeBSD).
  5. 5.
    Branches on $ARCH (x86_64, amd64, aarch64, arm64).
  6. 6.
    Branches on $OSTYPE (linux-gnu, darwin*).
  7. 7.
    Parses CLI options (--prefix, --prefix=*, -y, --yes, -h, --help).
  8. 8.
    Creates a temporary directory ($TMP) with mktemp.
  9. 9.
    Downloads "$URL" (= https://example.com/tool/releases/download/v${VERSION}/tool-${OS}-${ARCH}.tar.gz) with curl.
  10. 10.
    Checks a checksum with sha256sum on $TMP/checksums.txt.
  11. 11.
    Verifies a signature with gpg on $TMP/tool.tar.gz.asc.
  12. 12.
    Extracts $TMP/tool.tar.gz with tar.
  13. 13.
    With sudo, installs to $PREFIX/bin/tool (PREFIX defaults to /usr/local; override with PREFIX=... or --prefix).
  14. 14.
    Creates $PREFIX/share/tool.
  15. 15.
    Appends $HOME/.bashrc.
  16. 16.
    If $YES != 1:
  17. 17.
    Removes $TMP with rm -rf.
  18. 18.
    If ${SHXRAY_HOOK:-} = 1: pipes into bash: curl -fsSL https://example.com/hook.sh | bash.
Ask AI Passes the static report summary only.
ChatGPT Claude

Automatic fetching from a URL is not supported. A remote server could serve different content to a browser than to curl (cloaking), or abuse the visitor's network and IP. Save the script locally first with curl -fsSL https://example.com/install.sh -o install.sh, then drop the file above or paste its contents.

Run shxray in your terminal.

Download a prebuilt single binary from GitHub Releases, no runtime required.

Direct binary download

Standalone binary for Linux and macOS.

Or with curl | sh (yes, really)
curl -sSfL https://raw.githubusercontent.com/Tiryoh/shxray/main/install.sh | sh

Of course you can install it with curl too. Feel free to inspect install.sh in the workbench above before running it.

Prefer building from source with Deno 2.9+? See the GitHub README.

$ shxray tests/fixtures/installer.sh
Summary
  Installs to $PREFIX/bin/tool (PREFIX defaults to /usr/local; override with PREFIX=... or --prefix), creates $PREFIX/share/tool, appends $HOME/.bashrc, and runs apt-get.
  Downloads from example.com with curl and verifies integrity with gpg and sha256sum.
  Checks whether it is root and may run commands with sudo.
  Recognizes operating systems darwin, freebsd, and linux, and architectures aarch64 and x86_64.

Flow
  1. Sets shell options (set -euo pipefail). [L3]
  2. Sets $OS. Reads the kernel name with uname -s. [L11]
  3. Sets $ARCH. Reads the machine hardware with uname -m. [L12]
  4. Branches on $OS (Linux, Darwin, FreeBSD). [L14]
  5. Branches on $ARCH (x86_64, amd64, aarch64, arm64). [L24]
  6. Branches on $OSTYPE (linux-gnu, darwin*). [L33]
  7. Parses CLI options (--prefix, --prefix=*, -y, --yes, -h, --help). [L39]
  8. Creates a temporary directory ($TMP) with mktemp. [L67]
  9. Downloads "$URL" (= https://example.com/tool/releases/download/v${VERSION}/tool-${OS}-${ARCH}.tar.gz) with curl. [L70]
  10. Checks a checksum with sha256sum on $TMP/checksums.txt. [L71]
  11. Verifies a signature with gpg on $TMP/tool.tar.gz.asc. [L72]
  12. Extracts $TMP/tool.tar.gz with tar. [L74]
  13. With sudo, installs to $PREFIX/bin/tool (PREFIX defaults to /usr/local; override with PREFIX=... or --prefix). [L75]
  14. Creates $PREFIX/share/tool. [L76]
  15. Appends $HOME/.bashrc. [L77]
  16. If $YES != 1: [L79]
     - Updates package indexes with apt-get. [L80]
     - Installs packages with apt-get: ca-certificates. [L81]
  17. Removes $TMP with rm -rf. [L84]
  18. If ${SHXRAY_HOOK:-} = 1: pipes into bash: curl -fsSL https://example.com/hook.sh | bash. [L87]

CLI options and exit codes.

Reads stdin when no file path is given; prints help if stdin is a terminal.

Flag Behavior
--json Print the versioned AnalysisReport (version 1) as JSON.
--verbose Append the detailed branch tree and per-category facts.
--lang <en|ja> Choose English or Japanese prose output.
--posix Parse input as POSIX sh instead of Bash.
--plain Disable ANSI color (also automatic when stdout is piped).

Exit codes: 0 analysis finished, 1 usage or I/O error, 2 syntax error (prints report with parse.ok false).

Scope and limits

Static pass only
Nothing runs, including command substitutions and heredoc payloads.
Every branch shown
Lists both sides of if and case without guessing which path runs.
Unresolved variables
Runtime values stay written as $URL unless assigned a single literal.
No remote fetch
Neither the CLI nor this site downloads URLs found inside a script.

Related tools

Different tools solve adjacent parts of shell safety. shxray focuses on local static inspection in place of bash.

Concept inspired by curl-bash-explain.