百科.dev
全部条目AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
R

rustywind

> 前端框架
开源

用于组织 Tailwind CSS 类的 CLI

622 stars0 点赞0 次浏览
访问官网GitHub

工具介绍

用于组织 Tailwind CSS 类的 CLI

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 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Rustclitailwind-csstailwindcss

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类前端框架
定价开源

> 相关工具

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