Home

Awesome

mdsf

Format markdown code snippets using your favorite code formatters.

<a href="https://crates.io/crates/mdsf"><img src="https://img.shields.io/crates/v/mdsf.svg"></a> <a href="https://github.com/hougesen/mdsf/actions/workflows/validate.yml"><img src="https://github.com/hougesen/mdsf/actions/workflows/validate.yml/badge.svg"></a>

<!-- <a href="https://codecov.io/gh/hougesen/mdsf"><img src="https://codecov.io/gh/hougesen/mdsf/branch/main/graph/badge.svg"/></a> -->

Table of contents

<!-- START_SECTION:toc --> <!-- END_SECTION:toc -->

Installation

The latest version of mdsf can be downloaded directly from github.com/hougesen/mdsf/releases.

Linux & MacOS

curl --proto '=https' --tlsv1.2 -LsSf https://github.com/hougesen/mdsf/releases/latest/download/mdsf-installer.sh | sh

Windows

powershell -ExecutionPolicy ByPass -c "irm https://github.com/hougesen/mdsf/releases/latest/download/mdsf-installer.ps1 | iex"

Cargo

Install using the published crate:

cargo install mdsf --locked

or directly from source:

git clone git@github.com:hougesen/mdsf.git

cargo install --path ./mdsf --bin mdsf

If you do not have Cargo installed, you need to install it first.

npm/npx

You can install mdsf using npm:

npm install -g mdsf-cli

mdsf format .

or run it directly using npx:

npx mdsf-cli format .

Homebrew

brew install hougesen/tap/mdsf

Usage

<!-- START_SECTION:base-command-help -->
mdsf 0.3.2-dev
Format markdown code snippets using your favorite code formatters
Mads Hougesen <mads@mhouge.dk>

Usage: mdsf <COMMAND>

Commands:
  format       Run formatters on input files
  verify       Verify files are formatted
  init         Create a new mdsf config
  completions  Generate shell completion
  cache-prune  Remove old caches
  help         Print this message or the help of the given subcommand(s)

Options:
  -h, --help     Print help
  -V, --version  Print version
<!-- END_SECTION:base-command-help -->

Formatting code

mdsf format file.md
<!-- START_SECTION:format-command-help -->
Run formatters on input files

Usage: mdsf format [OPTIONS] [INPUT]...

Arguments:
  [INPUT]...  Path to files and/or directories

Options:
      --config <CONFIG>        Path to config
      --debug                  Log stdout and stderr of formatters
      --log-level <LOG_LEVEL>  [possible values: trace, debug, info, warn, error, off]
      --threads <THREADS>      Amount of threads to use. Defaults to 0 (auto)
      --cache                  Only format changed codeblocks
  -h, --help                   Print help
  -V, --version                Print version
<!-- END_SECTION:format-command-help -->

Verifying code

mdsf verify docs/
<!-- START_SECTION:verify-command-help -->
Verify files are formatted

Usage: mdsf verify [OPTIONS] [INPUT]...

Arguments:
  [INPUT]...  Path to files and/or directories

Options:
      --config <CONFIG>        Path to config
      --debug                  Log stdout and stderr of formatters
      --log-level <LOG_LEVEL>  [possible values: trace, debug, info, warn, error, off]
      --threads <THREADS>      Amount of threads to use. Defaults to 0 (auto)
  -h, --help                   Print help
  -V, --version                Print version
<!-- END_SECTION:verify-command-help -->

Configuration

The default configuration of mdsf aims to as sane as possible. For that reason the default formatter for each language is the one most people have installed.

If you are interested in customizing which formatter is run, you can create a new mdsf configuration file by running

mdsf init

mdsf supports running multiple formatters on the save code snippet.

