Highlights bash syntax and can suggest or apply quoting changes aimed at ShellCheck-style safety, focused mainly on proper quoting.
Overview
Shellharden is a command-line utility for bash scripts that combines syntax highlighting with tooling to improve quoting habits. In its default mode it behaves like cat but colors syntax and uses background highlights to show characters it would add or remove under automatic rewrite.
The tool is built to complement ShellCheck by optionally applying fixes after human review, especially around quoting variables and command substitutions. A transform mode rewrites scripts toward safer quoting, assuming the script does not rely on unquoted word splitting or globbing.
Operators are warned not to run transform blindly: scripts that depend on legacy unquoted behavior may break and need manual fixes. Distribution packages and a Rust toolchain install path are documented for obtaining the binary.
Shellharden was formerly known as Naziquote and positions itself as a way to harden vulnerable shell scripts once suggestions are reviewed.
Key features
- Bash syntax highlighting
- Suggested quoting changes
- Optional --transform rewrites
- Cat-like default pipeline mode
- ShellCheck-oriented quoting focus
- Foreground and background diff hints
Use cases
- Review bash quoting in scripts
- Semi-automate ShellCheck-style fixes
- Teach safer bash variable usage
- Pipeline-highlight shell snippets