Available in
Marketplaces, most starred first
Tags
Add to README
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
By TheBushidoCollectivev1.2.0Apache-2.0In 1 marketplace
Checks shell scripts for formatting drift after edits and when Claude finishes, listing files shfmt would change. Hooks run on their own, and shfmt must already be installed in your PATH.
Trending plugins
7-day copy clicks
Claude loads one when your task matches it, or you run it by name.
1 caution to review before installing
A hook runs when Claude writes or edits files
Static checks of hooks, mods, MCP servers and commands. Not a security audit.
1 marketplace, most starred first
shell-scripting, shfmt, shell-formatter, code-formatting, shell-validation, pre-commit, format-check, shell ·
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Validation and quality enforcement for shell scripts using shfmt, the shell parser, formatter, and interpreter.
shfmt -d on shell scripts to check formatting consistency--cached flag)This plugin provides the following skills:
han plugin install shfmt
Once installed, this plugin automatically validates your shell script formatting:
Check formatting manually:
# Show diff of what would change
shfmt -d .
# List files that need formatting
shfmt -l .
# Format files in place
shfmt -w .
Create a .shfmt.toml or shfmt.toml file in your project root:
# Shell dialect (posix, bash, mksh, bats)
shell = "bash"
# Indent with spaces (0 for tabs)
indent = 2
# Binary operators at start of line
binary-next-line = true
# Switch cases indented
switch-case-indent = true
Or use EditorConfig in .editorconfig:
[*.sh]
indent_style = space
indent_size = 2
shell_variant = bash
binary_next_line = true
switch_case_indent = true
.sh or .bash extensionsmacOS:
brew install shfmt
Ubuntu/Debian:
snap install shfmt
Go install:
go install mvdan.cc/sh/v3/cmd/shfmt@latest
Binary releases:
Download from GitHub releases.
| Command | Description |
|---|---|
shfmt -d . | Show diff of changes (validation) |
shfmt -l . | List files needing formatting |
shfmt -w . | Write formatted files in place |
shfmt -i 2 | Use 2-space indentation |
shfmt -ci | Indent switch cases |
shfmt -bn | Binary ops on next line |
shfmt -ln bash | Force bash dialect |
shfmt supports multiple shell dialects:
| Dialect | Description | Shebang |
|---|---|---|
posix | POSIX shell | #!/bin/sh |
bash | Bash | #!/bin/bash or #!/usr/bin/env bash |
mksh | MirBSD Korn Shell | #!/bin/mksh |
bats | Bash Automated Testing | #!/usr/bin/env bats |
Create a han-config.json in directories where you want to customize behavior:
{
"hooks": {
"shfmt": {
"format": {
"enabled": false
}
}
}
}
Or override the command:
{
"hooks": {
"shfmt": {
"format": {
"command": "shfmt -d -i 4 ."
}
}
}
}
name: Shell Format Check
on: [push, pull_request]
jobs:
shfmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install shfmt
run: |
curl -sS https://webinstall.dev/shfmt | bash
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Check formatting
run: shfmt -d .
# .pre-commit-config.yaml
repos:
- repo: https://github.com/scop/pre-commit-shfmt
rev: v3.8.0-1
hooks:
- id: shfmt
| Tool | Purpose | Focus |
|---|---|---|
| shfmt | Formatter | Code style, consistency |
| ShellCheck | Linter | Bugs, pitfalls, best practices |
Both tools complement each other. Use ShellCheck for catching bugs and shfmt for consistent formatting.
7-day copy clicks
npx claudepluginhub thebushidocollective/han --plugin shfmtBuilt from public signals: copy clicks on this site, GitHub stars and activity, the README and the manifest. Not a security audit or an endorsement.
Plugins from other owners that cover similar ground