Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
R

rustywind

> 前端框架
Open source

CLI for organizing Tailwind CSS classes

622 stars0 likes2 views
WebsiteGitHub

About

CLI for organizing Tailwind CSS classes

RustyWind

Install

Available via npm

yarn global add rustywind

or

npm install -g rustywind

or

Install from homebrew (mac and linux):

brew install avencera/tap/rustywind

or

Install from crates.io:

cargo install rustywind

or

cargo binstall rustywind

or

Install from a github release:

curl -LSfs https://avencera.github.io/rustywind/install.sh | sh -s -- --git avencera/rustywind

or

Download a release directly from github: github.com/avencera/rustywind/releases

or

You can use the dockerized version

docker run --rm -v $PWD:/app avencera/rustywind:latest

Usage

Run rustywind with a path to output updated file contents to the terminal:

  • rustywind .

If you want to reorganize all classes in place, and change the files run with the --write flag

  • rustywind --write .

Run rustywind with a path and the --dry-run to get a list of files that will be changed:

  • rustywind --dry-run .

Run rustywind on your STDIN:

  • echo "" | rustywind --stdin

RustyWind infers template syntax from file extensions. Override it when a file uses a different language:

  • rustywind --language svelte Component.html

Provide a filename when sorting standard input so RustyWind can infer its template syntax:

  • cat Component.svelte | rustywind --stdin --stdin-filename Component.svelte

Supported language profiles are HTML, JSX/TSX, Svelte, Astro, Django, Jinja, Twig, Liquid, Handlebars, ERB, EJS, PHP, Blade, Lit, and Ruby. JSX and TSX program text, comments, and dynamic attributes are preserved while directly quoted class and className attributes are sorted. Astro frontmatter, expressions, dynamic class attributes, and class:list directives are preserved while static quoted class attributes are sorted. Files with unrecognized extensions use conservative legacy-compatible extraction: simple static class attributes are sorted, while template-looking attributes remain unchanged. Because a plain .html extension does not identify its template engine, attributes with template syntax are left unchanged unless a profile such as --language django is selected.

Run in CI, exit with error if unsorted classes are found:

  • rustywind --check-formatted .

Add --json to any of these modes to print a single machine-readable JSON document instead of the human output:

  • rustywind --check-formatted --json .
  • rustywind --dry-run --json .
  • rustywind --write --json .
  • echo "" | rustywind --stdin --json

Bare rustywind --json . behaves like --dry-run --json and never writes files. Unlike the human dry run, dry-run JSON includes the full formatted content of every file that would change under proposed_changes, so automation can apply the result without a second run. Each document reports ok (formatting is clean and nothing failed; for --write, every write succeeded) and an errors array of {path, message} entries for unreadable files or failed directory walks. The exit code is 1 when --check-formatted finds unformatted files, and in every JSON mode when errors is non-empty; dry-run and stdin JSON still exit 0 when changes are merely proposed.

Run RustyWind with a custom sorter. The config_file.json should have a top level entry of sortOrder which is an array with the classes listed in the order you want them sorted.

  • rustywind --config-file config_file.json

Use with tailwind prettier plugin

  • rustywind --output-css-file

  • rustywind --vite-css

…

What

Inspired by Ryan Heybourn's headwind vscode plugin. This is a CLI tool that will look through your project and sort all Tailwind CSS classes.

It will also delete any duplicate classes it finds.

Release

See RELEASE.md for release directions.

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Rustclitailwind-csstailwindcss

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category前端框架
PricingOpen source

> Related tools

R
React
用于构建用户界面的 JavaScript 库
V
Vue.js
渐进式 JavaScript 框架
N
Next.js
基于 React 的全栈 Web 框架