Skip to content

Commit 7a2a447

Browse files
committed
docs: update CLI documentation for clarity and consistency
1 parent 98a3f1c commit 7a2a447

File tree

14 files changed

+106
-56
lines changed

14 files changed

+106
-56
lines changed

docs/cli/api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# api
22

3-
Generate API modules.
3+
Parse OpenAPI/Swagger schema to generate API modules.
44

55
### Usage
66

docs/cli/clean.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# clean
22

3-
Clean up files in the project.
3+
Clean files and directories.
44

55
### Usage
66

docs/cli/commit-lint.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# commit-lint
22

3-
Validate commit messages.
3+
Lint commit messages.
44

55
### Rules
66

docs/cli/hook.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# hook
22

3-
Automatically mount git hooks.
3+
Install git hooks from config.
44

55
### Usage
66

docs/cli/lockfile-check.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# lockfile-check
22

3-
Detect lockfile changes and auto-install dependencies.
3+
Check if lockfile is updated.
44

55
Supported lockfiles:
66

docs/cli/release.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# release
22

3-
Interactive package release.
3+
Publish workspace npm packages and generate changelogs.
44

55
### Usage
66

docs/why-rattail.md

Lines changed: 47 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,49 +2,74 @@
22

33
## The Problem
44

5-
[Vite+](https://viteplus.dev) has done a great job consolidating build, test, lint, and format into one tool. But in day-to-day enterprise development, there are still things you end up wiring yourself:
5+
[Vite+](https://viteplus.dev) has done a great job consolidating build-related work into one tool. But in enterprise development, there are still things you end up wiring yourself:
66

77
- **Release workflow** — version bumping, npm publishing, changelog generation
88
- **Git hooks** — commit message linting, lockfile change detection
99
- **API codegen** — generating type-safe API modules from OpenAPI/Swagger schemas
1010
- **Utility functions** — common helpers for strings, arrays, objects, etc.
1111

12-
Each of these typically requires its own tool, its own config file, and its own learning curve. Over time, project root directories fill up with config fragments, and keeping everything compatible becomes a chore.
12+
## AI Agent Friendly
13+
14+
An increasingly practical concern — AI coding assistants work better when the toolchain is cohesive:
15+
16+
- **Single dependency** — one library to learn, not a dozen tools with different APIs.
17+
- **Unified Skills** — Rattail provides [Agent Skills](https://github.com/varletjs/rattail/tree/main/skills) so AI assistants can understand the whole toolchain at once.
18+
- **Built-in presets** — the toolchain's lint, format, and other presets let AI assistants directly understand the project's code conventions, so generated code naturally follows team standards.
19+
- **Consistent patterns** — same config-driven approach for every CLI command, same import convention for every utility. Predictable structure leads to more reliable generated code.
20+
- **Less fragmented context** — all relevant knowledge in one place, rather than spread across separate documentation sites.
21+
22+
## Design Principles
23+
24+
- **Complement Vite+** — Rattail covers what Vite+ intentionally leaves out of scope, not what it already does.
25+
- **Config-driven** — CLI commands read from `vite.config.ts`. No scattered config files.
26+
- **Incrementally adoptable**`rattail/vite-plus` for presets, `rattail/cli` for the CLI, `rattail` for utilities. Use what you need, skip what you don't.
27+
- **Sensible defaults** — works out of the box, with escape hatches when you need them.
1328

1429
## What Rattail Does
1530

16-
Rattail tries to consolidate these pieces into `vite.config.ts`, alongside Vite+:
31+
Rattail brings these loose ends together in three ways:
32+
33+
- **Unified configuration** — lint, format, `staged`, and workflow-related options (release, hooks, API codegen, etc.) live in `vite.config.ts` next to Vite+, so you keep fewer one-off config files in the project root.
34+
- **CLI for chores** — the `rt` CLI reads the same config to run publishing, changelogs, git hooks, OpenAPI codegen, and other peripheral tasks.
35+
- **Utilities for daily work** — the main `rattail` package exposes a large, tree-shakable set of helpers for strings, collections, requests, and other everyday coding needs.
1736

1837
```ts
19-
import { defineConfig, lint, fmt, staged, hook, clean } from 'rattail/vite-plus'
38+
// vite.config.ts
39+
import {
40+
defineConfig,
41+
lint,
42+
fmt,
43+
staged,
44+
hook,
45+
clean,
46+
} from 'rattail/vite-plus'
2047

2148
export default defineConfig({
2249
lint: lint(),
50+
2351
fmt: fmt(),
52+
2453
staged: staged(),
54+
2555
rattail: {
56+
// rt clean
2657
clean: clean(),
58+
59+
// rt hook
2760
hook: hook(),
61+
62+
// rt api
63+
api: {
64+
input: './openapi.json',
65+
output: './src/apis',
66+
},
67+
68+
// rt release
2869
release: {},
70+
71+
// rt changelog
2972
changelog: {},
3073
},
3174
})
3275
```
33-
34-
One file for Vite+ config and the surrounding workflow. Fewer config files in your project root.
35-
36-
## AI Agent Friendly
37-
38-
An increasingly practical concern — AI coding assistants work better when the toolchain is cohesive:
39-
40-
- **Single dependency** — one library to learn, not a dozen tools with different APIs.
41-
- **Unified Skills** — Rattail provides [Agent Skills](https://github.com/varletjs/rattail/tree/main/skills) so AI assistants can understand the whole toolchain at once.
42-
- **Consistent patterns** — same config-driven approach for every CLI command, same import convention for every utility. Predictable structure leads to more reliable generated code.
43-
- **Less fragmented context** — all relevant knowledge in one place, rather than spread across separate documentation sites.
44-
45-
## Design Principles
46-
47-
- **Complement Vite+** — Rattail covers what Vite+ intentionally leaves out of scope, not what it already does.
48-
- **Config-driven** — CLI commands read from `vite.config.ts`. No scattered config files.
49-
- **Incrementally adoptable**`rattail/vite-plus` for presets, `rattail/cli` for the CLI, `rattail` for utilities. Use what you need, skip what you don't.
50-
- **Sensible defaults** — works out of the box, with escape hatches when you need them.

docs/zh/cli/api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# api
22

3-
生成 API 模块。
3+
解析 OpenAPI/Swagger schema 生成 API 模块。
44

55
### 使用
66

docs/zh/cli/changelog.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# changelog
22

3-
生成变更日志
3+
生成 changelog
44

55
### 使用
66

docs/zh/cli/clean.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# clean
22

3-
清理工程中的文件
3+
清理文件和目录
44

55
### 使用
66

0 commit comments

Comments
 (0)