@driftdev/cli 1.14.0 → 1.15.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -218
- package/dist/drift.js +1559 -4492
- package/package.json +5 -4
- package/schemas/drift.config.schema.json +0 -37
- package/schemas/{drift.docs-map.schema.json → drift.docs.schema.json} +5 -5
package/README.md
CHANGED
|
@@ -1,226 +1,13 @@
|
|
|
1
1
|
# @driftdev/cli
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
## Who This CLI Is For
|
|
6
|
-
|
|
7
|
-
- Maintainers of TypeScript libraries, SDKs, and CLI packages.
|
|
8
|
-
- Teams that want docs quality enforced in CI.
|
|
9
|
-
- Engineers building automation around machine-readable docs diagnostics.
|
|
10
|
-
|
|
11
|
-
## Why Use It
|
|
12
|
-
|
|
13
|
-
- Catch stale JSDoc, examples, and markdown references before release.
|
|
14
|
-
- Enforce quality thresholds with standard exit codes.
|
|
15
|
-
- Produce structured output that agents and tooling can act on directly.
|
|
16
|
-
|
|
17
|
-
## Install
|
|
3
|
+
`drift` — detect when your docs drift from your code.
|
|
18
4
|
|
|
19
5
|
```bash
|
|
20
6
|
bun add -g @driftdev/cli
|
|
7
|
+
drift
|
|
8
|
+
drift list --undocumented
|
|
21
9
|
```
|
|
22
10
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
```bash
|
|
26
|
-
# Full scan: coverage + lint + prose drift + health
|
|
27
|
-
drift scan
|
|
28
|
-
|
|
29
|
-
# Check documentation coverage
|
|
30
|
-
drift coverage
|
|
31
|
-
|
|
32
|
-
# Find JSDoc accuracy issues
|
|
33
|
-
drift lint
|
|
34
|
-
|
|
35
|
-
# Validate @example blocks
|
|
36
|
-
drift examples
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
Entry auto-detects from `package.json` (`types`, `exports`, `main`, `module`, `bin`) for TypeScript packages with an exported API surface.
|
|
40
|
-
|
|
41
|
-
## Commands
|
|
42
|
-
|
|
43
|
-
### Composed
|
|
44
|
-
|
|
45
|
-
| Command | Description |
|
|
46
|
-
|---------|-------------|
|
|
47
|
-
| `drift scan [entry]` | Coverage + lint + prose drift + health in one pass (default command) |
|
|
48
|
-
| `drift health [entry]` | Documentation health score |
|
|
49
|
-
| `drift ci` | CI checks on changed packages with PR comments |
|
|
50
|
-
|
|
51
|
-
### Analysis
|
|
52
|
-
|
|
53
|
-
| Command | Description |
|
|
54
|
-
|---------|-------------|
|
|
55
|
-
| `drift coverage [entry]` | Documentation coverage score |
|
|
56
|
-
| `drift lint [entry]` | Cross-reference JSDoc vs code signatures |
|
|
57
|
-
| `drift examples [entry]` | Validate @example blocks (presence, typecheck, run) |
|
|
58
|
-
|
|
59
|
-
### Extraction
|
|
60
|
-
|
|
61
|
-
| Command | Description |
|
|
62
|
-
|---------|-------------|
|
|
63
|
-
| `drift extract [entry]` | Extract full API spec as JSON |
|
|
64
|
-
| `drift list [searchOrEntry]` | List all exports with kinds |
|
|
65
|
-
| `drift get <name>` | Inspect single export detail + types (entry auto-detected; `drift get <entry> <name>` to override) |
|
|
66
|
-
|
|
67
|
-
### Spec Operations
|
|
68
|
-
|
|
69
|
-
| Command | Description |
|
|
70
|
-
|---------|-------------|
|
|
71
|
-
| `drift validate <spec>` | Validate a spec file |
|
|
72
|
-
| `drift filter <spec>` | Filter exports by kind, search, tag |
|
|
73
|
-
|
|
74
|
-
### Comparison
|
|
75
|
-
|
|
76
|
-
| Command | Description |
|
|
77
|
-
|---------|-------------|
|
|
78
|
-
| `drift diff <old> <new>` | What changed between two specs |
|
|
79
|
-
| `drift breaking <old> <new>` | Detect breaking changes |
|
|
80
|
-
| `drift semver <old> <new>` | Recommend semver bump |
|
|
81
|
-
| `drift changelog <old> <new>` | Generate changelog |
|
|
82
|
-
|
|
83
|
-
### Setup & Plumbing
|
|
84
|
-
|
|
85
|
-
| Command | Description |
|
|
86
|
-
|---------|-------------|
|
|
87
|
-
| `drift init` | Create configuration file |
|
|
88
|
-
| `drift config` | Manage config (list, get, set) |
|
|
89
|
-
| `drift context` | Generate agent context file |
|
|
90
|
-
| `drift report` | Documentation trends from history |
|
|
91
|
-
| `drift release` | Pre-release documentation audit |
|
|
92
|
-
| `drift cache` | Cache management (clear, status) |
|
|
93
|
-
|
|
94
|
-
### Discovery
|
|
95
|
-
|
|
96
|
-
```bash
|
|
97
|
-
# Machine-readable list of all commands + flags
|
|
98
|
-
drift --tools
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
## Global Options
|
|
102
|
-
|
|
103
|
-
```
|
|
104
|
-
--json Force JSON output (default when piped)
|
|
105
|
-
--human Force human-readable output (default in terminal)
|
|
106
|
-
--config <path> Path to drift config file
|
|
107
|
-
--cwd <dir> Run as if started in <dir>
|
|
108
|
-
--no-cache Bypass spec cache
|
|
109
|
-
```
|
|
110
|
-
|
|
111
|
-
## scan
|
|
112
|
-
|
|
113
|
-
Run coverage + lint + prose drift + health in one pass.
|
|
114
|
-
|
|
115
|
-
Default command — bare `drift` runs this.
|
|
116
|
-
|
|
117
|
-
```bash
|
|
118
|
-
drift scan # single package (bare `drift` does the same)
|
|
119
|
-
drift scan --min 80 # fail if health below 80%
|
|
120
|
-
drift scan --all # all workspace packages
|
|
121
|
-
drift scan --all --private # include private packages
|
|
122
|
-
```
|
|
123
|
-
|
|
124
|
-
## lint
|
|
125
|
-
|
|
126
|
-
Cross-reference JSDoc against code signatures. Detects 17 drift types across 4 categories (structural, semantic, example, prose). Prose detection scans markdown files for broken import references, method calls that don't exist on any exported type, and references to deprecated APIs with no deprecation note.
|
|
127
|
-
|
|
128
|
-
```bash
|
|
129
|
-
drift lint # single package
|
|
130
|
-
drift lint --all # all workspace packages
|
|
131
|
-
drift lint --json # JSON output with filePath/line
|
|
132
|
-
```
|
|
133
|
-
|
|
134
|
-
## coverage
|
|
135
|
-
|
|
136
|
-
Documentation coverage score.
|
|
137
|
-
|
|
138
|
-
```bash
|
|
139
|
-
drift coverage # single package
|
|
140
|
-
drift coverage --min 80 # fail if below 80%
|
|
141
|
-
drift coverage --all # all workspace packages
|
|
142
|
-
```
|
|
143
|
-
|
|
144
|
-
## health
|
|
145
|
-
|
|
146
|
-
Weighted health score: completeness (coverage) + accuracy (lint).
|
|
147
|
-
|
|
148
|
-
```bash
|
|
149
|
-
drift health
|
|
150
|
-
drift health --min 80
|
|
151
|
-
drift health --all
|
|
152
|
-
```
|
|
153
|
-
|
|
154
|
-
## examples
|
|
155
|
-
|
|
156
|
-
Validate @example blocks.
|
|
157
|
-
|
|
158
|
-
```bash
|
|
159
|
-
drift examples # presence check
|
|
160
|
-
drift examples --typecheck # type-check examples
|
|
161
|
-
drift examples --run # execute examples with // => assertions
|
|
162
|
-
drift examples --min 50 # fail if example coverage below 50%
|
|
163
|
-
```
|
|
164
|
-
|
|
165
|
-
## ci
|
|
166
|
-
|
|
167
|
-
CI checks with GitHub integration: PR comments, step summaries, history tracking.
|
|
168
|
-
|
|
169
|
-
```bash
|
|
170
|
-
drift ci # check changed packages
|
|
171
|
-
drift ci --all # check all packages
|
|
172
|
-
drift ci --private # include private packages
|
|
173
|
-
```
|
|
174
|
-
|
|
175
|
-
Generates `~/.drift/projects/<slug>/context.md` — machine-readable project state for agents.
|
|
176
|
-
|
|
177
|
-
## Configuration
|
|
178
|
-
|
|
179
|
-
### drift.config.json
|
|
180
|
-
|
|
181
|
-
```json
|
|
182
|
-
{
|
|
183
|
-
"entry": "src/index.ts",
|
|
184
|
-
"coverage": {
|
|
185
|
-
"min": 80,
|
|
186
|
-
"ratchet": true
|
|
187
|
-
},
|
|
188
|
-
"lint": true,
|
|
189
|
-
"docs": {
|
|
190
|
-
"include": ["README.md", "docs/**/*.md"],
|
|
191
|
-
"exclude": ["node_modules/**"]
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
```
|
|
195
|
-
|
|
196
|
-
See [Configuration docs](../../docs/configuration.md) for all keys and `drift config` commands.
|
|
197
|
-
|
|
198
|
-
## Output Format
|
|
199
|
-
|
|
200
|
-
All commands return structured JSON when piped or with `--json`:
|
|
201
|
-
|
|
202
|
-
```json
|
|
203
|
-
{
|
|
204
|
-
"ok": true,
|
|
205
|
-
"data": { "score": 88, "documented": 243, "total": 275 },
|
|
206
|
-
"meta": { "command": "coverage", "duration": 1234, "version": "1.4.0" }
|
|
207
|
-
}
|
|
208
|
-
```
|
|
209
|
-
|
|
210
|
-
Human-readable output in terminal by default, or with `--human`.
|
|
211
|
-
|
|
212
|
-
## Monorepo Support
|
|
213
|
-
|
|
214
|
-
All analysis commands support `--all` for workspace batch mode:
|
|
215
|
-
|
|
216
|
-
```bash
|
|
217
|
-
drift scan --all # scan all packages
|
|
218
|
-
drift coverage --all # coverage per package
|
|
219
|
-
drift lint --all # lint per package
|
|
220
|
-
```
|
|
221
|
-
|
|
222
|
-
Auto-detects workspace globs from `package.json`.
|
|
223
|
-
|
|
224
|
-
## License
|
|
11
|
+
CI: `uses: ryanwaits/drift/action@v1`. Docs site: `drift docs init`. Agents: `drift mcp` / `drift get <name>`.
|
|
225
12
|
|
|
226
|
-
|
|
13
|
+
See the repo README and `docs/getting-started.md`.
|