docguard-cli 0.5.1 → 0.6.0
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 +37 -15
- package/cli/commands/generate.mjs +432 -82
- package/cli/commands/publish.mjs +246 -0
- package/cli/docguard.mjs +19 -3
- package/cli/scanners/doc-tools.mjs +351 -0
- package/cli/scanners/routes.mjs +461 -0
- package/cli/scanners/schemas.mjs +567 -0
- package/docs/ai-integration.md +7 -7
- package/docs/commands.md +40 -40
- package/docs/faq.md +1 -1
- package/docs/profiles.md +6 -6
- package/docs/quickstart.md +10 -10
- package/package.json +1 -1
- package/templates/ci/github-actions.yml +1 -1
package/README.md
CHANGED
|
@@ -3,9 +3,11 @@
|
|
|
3
3
|
> **AI-native documentation enforcement for Canonical-Driven Development (CDD).**
|
|
4
4
|
> AI diagnoses. AI fixes. AI verifies. Humans review.
|
|
5
5
|
|
|
6
|
+
[](https://www.npmjs.com/package/docguard-cli)
|
|
6
7
|
[](https://opensource.org/licenses/MIT)
|
|
7
8
|
[](https://nodejs.org)
|
|
8
9
|
[](package.json)
|
|
10
|
+
[](https://github.com/marketplace/actions/docguard-cdd-compliance)
|
|
9
11
|
|
|
10
12
|
---
|
|
11
13
|
|
|
@@ -30,23 +32,43 @@
|
|
|
30
32
|
|
|
31
33
|
```bash
|
|
32
34
|
# The primary command — AI diagnoses AND fixes everything
|
|
33
|
-
npx docguard diagnose
|
|
35
|
+
npx docguard-cli diagnose
|
|
34
36
|
|
|
35
37
|
# Generate CDD docs from an existing codebase
|
|
36
|
-
npx docguard generate
|
|
38
|
+
npx docguard-cli generate
|
|
37
39
|
|
|
38
40
|
# Start from scratch (minimal setup for side projects)
|
|
39
|
-
npx docguard init --profile starter
|
|
41
|
+
npx docguard-cli init --profile starter
|
|
40
42
|
|
|
41
43
|
# Start from scratch (full enterprise setup)
|
|
42
|
-
npx docguard init
|
|
44
|
+
npx docguard-cli init
|
|
43
45
|
|
|
44
46
|
# CI gate — pass/fail for pipelines
|
|
45
|
-
npx docguard guard
|
|
47
|
+
npx docguard-cli guard
|
|
46
48
|
```
|
|
47
49
|
|
|
48
50
|
No installation needed. Zero dependencies. Works with Node.js 18+.
|
|
49
51
|
|
|
52
|
+
### Install
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
# Run directly (no install)
|
|
56
|
+
npx docguard-cli diagnose
|
|
57
|
+
|
|
58
|
+
# Or install globally
|
|
59
|
+
npm i -g docguard-cli
|
|
60
|
+
docguard diagnose
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### GitHub Action
|
|
64
|
+
|
|
65
|
+
```yaml
|
|
66
|
+
- uses: raccioly/docguard@v0.5.0
|
|
67
|
+
with:
|
|
68
|
+
command: guard
|
|
69
|
+
fail-on-warning: true
|
|
70
|
+
```
|
|
71
|
+
|
|
50
72
|
### The AI Loop
|
|
51
73
|
|
|
52
74
|
```
|
|
@@ -63,7 +85,7 @@ diagnose → AI reads prompts → AI fixes docs → guard verifies
|
|
|
63
85
|
|
|
64
86
|
### 🔮 Generate — Reverse-engineer docs from code
|
|
65
87
|
```
|
|
66
|
-
$ npx docguard generate
|
|
88
|
+
$ npx docguard-cli generate
|
|
67
89
|
|
|
68
90
|
🔮 DocGuard Generate — my-project
|
|
69
91
|
Scanning codebase to generate canonical documentation...
|
|
@@ -93,7 +115,7 @@ $ npx docguard generate
|
|
|
93
115
|
|
|
94
116
|
### 📊 Score — CDD maturity assessment
|
|
95
117
|
```
|
|
96
|
-
$ npx docguard score
|
|
118
|
+
$ npx docguard-cli score
|
|
97
119
|
|
|
98
120
|
Category Breakdown
|
|
99
121
|
|
|
@@ -115,7 +137,7 @@ $ npx docguard score
|
|
|
115
137
|
|
|
116
138
|
### 🔍 Diff — Canonical docs vs code comparison
|
|
117
139
|
```
|
|
118
|
-
$ npx docguard diff
|
|
140
|
+
$ npx docguard-cli diff
|
|
119
141
|
|
|
120
142
|
🛣️ API Routes
|
|
121
143
|
In code but not documented:
|
|
@@ -130,7 +152,7 @@ $ npx docguard diff
|
|
|
130
152
|
|
|
131
153
|
### 🤖 Agents — Generate agent-specific configs
|
|
132
154
|
```
|
|
133
|
-
$ npx docguard agents
|
|
155
|
+
$ npx docguard-cli agents
|
|
134
156
|
|
|
135
157
|
✅ Cursor: .cursor/rules/cdd.mdc
|
|
136
158
|
✅ GitHub Copilot: .github/copilot-instructions.md
|
|
@@ -144,21 +166,21 @@ $ npx docguard agents
|
|
|
144
166
|
|
|
145
167
|
### 🔍 Audit — What docs exist/missing
|
|
146
168
|
```
|
|
147
|
-
$ npx docguard audit
|
|
169
|
+
$ npx docguard-cli audit
|
|
148
170
|
|
|
149
171
|
Score: 8/8 required files (100%)
|
|
150
172
|
```
|
|
151
173
|
|
|
152
174
|
### 🏗️ Init — Create CDD docs from templates
|
|
153
175
|
```
|
|
154
|
-
$ npx docguard init
|
|
176
|
+
$ npx docguard-cli init
|
|
155
177
|
|
|
156
178
|
Created 9 files (8 docs + .docguard.json)
|
|
157
179
|
```
|
|
158
180
|
|
|
159
181
|
### 🛡️ Guard — Validate project against docs
|
|
160
182
|
```
|
|
161
|
-
$ npx docguard guard
|
|
183
|
+
$ npx docguard-cli guard
|
|
162
184
|
|
|
163
185
|
✅ Structure 8/8 checks passed
|
|
164
186
|
✅ Doc Sections 10/10 checks passed
|
|
@@ -261,8 +283,8 @@ jobs:
|
|
|
261
283
|
- uses: actions/setup-node@v4
|
|
262
284
|
with:
|
|
263
285
|
node-version: '20'
|
|
264
|
-
- run: npx docguard guard
|
|
265
|
-
- run: npx docguard score --format json
|
|
286
|
+
- run: npx docguard-cli guard
|
|
287
|
+
- run: npx docguard-cli score --format json
|
|
266
288
|
```
|
|
267
289
|
|
|
268
290
|
### Pre-commit Hook
|
|
@@ -270,7 +292,7 @@ jobs:
|
|
|
270
292
|
```bash
|
|
271
293
|
# .git/hooks/pre-commit
|
|
272
294
|
#!/bin/sh
|
|
273
|
-
npx docguard guard
|
|
295
|
+
npx docguard-cli guard
|
|
274
296
|
```
|
|
275
297
|
|
|
276
298
|
---
|