HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
koalaman
shellcheck
Haskell2013–2025
koalaman / shellcheck

shellcheck

ShellCheck, a static analysis tool for shell scripts

92Distinct people
100Mentions
5Explicit recommenders
40.3KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

ShellCheck, a static analysis tool for shell scripts

GitHub

Where it is used

  • GitLab — GitLab uses ShellCheck to lint its shell scripts. It also prescribes a GitLab CI/CD job configuration to run it across projects. Source
  • ShellCheck for Visual Studio Code — ShellCheck for Visual Studio Code bundles the ShellCheck tool and uses it to lint shell scripts, showing ShellCheck warnings in the editor and the Problems view. Source

What people are saying

One of my favorite things about Shellcheck is that the error messages come with a link to a wiki page about the problem. Does anyone know other programs that have a similar…

ufo used a recommendation phrase. 5 indexed comments match. 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 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 1:49:46 PM 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 year100 dated mentions

Observed mentions: 2013-11-18 12:25:12 UTC to 2025-12-30 22:10:57 UTC.

0510152013-01-01 00:00:00 UTC to 2014-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments20132014-01-01 00:00:00 UTC to 2015-01-01 00:00:00 UTC (exclusive): 6 mentions; 2 submissions, 4 comments2015-01-01 00:00:00 UTC to 2016-01-01 00:00:00 UTC (exclusive): 2 mentions; 1 submissions, 1 comments2016-01-01 00:00:00 UTC to 2017-01-01 00:00:00 UTC (exclusive): 8 mentions; 2 submissions, 6 comments2017-01-01 00:00:00 UTC to 2018-01-01 00:00:00 UTC (exclusive): 9 mentions; 2 submissions, 7 comments2018-01-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 10 mentions; 1 submissions, 9 comments2019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 6 mentions; 1 submissions, 5 comments20192020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 13 mentions; 1 submissions, 12 comments2021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 13 mentions; 2 submissions, 11 comments2022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 15 mentions; 2 submissions, 13 comments2023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 9 mentions; 0 submissions, 9 comments2024-01-01 00:00:00 UTC to 2025-01-01 00:00:00 UTC (exclusive): 4 mentions; 0 submissions, 4 comments2025-01-01 00:00:00 UTC to 2026-01-01 00:00:00 UTC (exclusive): 3 mentions; 1 submissions, 2 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
20132013-01-01 00:00:00 UTC2014-01-01 00:00:00 UTC202
20142014-01-01 00:00:00 UTC2015-01-01 00:00:00 UTC624
20152015-01-01 00:00:00 UTC2016-01-01 00:00:00 UTC211
20162016-01-01 00:00:00 UTC2017-01-01 00:00:00 UTC826
20172017-01-01 00:00:00 UTC2018-01-01 00:00:00 UTC927
20182018-01-01 00:00:00 UTC2019-01-01 00:00:00 UTC1019
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC615
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC13112
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC13211
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC15213
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC909
20242024-01-01 00:00:00 UTC2025-01-01 00:00:00 UTC404
20252025-01-01 00:00:00 UTC2026-01-01 00:00:00 UTC312

What Hacker News says

100 sources
Assuming using same account, use history command to show past commands[0a, 0b] 'load random example' on shellcheck using own custom examples from history command.[1] ncurse, dialog, zenity[2]. "Gooey: Turn command line programs into GUI applications"[3] Many command line programs were not designed with i/o buffering in mind.[4a,4b] describe what want bashgpt[5] to write/display using aforementioned zenity/Gooey. chatgp shellmaster[6] -------- [6] : http://community.openai.com/t/introducing-chatgpt-shellmaste... [5] : http://github.com/dtegunov/bashgpt [4a] : http://www.gnu.org/software/coreutils/manual/html_node/stdbu... [4b] : http://unix.stackexchange.com/questions/25372/how-to-turn-of... [3] : http://news.ycombinator.com/item?id=8218785 [2] : http//funprojects.blog/2021/01/25/zenity-command-line-dialogs/ [1a] : http://www.shellchec
Read the rest
In Ask HN: Is there a GUI for bash shell?
Shellcheck is great, but requires some investment to tailor to your style Disable default checks or enable optional ones using directives: https://www.shellcheck.net/wiki/Directive The error checks can be pretty arcane: https://github.com/koalaman/shellcheck/wiki/Checks I appreciate that the text for each check is brief and usually includes a suggestion. I end up disabling 26xx's a lot (for unquoted variables to be interpreted as multiple values). Python is probably the best alternative to bash, but Swift is getting surprisingly good. With shwift[1] you get NIO/async APIs, operator overloading for shell-like locutions, and trivial access to existing executables: /// Piping between two executables try await echo("Foo", "Bar") | sed("s/Bar/Baz/") /// Piping to a builtin try await echo("Foo", "Bar") | map { $0.replac
Read the rest
ingOccurrences(of: "Bar", with: "Baz") } Scripts can easily be configured with libraries and run pre-compiled by using clutch[2]. For cross-platform use, be sure only use libraries on all platforms (i.e., not Foundation). It's a pain, but at least the error shows up typically at compile-time instead of run-time. [1] - [shwift](https://github.com/GeorgeLyon/Shwift) [2] - [clutch - any Swift scripts in a common nest](https://github.com/swift-nest/clutch)
In Shellcheck finds bugs in your shell scripts
Directives apply line by line. The only ones that apply to a bigger scope are mandated to be the next line right after shebang and apply to the whole file. https://github.com/koalaman/shellcheck/wiki/Directive > Directives that replace or are immediately after the shebang apply to the entire script. Otherwise, they are scoped to the command that follows it https://github.com/koalaman/shellcheck/wiki/Ignore > Note that the directive must be on the first line after the shebang with versions before 0.4.6. As of 0.4.6 comments and whitespace are allowed before file-wide directives.
In Tell HN: People forget that you can stick any data at the end of a bash script
>The secret sauce is a pseudo-signal provided by bash, called EXIT, that you can trap; commands or functions trapped on it will execute when the script exits for any reason. "Secret Sauce", why is this secret at all. Nothing against the author who's helping the ecosystem here, but is there an authoritative guide on Bash that anyone can recommend? Hopefully something that's portable between Mac & Linux. The web is full of contradictory guides and shellcheck seems to be the last line of defense. - https://github.com/koalaman/shellcheck
In “Exit traps” can make your Bash scripts more robust and reliable (2013)

Showing the 15 most recent of 100 sources. Enable JavaScript to search and browse every indexed mention.

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.