wiki / shellwhy / overviewedited 2026-07-19
shellwhy

shellwhy answers a practical dotfiles question: “why is my shell doing this?” It inspects the current or requested shell mode, applies startup-file rules, safely parses obvious source statements, detects common shell tooling hooks, and reports what is inferred, possible, missing, skipped, or observed. Written in Rust; MIT/Apache-2.0 dual-licensed.

There was no standardised way to check how a shell is configured and which files are affecting the running process — this is that tool.

Features

  • Static startup-file rules for bash, zsh, and fish, with conservative fallbacks for sh/dash, ksh/mksh, tcsh/csh, and nu
  • Safe static parsing for obvious source file and . file statements — no shell code is executed
  • Detection for common tooling hooks: starship, oh-my-zsh, zinit, direnv, asdf, pyenv, nvm, fnm, fisher, tide
  • Human-readable, plain, and JSON output
  • Linux trace mode using strace to observe what actually loads

Usage

shellwhy                                   # infer and explain the current shell
shellwhy --shell bash                      # explain bash startup for this user
shellwhy --shell zsh --login --interactive # a specific mode
shellwhy --shell bash --json               # machine-readable
shellwhy trace --shell fish                # observe via strace (Linux)
shellwhy explain                           # why shell-startup certainty is hard

Install

cargo install --path .        # from a checkout

Every reported file carries a confidence label rather than a pretence of certainty — the confidence model is the core design idea.