>_

shellcheck

agent-ready json output non-interactive

ShellCheck, a static analysis tool for shell scripts

How to install shellcheck

brew install shellcheck

shellcheck use case

Static analysis and linting of shell scripts (bash/sh) to catch errors, improve quality, and enforce best practices.

When to use shellcheck

  • Before committing shell scripts to ensure they are free of syntax and semantic errors
  • Integrating into CI/CD pipelines to automatically lint shell scripts as part of builds
  • Reviewing legacy or unfamiliar shell code to identify potential pitfalls and improve robustness

When not to use shellcheck

  • For scripts written in languages other than shell (e.g., Python, Ruby, or batch files)
  • When runtime testing or execution-based validation is required (ShellCheck is a static analyzer only)
  • If you need to check the behavior of interactive shell sessions or dynamic constructs that cannot be statically analyzed

shellcheck features

  • · Detects syntax errors and common beginner mistakes
  • · Identifies semantic issues causing unexpected behavior
  • · Highlights subtle pitfalls, corner cases, and portability concerns
  • · Supports output in formats like JSON, TAP, CheckStyle, and plain text

Want your agent to find this automatically?

Add the MCP server to your agent config and it will discover tools like shellcheck on its own.

Set up MCP →

Similar tools to shellcheck