Repository navigation
v0.1.0
First release.
Explanations
- Line-by-line explanations of shell scripts in English and Japanese: commands and options (about 120 commands and builtins, with combined flags, option values and subcommands), operators, redirections and their order,
${…}expansions part by part, control flow, and well-known idioms. - The languages inside arguments: regular expressions (BRE, ERE, PCRE), sed scripts, awk programs, jq and yq filters, perl one-liners,
printfanddateformats,findexpressions,chmodmodes,sort -k/cut -f/trsets,getopts/getoptoption strings, andgit log --pretty/--dateformats. - Worked examples with sample input and output, for regexes, sed, awk, jq, yq, perl, text filters, whole pipelines, expansions,
printf, globs, tests,xargs,read,getoptandgit log. They are computed by built-in code that the tests check against the real tools. - Your own commands, described in
bashExplainer.customCommands.
Ways to show them
- A hover for the line under the mouse, or for the cursor line with
Ctrl+K Ctrl+E(Cmd+K Cmd+Eon macOS). - A panel that follows the cursor, inspired by regex101: edit an example's input and watch the output change, with matches and capture groups highlighted; fold the tree, copy it as Markdown, switch the shell or yq for the file, and search a quick reference.
- An inline one-line summary at the end of the cursor line.
Other shells and other files
- Constructs that POSIX sh, dash, ash, yash, ksh, mksh or zsh do not support are pointed out, and behaviour that differs from bash is noted. The shell is detected from the shebang, a
# shellcheck shell=line or the file name. - Shell code inside Dockerfiles, Makefiles, GitHub Actions and GitLab CI YAML,
package.jsonscripts, Markdown code blocks and Pythonsubprocess/os.systemcalls is explained too, with warnings about script injection, DockerRUNpipes withoutpipefailand Python commands passed withoutshell=True. - yq commands are recognised as mikefarah/yq v4, kislyuk/yq or mikefarah/yq v3, with the first v4 release that has what the command uses.
Problems panel
- Warnings in the Problems panel, with quick fixes where the rewrite keeps the meaning (
[[ ]]→[ ],==→=,source→.,&>→> … 2>&1, and more). # bash-explainer disable=<code>anddisable-file=<code>comments, andbashExplainer.diagnostics.ignore, to silence them.
Privacy
- Works offline by design: no network access, no AI, no telemetry, no external processes. A CI check keeps it that way.