> For AI agents: the complete documentation index is available at /zh/llms.txt, the full documentation bundle is available at /zh/llms-full.txt.

[最新版本 v0.7.5](https://github.com/rstackjs/rstack-cli/releases)

# 统一工具链加速 JavaScript 开发

只需一个 CLI，即可统一所有 JavaScript 项目的开发、构建、测试、代码检查与格式化。由 Rspack 生态驱动。

[开始使用](/zh/guide/quick-start)[GitHub](https://github.com/rstackjs/rstack-cli)

[rs dev](/zh/guide/cli/dev)/[rs build](/zh/guide/cli/build)

## 从开发到构建，快人一步

基于 [Rspack](https://rspack.rs/) 和 [Rsbuild](https://rsbuild.rs/)，快速启动开发服务器，构建企业级 Web 应用

- 构建速度比 webpack [快 5–20 倍](https://github.com/rstackjs/build-tools-performance)
- 全方位优化产物，运行更快
- 开发与生产采用一致的打包流程


````
$ rs build
Rsbuild v2.0.0

info    build started...
ready   built in 0.02s

File (web)                    Size     Gzip
dist/static/js/index.js    0.20 kB  0.18 kB
dist/index.html            0.32 kB  0.24 kB

                   Total:  0.52 kB  0.42 kB
````

[rs lib](/zh/guide/cli/lib)

## 构建你的库，轻松交付

使用 [Rslib](https://rslib.rs/) 构建可复用的 JavaScript 库，满足公共库、命令行工具和组件库的开发需求

- 一份配置，输出 ESM、CJS 和模块联邦等多种格式
- 按需选择 bundle 或 bundleless 输出模式
- 使用 TypeScript 7 快速生成类型声明


````
$ rs lib --dts
Rslib v1.0.0

info    build started...
ready   built in 0.02s
start   generating declaration files...
ready   declaration files generated

File (esm)          Size
dist/index.js    0.04 kB
````

[rs test](/zh/guide/cli/test)

## 更快测试，即时反馈

使用 [Rstest](https://rstest.rs/) 测试 JavaScript 代码，从本地开发到 CI 都能及时获得反馈

- 熟悉的 Jest 风格 API
- 由 Rspack 加速测试，比 Jest 快 20%+
- 自动复用已有构建配置，减少维护成本


````
$ rs test
Rstest v0.11.0

 ✓ src/utils.test.ts (2)
 ✓ src/app.test.ts (1)

 Test Files  2 passed
      Tests  3 passed
   Duration  211ms
````

[rs lint](/zh/guide/cli/lint)/[rs fmt](/zh/guide/cli/fmt)/[rs check](/zh/guide/cli/check)

## 统一规范，更快检查

一个命令完成代码检查、格式校验和类型检查，保持团队规范一致

- 代码检查速度比 ESLint 快 20–40 倍
- 格式化速度比 Prettier 快 5–10 倍
- 兼容 ESLint 和 Prettier 的配置项与插件


````
$ rs check

start   Linting...
success Lint passed in 287ms

start   Checking formatting...
success Format check passed in 25ms (99 files)
````

[rs hooks](/zh/guide/cli/hooks)/[rs staged](/zh/guide/cli/staged)

## 让检查融入每次提交

将代码检查融入 Git 工作流，复用现有 lint-staged 配置，延续熟悉的 Husky 使用方式

- 统一管理仓库级 Git hooks
- 自动检查暂存区文件
- 灵活运行自定义命令


````
$ rs staged

✔ Done backing up original state!
✔ rs lint --fix
✔ rs fmt
✔ Done running tasks for staged files!
✔ Done staging changes from tasks!
✔ Done cleaning up temporary files!
````

[rs doc](/zh/guide/cli/doc)

## 生成 AI 友好的文档站

使用 [Rspress](https://rspress.rs/) 打造美观、AI 友好的静态文档站，让文档与代码一同维护

- 使用 Markdown 和 MDX 编写内容
- 开箱即用的全文搜索与多语言支持
- 自动生成 llms.txt 与 Markdown 文件，供 AI Agent 使用


````
$ rs doc
Rspress v2.0.0

 ➜ Local: http://localhost:3000/
 ➜ Network: use --host to expose

start   build started...
ready   built in 0.18s
````

## 用 Rstack CLI 开启下一个项目

让工具步调一致，将时间留给你想创造的事物

$`pnpm create rstack@latest`

[开始使用](/zh/guide/quick-start)

## 指南

- [快速上手](/zh/guide/quick-start)
- [配置](/zh/guide/configuration)
- [API 参考](/zh/guide/api-reference)
- [IDE 集成](/zh/guide/ide-integration)
- [迁移](/zh/guide/migration)

## 命令

- [rs build](/zh/guide/cli/build)
- [rs lib](/zh/guide/cli/lib)
- [rs test](/zh/guide/cli/test)
- [rs lint](/zh/guide/cli/lint)
- [rs doc](/zh/guide/cli/doc)

## 生态

- [Rsbuild](https://rsbuild.rs/)
- [Rslib](https://rslib.rs/)
- [Rstest](https://rstest.rs/)
- [Rslint](https://rslint.rs/)
- [Rspress](https://rspress.rs/)

## 社区

- [GitHub](https://github.com/rstackjs/rstack-cli)
- [Discord](https://discord.gg/XsaKEEk4mW)
- [Reddit](https://www.reddit.com/r/Rspack/)
- [Bluesky](https://bsky.app/profile/rspack.dev)
- [X](https://x.com/rspack_dev)

© 2026 Rstack contributors · [MIT License](https://github.com/rstackjs/rstack-cli/blob/main/LICENSE)