{
  "languages": {
    // Only run `ruff` on Python snippets,
    "python": "ruff:format",
    // Run `usort` on file and then `black`
    "python": ["usort", "black"],
    // Run `usort`, if that fails run `isort`, finally run `black`
    "python": [["usort", "isort"], "black"],

    // Formatters listed under "*" will be run on any snippet.
    "*": ["typos"],

    // Formatters listed under "_" will only be run when there is not formatter configured for the file type OR globally ("*").
    "_": "prettier"
  }
}

Tools

[!NOTE] mdsf is not a package manager.

Only tools that are already installed will be used.

<!-- START_SECTION:supported-tools -->

mdsf currently supports 209 tools. Feel free to open an issue/pull-request if your favorite tool/command is missing! πŸ˜ƒ

NameDescriptionCategoriesLanguages
alejandraThe Uncompromising Nix Code Formatterformatternix
amebaA static code analysis tool for Crystallintercrystal
asmfmtGo Assembler Formatterformattergo
astyleA Free, Fast, and Small Automatic Formatter for C, C++, C++/CLI, Objective-C, C#, and Java Source Codeformatterc#, c++, c, java, objective-c
auto-optionalAdds the Optional type-hint to arguments where the default value is Noneformatterpython
autocorrectA linter and formatter to help you to improve copywriting, correct spaces, words, and punctuations between CJK (Chinese, Japanese, Korean)autocorrection
autoflakeRemoves unused imports and unused variables as reported by pyflakeslinterpython
autopep8A tool that automatically formats Python code to conform to the PEP 8 style guidformatterpython
beancount-blackOpinionated code formatter, just like Python's black code formatter but for Beancountformatterbeancount
beautyshA Bash beautifier for the massesformatterbash, shell
bibtex-tidyCleaner and Formatter for BibTeX filesformatterbibtex
bicepBicep is a declarative language for describing and deploying Azure resourcesformatterbicep
biomeOne toolchain for your web projectformatter, linterjavascript, json, typescript, vue
blackThe uncompromising Python code formatterformatterpython
blade-formatterAn opinionated blade template formatter for Laravel that respects readabilityformatterblade, laravel, php
blueThe slightly less uncompromising Python code formatterformatterpython
bpfmtA formatter for Blueprint filesformatterblueprint
brittanyA Haskell source code formatterformatterhaskell
brunetteA best practice Python code formatterformatterpython
bsfmtA code formatter for BrightScript and BrighterScriptformatterbrighterscript, brightscript
bslintA linter for BrightScript and BrighterScriptlinterbrightscript, brightscripter
bufThe best way of working with Protocol Buffersformatterprotobuf
buildifierA bazel BUILD file formatter andformatterbazel
cabal-fmtAn experiment of formatting .cabal filesformattercabal
cabal-prettifyPrettify your Cabal package configuration filesformattercabal
cabalCabal is a system for building and packaging Haskell libraries and programsformattercabal
caddyFormats or prettifies a Caddyfileformattercaddy
caramelFormatter for the Caramel programming languageformattercaramel
clang-formatA tool to format C/C++/Java/JavaScript/JSON/Objective-C/Protobuf/C# codeformatterc#, c++, c, java, javascript, json, objective-c, protobuf
clang-tidyclang-tidy is a clang-based C++ β€œlinter” toollinterc++
cljfmtA tool for formatting Clojure codeformatterclojure
cljstyleA tool for formatting Clojure codeformatterclojure
codespellCheck code for common misspellingsautocorrection
crlfmtFormatter for CockroachDB's additions to the Go style guideformattergo
crystalTools for the Crystal programming languageformattercrystal
csharpierAn Opinionated Code Formatter for C#formatterc#
css-beautifyA css formatterformattercss
csscombCSS coding style formatterformattercss
d2Formatter for the d2 languageformatterd2
dartFormatter and linter for Dartformatter, linterdart, flutter
dcmCode Quality Tool for Flutter Developersformatter, linterdart, flutter
denoFormatter and linter for JavaScript and TypeScriptformatter, linterjavascript, json, typescript
dfmtDfmt is a formatter for D source codeformatterd
dhallFormat Dhall filesformatterdhall
djadeA Django template formatterformatterdjango, python
djlintLint & Format HTML Templatesformatter, linterhandlebars, html, jinja, mustache, nunjucks, twig
docformatterFormats docstrings to follow PEP 257formatterpython
dockfmtDockerfile format and parser. Like gofmt but for Dockerfilesformatterdocker
docstrfmtA formatter for Sphinx flavored reStructuredTextformatterSphinx, python, reStructuredText
doctocGenerates table of contents for markdown filesformattermarkdown
dotenv-linterLightning-fast linter for .env fileslinterenv
dprintA pluggable and configurable code formatting platform written in Rustformatter
easy-coding-standardThe Easiest way to add coding standard to your PHP projectformatter, linterphp
efmtErlang code formatterformattererlang
elm-formatelm-format formats Elm source code according to a standard set of rules based on the official Elm Style Guideformatterelm
erb-formatterFormat ERB files with speed and precisionformattererb, ruby
erlfmtAn automated code formatter for Erlangformattererlang
eslintFind and fix problems in your JavaScript codelinterjavascript, typescript
fantomasFSharp source code formatterformatterfsharp
fish_indentFish indenter and prettifierformatterfish
fixjsonJSON Fixer for Humans using (relaxed) JSON5formatter, linterjson5, json
floskellFloskell is a flexible Haskell source code pretty printerformatterhaskell
fnlfmtA formatter for Fennel codeformatterfennel
forgeA Solidity formatterformattersolidity
fourmoluA formatter for Haskell source codeformatterhaskell
fprettifyAuto-formatter for modern Fortran source codeformatterfortran
gciGCI, a tool that control golang package import order and make it always deterministicformattergo
gdformatGDScript linterformattergdscript
gersemiA formatter to make your CMake code the real treasureformattercmake
gleamFormat Gleam source codeformattergleam
gluonCode formatting for the gluon programming languageformattergluon
gofmtGofmt formats Go programsformattergo
gofumptA stricter gofmtformattergo
goimports-reviserRight imports sorting & code formatting tool (goimports alternative)formattergo
goimportsgoimports updates your Go import lines, adding missing ones and removing unreferenced onesformattergo
golinesA golang formatter that fixes long linesformattergo
google-java-formatReformats Java source code to comply with Google Java Styleformatterjava
grainCode formatter for the Grain programming languageformattergrain
haml-lintTool for writing clean and consistent HAMLlinterhaml
hfmtFormat Haskell programs. Inspired by the gofmt utilityformatterhaskell
hindentExtensible Haskell pretty printerformatterhaskell
hlintHaskell source code suggestionslinterhaskell
html-beautifyA html formatterformatterhtml
htmlbeautifierA normaliser/beautifier for HTML that also understands embedded Ruby. Ideal for tidying up Rails templatesformattererb, html, ruby
imbaA formatter for Imbaformatterimba
isortA Python utility to sort importsformatterpython
jokerSmall Clojure interpreter, linter and formatterformatter, linterclojure
js-beautifyA JavaScript formatterformatterjavascript
json5formatJSON5 (a.k.a., "JSON for Humans") formatter that preserves contextual commentsformatterjson5, json
jsonaJSONA linter and formatterformatter, linterjsona
jsonlintA JSON parser and validator with a CLIformatter, linterjson
jsonnetfmtFormatter for automatically fixing jsonnet stylistic problemsformatterjsonnet
juliaformatter.jlAn opinionated code formatter for Julia. Plot twist - the opinion is your ownformatterjulia
justA formatter for justfilesformatterjust
kclKCL Format tool supports reformatting KCL files to the standard code styleformatterkcl
kdlfmtA formatter for kdl documentsformatterkdl
kdoc-formatterReformats Kotlin KDoc comments, reflowing text and other cleanupformatterkotlin
ktfmtprogram that reformats Kotlin source code to comply with the common community standard for Kotlin code conventionsformatterkotlin
ktlintAn anti-bikeshedding Kotlin linter with built-in formatterlinterkotlin
kulala-fmtAn opinionated πŸ¦„ .http and .rest 🐼 files linter πŸ’„ and formatter ⚑.formatterhttp
leptosfmtA formatter for the leptos view! macroformatterrust
liquidsoap-prettierPrettier plugin for liquidsoap scriptformatterliquidsoap
luaformatterCode formatter for Luaformatterlua
markdownfmtLike gofmt, but for Markdownformattermarkdown
markdownlint-cli2A fast, flexible, configuration-based command-line interface for linting Markdown/CommonMark files with the markdownlint librarylintermarkdown
markdownlintA Node.js style checker and lint tool for Markdown/CommonMark fileslintermarkdown
markuplintAn HTML linter for all markup developerslinterhtml
mdformatCommonMark compliant Markdown formatterformattermarkdwon
mdslwPrepare your markdown for easy diff'ing!formattermarkdown
misspellCorrect commonly misspelled English words in source filesautocorrection
mixCode formatter for Elixirformatterelixir
mojoFormats Mojo source filesformattermojo
nginxbeautifierFormat and beautify nginx config filesformatternginx
nickelBetter configuration for lessformatternickel
nimprettyCode formatter for the Nim programming languageformatternim
nixfmtThe official (but not yet stable) formatter for Nix codeformatternix
nixpkgs-fmtNix code formatter for nixpkgsformatternix
nphAn opinionated code formatter for Nimformatternim
npm-groovy-lintLint, format and auto-fix your Groovy / Jenkinsfile / Gradle filesformatter, lintergroovy
ocamlformatAuto-formatter for OCaml codeformatterocaml
ocp-indentIndentation tool for OCamlformatterocaml
opaFormat Rego source filesformatterrego
ormoluA formatter for Haskell source codeformatterhaskell
oxlintOxlint is designed to catch erroneous or useless code without requiring any configurations by defaultlinterjavascript, typescript
packerPacker is used to format HCL2 configuration filesformatterhcl
perltidyPerl::Tidy, a source code formatter for Perlformatterperl
pg_formatA PostgreSQL SQL syntax beautifierformattersql
php-cs-fixerA tool to automatically fix PHP Coding Standards issuesformatter, linterphp
phpcbfPHP Code Beautifier and Fixer fixes violations of a defined coding standardformatterphp
phpinsightsInstant PHP quality checks from your consolelinterphp
pintLaravel Pint is an opinionated PHP code style fixer for minimalistsformatter, linterphp
prettierPrettier is an opinionated code formatterformattercss, html, javascript, json, typescript
pretty-phpThe opinionated PHP code formatterformatterphp
prettypstFormatter for Typstformattertypst
prismaCommands for interacting with the prisma ORMformatterprisma
protolintA pluggable linter and fixer to enforce Protocol Buffer style and conventionslinterprotobuf
ptopFree Pascal source formatterformatterpascal
puppet-lintCheck that your Puppet manifests conform to the style guidelinterpuppet
purs-tidyPureScript code formatterformatterpurescript
purtyPureScript pretty-printerformatterpurescript
pyclnA formatter for finding and removing unused import statementsformatterpython
pyinkPyink is a Python formatter, forked from Black with a few different formatting behaviorsformatterpython
pymentFormat and convert Python docstrings and generates patchesformatterpython
qmlfmtqmlfmt - command line application that formats QML filesformatterqml
racoAn extensible code formatter for Racketformatterracket
refmtrefmt stands by Reason Formatter and it formats Reason programs, is a parser and pretty-printer for Reasonformatterreason
reformat-gherkinReformat-gherkin automatically formats Gherkin filesformattergherkin
reorder-python-importsRewrites source to reorder python importsformatterpython
rescriptFormatter for ReScriptformatterrescript
rocTools for the roc programming languageformatterroc
rstfmtA formatter for reStructuredTextformatterrestructuredtext
rubocopA Ruby static code analyzer and formatter, based on the community Ruby style guideformatter, linterruby
rubyfmtRuby Autoformatterformatterruby
ruffAn extremely fast Python linter and code formatter, written in Rustformatter, linterpython
rufoThe Ruby Formatterformatterruby
runeTools for the Rune programming languageformatterrune
rustfmtThe official code formatter for Rustformatterrust
rustywindCLI for organizing Tailwind CSS classesformatterhtml
scalafmtCode formatter for Scalaformatterscala
scalariformScala source code formatterformatterscala
shellhardenThe corrective bash syntax highlighterlinterbash, shell
shfmtShell script formatterformattershell
sleekSleek is a CLI tool for formatting SQL. It helps you maintain a consistent style across your SQL code, enhancing readability and productivityformattersql
smlfmtA custom parser/auto-formatter for Standard MLformatterstandard-ml
snakefmtThe uncompromising Snakemake code formatterformattersnakemake
sql-formatterA whitespace formatter for different query languagesformattersql
sqlfluffA modular SQL linter and auto-formatter with support for multiple dialects and templated codeformatter, lintersql
sqlfmtsqlfmt formats your dbt SQL files so you don't have toformattersql
sqruffFast SQL formatter/linterformatter, lintersql
standardjsJavaScript style guide, linter, and formatterformatter, linterjavascript
standardrbRuby's bikeshed-proof linter and formatterformatter, linterruby
stylefmtstylefmt is a tool that automatically formats stylesheetsformattercss, scss
stylelintA mighty CSS linter that helps you avoid errors and enforce conventionslintercss, scss
stylish-haskellHaskell code prettifierformatterhaskell
styluaAn opinionated Lua code formatterformatterlua
superhtmlHTML Language Server & Templating Language Libraryformatterhtml
swift-formatFormatting technology for Swift source codeformatterswift
swiftformatA command-line tool and Xcode Extension for formatting Swift codeformatterswift
taploA TOML toolkit written in Rustformattertoml
templTooling for the Templ template languageformattergo, templ
terraformThe terraform fmt command is used to rewrite Terraform configuration files to a canonical format and styleformatterterraform
terragruntRecursively find hcl files and rewrite them into a canonical formatformatterhcl
tlintTighten linter for Laravel conventionslinterphp
tofuThe tofu fmt command is used to rewrite OpenTofu configuration files to a canonical format and styleformatterterraform, tofu
topiaryTopiary aims to be a uniform formatter for simple languages, as part of the Tree-sitter ecosystemformatter
ts-standardTypescript style guide, linter, and formatter using StandardJSformatter, lintertypescript
tsqllintConfigurable linting for TSQLlintersql
twig-cs-fixerA tool to automatically fix Twig Coding Standards issuesformatter, lintertwig
typosSource code spell checkerautocorrection
typstfmtBasic formatter for the Typst languageformattertypst
typstyleBeautiful and reliable typst code formatterformattertypst
ufmtSafe, atomic formatting with black and usortformatterpython
uiuaA stack-based array programming languageformatteruiua
unimportThe ultimate linter and formatter for removing unused import statements in your codeformatterpython
usortSafe, minimal import sorting for Python projectsformatterpython
vTooling for V langformatterv
verylVeryl: A Modern Hardware Description Languageformatterveryl
vhdl-style-guideStyle guide enforcement for VHDLformattervhdl
wfindentIndents and optionally converts Fortran program sourcesformatterfortran
xmlformatFormat and compress XML documentsformatterxml
xmllintXML linterlinterxml
xoJavaScript/TypeScript linter (ESLint wrapper) with great defaultslinterjavascript, typescript
yamlfixA simple opinionated yaml formatter that keeps your commentsformatteryaml
yamlfmtAn extensible command line tool or library to format yaml filesformatteryaml
yapfA formatter for Python filesformatterpython
yew-fmtCode formatter for the Yew frameworkformatterrust
zigReformat Zig source into canonical formformatterzig
ziggyFormats Ziggy documents and Ziggy schemasformatterziggy
zprintExecutables, uberjar, and library to beautifully format Clojure and Clojurescript source code and s-expressionsformatterclojure, clojurescript
<!-- END_SECTION:supported-tools -->

