HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
mvdan
sh
Go2016–2025
mvdan / sh

sh

A shell parser, formatter, and interpreter with bash and zsh support; includes shfmt

20Distinct people
30Mentions
1Explicit recommenders
9.2KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

A shell parser, formatter, and interpreter with bash and zsh support; includes shfmt

GitHub

Where it is used

No documented product use was verified in the last source check.

What people are saying

This is one of my favorite tips for almost effortlessly improving devops productivity (along with using https://github.com/mvdan/sh for auto-formatting) — by now shellcheck has…

acdha used a recommendation phrase. One indexed comment matches. This is a phrase match, not a verdict.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

Mentioned in the same Hacker News threads. That is not proof they are substitutes.

This week on Hacker News

Nov 9–Nov 16 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/16/2026, 1:56:48 AM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year30 dated mentions

Observed mentions: 2016-06-04 20:55:06 UTC to 2025-04-09 05:06:59 UTC.

024682016-01-01 00:00:00 UTC to 2017-01-01 00:00:00 UTC (exclusive): 8 mentions; 7 submissions, 1 comments20162017-01-01 00:00:00 UTC to 2018-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2018-01-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 1 mentions; 1 submissions, 0 comments2020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 3 mentions; 1 submissions, 2 comments20202021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 7 mentions; 0 submissions, 7 comments2022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 2 mentions; 1 submissions, 1 comments2023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 6 mentions; 2 submissions, 4 comments2024-01-01 00:00:00 UTC to 2025-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments2025-01-01 00:00:00 UTC to 2026-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2025

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20162016-01-01 00:00:00 UTC2017-01-01 00:00:00 UTC871
20172017-01-01 00:00:00 UTC2018-01-01 00:00:00 UTC000
20182018-01-01 00:00:00 UTC2019-01-01 00:00:00 UTC000
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC110
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC312
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC707
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC211
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC624
20242024-01-01 00:00:00 UTC2025-01-01 00:00:00 UTC202
20252025-01-01 00:00:00 UTC2026-01-01 00:00:00 UTC101

What Hacker News says

7 sources
Some other shell script check and formatting tools: All shells take the -n option to perform a basic syntax check. Debian has a script for checking scripts for bashisms: https://manpages.debian.org/checkbashisms bashate is a automated style checker for bash (similar to pep8 for python): https://opendev.org/openstack/bashate lintshell is an early prototype of a shell linter based on the Morbig trustworthy static parser for POSIX shell, based on the Why3 platform for deductive program verification. https://www.irif.fr/~treinen/colis/ https://github.com/colis-anr/morbig https://github.com/colis-anr/lintshell Shellharden helps rewrite scripts for ShellCheck compliance: https://github.com/anordal/shellharden/ shfmt is gofmt for shell: https://github.com/mvdan/sh ShellScriptFormatter is another formatter: https://github.com/osalvador/ShellScrip
Read the rest
tFormatter Some of these tools and other tools can be automatically run by check-all-the-things: https://github.com/collab-qa/check-all-the-things/
In ShellCheck: Finds bugs in your shell scripts
This is really cool and having spoken with the lead dev, Kenneth, I trust that this will continue to be well supported. This is built on tree-sitter, but there are a couple of other interesting shell parser projects: * https://github.com/mvdan/sh * https://github.com/koalaman/shellcheck At Fig (https://withfig.com), we had to write a bash parser from scratch. These projects all work well in the IDE context, but in a repl environment (ie when typing in your terminal) they don't support incomplete commands very well. e.g if I type `echo "$(` the above parsers will break as the double quote and parentheses are not closed.
In Bash-LSP: A language server for Bash
Some other shell script check and formatting tools: All shells take the -n option to perform a basic syntax check. Debian has a script for checking scripts for bashisms: https://manpages.debian.org/checkbashisms bashate is a automated style checker for bash (similar to pep8 for python): https://opendev.org/openstack/bashate lintshell is an early prototype of a shell linter based on the Morbig trustworthy static parser for POSIX shell, based on the Why3 platform for deductive program verification. https://www.irif.fr/~treinen/colis/ https://github.com/colis-anr/morbig https://github.com/colis-anr/lintshell Shellharden helps rewrite scripts for ShellCheck compliance: https://github.com/anordal/shellharden/ shfmt is gofmt for shell: https://github.com/mvdan/sh ShellScriptFormatter is another formatter: https://github.com/osalvador/ShellScrip
Read the rest
tFormatter Some of these tools and other tools can be automatically run by check-all-the-things: https://github.com/collab-qa/check-all-the-things/
In ShellCheck: A static analysis tool for shell scripts
acdha·Mar 18, 2021Recommendation phrase
This is one of my favorite tips for almost effortlessly improving devops productivity (along with using https://github.com/mvdan/sh for auto-formatting) — by now shellcheck has good editor support in e.g. VSCode and I have a standard pre-commit.com hook for all of my projects. I've seen so many long iterations where people flail at a complex shell script for something like a cron job which was immediately flagged by shellcheck. I generally recommend rewriting in Python but this is a good less invasive step. One thing which might be worth considering is adding this to your personal ~/.shellcheckrc to make it more pedantic: enable=all
In ShellCheck: A static analysis tool for shell scripts

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.