Commands

<!-- START_SECTION:supported-commands -->

mdsf currently supports 216 commands. Feel free to open an issue/pull-request if your favorite tool is missing! πŸ˜ƒ

NameCommand
alejandraalejandra --quiet $PATH
amebaameba --fix $PATH
asmfmtasmfmt -w $PATH
astyleastyle --quiet $PATH
auto-optionalauto-optional $PATH
autocorrectautocorrect --fix $PATH
autoflakeautoflake --quiet --in-place $PATH
autopep8autopep8 --in-place $PATH
beancount-blackbean-black $PATH
beautyshbeautysh $PATH
bibtex-tidybibtex-tidy -m $PATH
bicep:formatbicep format $PATH
biome:checkbiome check --write $PATH
biome:formatbiome format --write $PATH
biome:lintbiome lint --write $PATH
blackblack --quiet $PATH
blade-formatterblade-formatter --write $PATH
blueblue --quiet $PATH
bpfmtbpfmt -w $PATH
brittanybrittany --write-mode=inplace $PATH
brunettebrunette --quiet $PATH
bsfmtbsfmt $PATH --write
bslintbslint --fix $PATH
buf:formatbuf format --write $PATH
buildifierbuildifier $PATH
cabal-fmtcabal-fmt --inplace $PATH
cabal-prettifycabal-prettify $PATH
cabal:formatcabal format $PATH
caddy:fmtcaddy fmt $PATH -w
caramel:fmtcaramel fmt $PATH
clang-formatclang-format -i $PATH
clang-tidyclang-tidy --fix $PATH
cljfmt:fixcljfmt fix $PATH
cljstylecljstyle fix $PATH
codespellcodespell $PATH --check-hidden --write-changes
crlfmtcrlfmt -w $PATH
crystal:formatcrystal tool format $PATH
csharpierdotnet csharpier $PATH
css-beautifycss-beautify -r --type css -f $PATH
csscombcsscomb -t $PATH
d2:fmtd2 fmt $PATH
dart:fixdart fix --apply $PATH
dart:formatdart format $PATH
dcm:fixdcm fix $PATH
dcm:formatdcm format $PATH
deno:fmtdeno fmt --quiet $PATH
deno:lintdeno lint --fix $PATH
dfmtdfmt -i $PATH
dhalldhall format $PATH
djadedjade $PATH
djlintdjlint $PATH --reformat
docformatterdocformatter --in-place $PATH
dockfmtdockfmt fmt -w $PATH
docstrfmtdocstrfmt $PATH
doctocdoctoc $PATH
dotenv-linter:fixdotenv-linter fix $PATH
dprint:fmtdprint fmt $PATH
easy-coding-standardecs check $PATH --fix --no-interaction
efmtefmt -w $PATH
elm-formatelm-format --elm-version=0.19 --yes $PATH
erb-formattererb-format $PATH --write
erlfmterlfmt -w $PATH_STRING
eslinteslint --fix $PATH
fantomasfantomas $PATH
fish_indentfish_indent -w $PATH
fixjsonfixjson -w $PATH
floskellfloskell $PATH
fnlfmtfnlfmt $PATH
forge:fmtforge fmt $PATH
fourmolufourmolu -i $PATH
fprettifyfprettify $PATH
gcigci write --skip-generated --skip-vender $PATH
gdformatgdformat $PATH
gersemigersemi -i -q $PATH
gleam:formatgleam format $PATH
gluon:fmtgluon fmt $PATH
gofmtgofmt -w $PATH
gofumptgofumpt -w $PATH
goimports-revisergoimports-reviser -format $PATH
goimportsgoimports -w $PATH
golinesgolines -w $PATH
google-java-formatgoogle-java-format -i $PATH
grain:formatgrain format $PATH -o $PATH
haml-linthaml-lint --auto-correct $PATH
hfmthfmt -w $PATH
hindenthindent $PATH
hlinthlint --refactor -i $PATH
html-beautifyhtml-beautify -r --type html -f $PATH
htmlbeautifierhtmlbeautifier $PATH
imba:fmtimba fmt -f $PATH
isortisort --quiet $PATH
jokerjoker --format --write $PATH
js-beautifyjs-beautify -r --type js -f $PATH
json5formatjson5format -r $PATH
jsona:formatjsona format $PATH
jsona:lintjsona lint $PATH
jsonlintjsonlint -i $PATH
jsonnetfmtjsonnetfmt -i $PATH
juliaformatter.jljulia -E using JuliaFormatter;format_file(\"{$PATH_STRING}\")
justjust --fmt --unstable --justfile $PATH
kcl:fmtkcl fmt $PATH
kdlfmtkdlfmt format $PATH
kdoc-formatterkdoc-formatter --quiet $PATH
ktfmtktfmt --format --log-level=error $PATH
ktlintktlint --format --log-level=error $PATH
kulala-fmtkulala-fmt $PATH
leptosfmtleptosfmt --quiet $PATH
liquidsoap-prettierliquidsoap-prettier --write $PATH
luaformatterlua-format -i $PATH
markdownfmtmarkdownfmt -w $PATH
markdownlint-cli2markdownlint-cli2 --fix $PATH
markdownlintmarkdownlint --fix $PATH
markuplintmarkuplint --fix $PATH
mdformatmdformat $PATH
mdslwmdslw $PATH
misspellmisspell -w $PATH
mix:formatmix format $PATH
mojo:formatmojo format -q $PATH
nginxbeautifiernginxbeautifier $PATH
nickel:formatnickel format $PATH
nimprettynimpretty $PATH
nixfmtnixfmt $PATH
nixpkgs-fmtnixpkgs-fmt $PATH
nphnph $PATH
npm-groovy-lintnpm-groovy-lint --format $PATH
ocamlformatocamlformat --ignore-invalid-option --inplace --enable-outside-detected-project $PATH
ocp-indentocp-indent --inplace $PATH
opa:fmtopa fmt $PATH -w
ormoluormolu --mode inplace $PATH
oxlintoxlint --fix $PATH
packer:fmtpacker fmt $PATH
perltidyperltidy -b $PATH
pg_formatpg_format --inplace $PATH
php-cs-fixer:fixphp-cs-fixer fix $PATH
phpcbfphpcbf $PATH
phpinsights:fixphpinsights fix $PATH --no-interaction --quiet
pintpint $PATH
prettierprettier --embedded-language-formatting off --log-level error --write $PATH
pretty-phppretty-php $PATH
prettypstprettypst $PATH
protolintprotolint lint -fix $PATH
ptopptop $PATH $PATH
puppet-lintpuppet-lint --fix $PATH
purs-tidypurs-tidy format-in-place $PATH
purtypurty --write $PATH
pyclnpycln --no-gitignore --quiet $PATH
pyinkpyink --quiet $PATH
pymentpyment -w $PATH
qmlfmtqmlfmt -w $PATH
raco:fmtraco fmt -i $PATH
refmtrefmt --in-place $PATH
reformat-gherkinreformat-gherkin $PATH
reorder-python-importsreorder-python-imports $PATH
rescript:formatrescript format $PATH
roc:formatroc format $PATH
rstfmtrstfmt $PATH
rubocoprubocop --fix-layout --autocorrect --format quiet $PATH
rubyfmtrubyfmt -i $PATH
ruff:checkruff check --fix --quiet $PATH
ruff:formatruff format --quiet $PATH
ruforufo --simple-exit $PATH
rune:fmtrune fmt $PATH
rustfmtrustfmt --edition 2021 --quiet $PATH
rustywindrustywind --write $PATH
scalafmtscalafmt --quiet --mode any $PATH
scalariformscalariform $PATH
shellhardenshellharden --transform --replace $PATH
shfmtshfmt --write $PATH
sleeksleek $PATH
smlfmtsmlfmt --force $PATH
snakefmtsnakefmt $PATH
sql-formattersql-formatter --fix $PATH
sqlfluff:fixsqlfluff fix --dialect ansi $PATH
sqlfluff:formatsqlfluff format --dialect ansi $PATH
sqlfmtsqlfmt $PATH
sqruffsqruff fix $PATH
standardjsstandard --fix $PATH
standardrbstandardrb --fix $PATH
stylefmtstylefmt $PATH
stylelintstylelint --fix $PATH
stylish-haskellstylish-haskell --inplace $PATH
styluastylua --verify $PATH
superhtml:fmtsuperhtml fmt $PATH
swift-formatswift-format --in-place $PATH
swiftformatswiftformat --quiet $PATH
taplotaplo format $PATH
templ:fmttempl fmt $PATH
terraform:fmtterraform fmt -write=true $PATH
terragrunt:hclfmtterragrunt hclfmt --terragrunt-hclfmt-file $PATH
tlint:formattlint format $PATH
tofu:fmttofu fmt -write=true $PATH
topiarytopiary format $PATH
ts-standardts-standard --fix $PATH
tsqllinttsqllint --fix $PATH
twig-cs-fixer:linttwig-cs-fixer lint $PATH --fix --no-interaction --quiet
typostypos -w --no-ignore --hidden $PATH
typstfmttypstfmt $PATH
typstyletypstyle -i $PATH
ufmtufmt format $PATH
uiua:fmtuiua fmt $PATH
unimportunimport -r $PATH
usortusort format $PATH
v:fmtv fmt -w $PATH
veryl:fmtveryl fmt $PATH
vhdl-style-guidevsg -f $PATH --fix
wfindentwfindent $PATH
xmlformatxmlformat --overwrite $PATH
xmllintxmllint --format $PATH --output $PATH
xoxo --fix $PATH
yamlfixyamlfix $PATH
yamlfmtyamlfmt -quiet $PATH
yapfyapf --in-place $PATH
yew-fmtyew-fmt --edition 2021 --quiet $PATH
zig:fmtzig fmt $PATH
ziggy:fmtziggy fmt $PATH
zprintzprint -w $PATH
<!-- END_SECTION:supported-commands -->

Shell completions

Shell completions can be generated using mdsf completions <SHELL>.

<!-- START_SECTION:completions-command-help -->
Generate shell completion

Usage: mdsf completions <SHELL>

Arguments:
  <SHELL>  [possible values: bash, elvish, fish, powershell, zsh]

Options:
  -h, --help     Print help
  -V, --version  Print version
<!-- END_SECTION:completions-command-help -->

Bash

Add the following to your .bashrc.

eval "$(mdsf completions bash)"

Bash

Add the following to your .zshrc.

eval "$(mdsf completions zsh)"

Fish

Add the following to ~/.config/fish/config.fish.

mdsf completions fish | source

PowerShell

Add the following to your PowerShell configuration (Can be found by running $PROFILE).

Invoke-Expression (&mdsf completions powershell)

Elvish

Add the following to ~/.elvish/rc.elv.

eval (mdsf completions elvish)

Acknowledgement

mdsf was inspired by the amazing neovim formatting plugin conform.nvim.

Alternatives to mdsf