aiseo-audit 1.4.5 → 1.4.7
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 +95 -30
- package/dist/cli.js +316 -278
- package/dist/cli.mjs +316 -278
- package/dist/index.js +316 -278
- package/dist/index.mjs +316 -278
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -1,22 +1,26 @@
|
|
|
1
1
|
# aiseo-audit
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/aiseo-audit)
|
|
4
|
+
[](https://www.npmjs.com/package/aiseo-audit)
|
|
4
5
|
[](https://www.npmjs.com/package/aiseo-audit)
|
|
5
6
|
[](https://opensource.org/licenses/MIT)
|
|
6
7
|
[](https://nodejs.org)
|
|
7
8
|
[](https://www.typescriptlang.org/)
|
|
8
|
-
[](https://github.com/agencyenterprise/aiseo-audit)
|
|
9
10
|
[](https://codecov.io/gh/agencyenterprise/aiseo-audit)
|
|
11
|
+
[](https://github.com/agencyenterprise/aiseo-audit/stargazers)
|
|
10
12
|
|
|
11
13
|
<div align="center">
|
|
12
|
-
<strong>Testing
|
|
13
|
-
<img src="docs/assets/ai-seo-bad-site-example.gif" alt="Testing
|
|
14
|
+
<strong>Testing example</strong><br /><br />
|
|
15
|
+
<img src="docs/assets/ai-seo-bad-site-example.gif" alt="Testing example" width="600" />
|
|
14
16
|
</div>
|
|
15
17
|
|
|
16
18
|
Deterministic CLI that audits web pages for **AI search readiness**. Think Lighthouse, but for how well AI engines can fetch, extract, understand, and cite your content.
|
|
17
19
|
|
|
18
20
|
**AI SEO measures how reusable your content is for generative engines, not traditional search rankings.**
|
|
19
21
|
|
|
22
|
+
**Who is this for?** Content teams running pre-publish checks, developers gating deployments in CI/CD, and marketers auditing their own or competitor pages. If your content needs to be cited (not just ranked), this tool tells you where you stand.
|
|
23
|
+
|
|
20
24
|
- [Quick Start](#quick-start)
|
|
21
25
|
- [CI/CD](#cicd)
|
|
22
26
|
- [CLI Options](#cli-options)
|
|
@@ -50,7 +54,7 @@ aiseo-audit goes deeper:
|
|
|
50
54
|
## Quick Start
|
|
51
55
|
|
|
52
56
|
```bash
|
|
53
|
-
# Try it instantly
|
|
57
|
+
# Try it instantly, no install required
|
|
54
58
|
npx aiseo-audit https://yoursite.com
|
|
55
59
|
```
|
|
56
60
|
|
|
@@ -80,7 +84,7 @@ aiseo-audit https://example.com --md
|
|
|
80
84
|
# HTML report (Lighthouse-style)
|
|
81
85
|
aiseo-audit https://example.com --html
|
|
82
86
|
|
|
83
|
-
# Write to a file
|
|
87
|
+
# Write to a file, format is inferred from the extension automatically
|
|
84
88
|
aiseo-audit https://example.com --out report.html
|
|
85
89
|
aiseo-audit https://example.com --out report.md
|
|
86
90
|
aiseo-audit https://example.com --out report.json
|
|
@@ -120,6 +124,24 @@ jobs:
|
|
|
120
124
|
- run: npx aiseo-audit https://yoursite.com --fail-under 70
|
|
121
125
|
```
|
|
122
126
|
|
|
127
|
+
**Using a preview deployment URL?** If your CI pipeline produces a dynamic URL (e.g. a Vercel or Netlify preview), capture it from a prior step and pass it in:
|
|
128
|
+
|
|
129
|
+
```yaml
|
|
130
|
+
jobs:
|
|
131
|
+
deploy-and-audit:
|
|
132
|
+
runs-on: ubuntu-latest
|
|
133
|
+
steps:
|
|
134
|
+
- name: Deploy to preview
|
|
135
|
+
id: deploy
|
|
136
|
+
run: echo "url=https://your-preview-url.vercel.app" >> $GITHUB_OUTPUT
|
|
137
|
+
# Replace the above with your actual deploy step that outputs a URL
|
|
138
|
+
|
|
139
|
+
- name: Run AI SEO Audit
|
|
140
|
+
run: npx aiseo-audit ${{ steps.deploy.outputs.url }} --fail-under 70
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
The `--fail-under` threshold sets the minimum acceptable score. Exit code `1` is returned when the score falls below it, which GitHub Actions treats as a failed step.
|
|
144
|
+
|
|
123
145
|
## CLI Options
|
|
124
146
|
|
|
125
147
|
| Option | Description | Default |
|
|
@@ -138,24 +160,27 @@ jobs:
|
|
|
138
160
|
|
|
139
161
|
Either `[url]` or `--sitemap` must be provided, but not both. If no output flag is given, the default is `pretty` (color-coded terminal output). The default format can also be set in the config file.
|
|
140
162
|
|
|
141
|
-
When `--out` is provided, the format is automatically inferred from the file extension (`.html`
|
|
163
|
+
When `--out` is provided, the format is automatically inferred from the file extension (`.html` becomes HTML, `.md` becomes Markdown, `.json` becomes JSON) so you don't need to pass a separate format flag. An explicit `--html`, `--md`, or `--json` flag takes precedence if provided.
|
|
142
164
|
|
|
143
165
|
## Site-Wide Auditing
|
|
144
166
|
|
|
145
|
-
Use `--sitemap` to audit every URL in a `sitemap.xml`. Domain signals (`robots.txt`, `llms.txt`, `llms-full.txt`) are fetched once and shared across all URL audits
|
|
167
|
+
Use `--sitemap` to audit every URL in a `sitemap.xml`. Domain signals (`robots.txt`, `llms.txt`, `llms-full.txt`) are fetched once and shared across all URL audits, not re-fetched per page.
|
|
146
168
|
|
|
147
|
-
By default, domain signals are fetched from the directory that contains the sitemap file. For example, if your sitemap is at `https://example.com/projects/sitemap.xml`, signals are fetched from `https://example.com/projects/`
|
|
169
|
+
By default, domain signals are fetched from the directory that contains the sitemap file. For example, if your sitemap is at `https://example.com/projects/sitemap.xml`, signals are fetched from `https://example.com/projects/` so the tool checks `https://example.com/projects/robots.txt`, `https://example.com/projects/llms.txt`, and `https://example.com/projects/llms-full.txt`. If your signals live at the domain root instead, use `--signals-base` to specify the correct location explicitly.
|
|
148
170
|
|
|
149
171
|
```bash
|
|
150
172
|
# Audit all URLs in a sitemap
|
|
151
173
|
aiseo-audit --sitemap https://example.com/sitemap.xml
|
|
152
174
|
|
|
153
|
-
# With HTML output
|
|
175
|
+
# With HTML output, format inferred from extension
|
|
154
176
|
aiseo-audit --sitemap https://example.com/sitemap.xml --out report.html
|
|
155
177
|
|
|
156
|
-
# Override where domain signals are fetched from
|
|
178
|
+
# Override where domain signals are fetched from (sitemap)
|
|
157
179
|
aiseo-audit --sitemap https://example.com/projects/sitemap.xml --signals-base https://example.com
|
|
158
180
|
|
|
181
|
+
# Override where domain signals are fetched from (single URL)
|
|
182
|
+
aiseo-audit https://example.com/projects/page --signals-base https://example.com
|
|
183
|
+
|
|
159
184
|
# Fail if average score across all URLs is below threshold
|
|
160
185
|
aiseo-audit --sitemap https://example.com/sitemap.xml --fail-under 70
|
|
161
186
|
```
|
|
@@ -166,21 +191,7 @@ The sitemap report includes:
|
|
|
166
191
|
- **Site-wide category averages**: identify which audit categories are weakest across your whole site
|
|
167
192
|
- **Per-URL results**: individual score, grade, and top recommendation for each URL
|
|
168
193
|
|
|
169
|
-
Sitemap index files (sitemaps that reference other sitemaps) are supported
|
|
170
|
-
|
|
171
|
-
### `--signals-base`
|
|
172
|
-
|
|
173
|
-
By default, domain signals are fetched from the directory containing the page or sitemap being audited — not necessarily the domain root. Use `--signals-base` to explicitly set where `robots.txt`, `llms.txt`, and `llms-full.txt` are fetched from:
|
|
174
|
-
|
|
175
|
-
```bash
|
|
176
|
-
# Single URL: fetch signals from a specific base
|
|
177
|
-
aiseo-audit https://example.com/projects/page --signals-base https://example.com
|
|
178
|
-
|
|
179
|
-
# Sitemap: same override applies to all URLs in the sitemap
|
|
180
|
-
aiseo-audit --sitemap https://example.com/projects/sitemap.xml --signals-base https://example.com
|
|
181
|
-
```
|
|
182
|
-
|
|
183
|
-
Every report format explicitly shows which URL domain signals were fetched from, so there is no guesswork about where `robots.txt`, `llms.txt`, and `llms-full.txt` were checked.
|
|
194
|
+
Sitemap index files (sitemaps that reference other sitemaps) are supported, and all child sitemaps are fetched and flattened automatically. Every report format explicitly shows which URL domain signals were fetched from, so there is no guesswork about where `robots.txt`, `llms.txt`, and `llms-full.txt` were checked.
|
|
184
195
|
|
|
185
196
|
## User Agent
|
|
186
197
|
|
|
@@ -225,6 +236,18 @@ The audit evaluates 7 categories of AI search readiness (_[Detailed Breakdown he
|
|
|
225
236
|
| **Authority Context** | Is there author attribution, organization identity, publish dates, and structured data? |
|
|
226
237
|
| **Readability for Compression** | Is the content written at a readability level that compresses well for AI summarization? |
|
|
227
238
|
|
|
239
|
+
### Interpreting Your Score
|
|
240
|
+
|
|
241
|
+
| Score | Grade | What It Means |
|
|
242
|
+
| ------ | ----- | -------------------------------------------------------------------------------------------------------- |
|
|
243
|
+
| 90–100 | A | Highly optimized. AI engines can fetch, understand, and cite your content with minimal friction. |
|
|
244
|
+
| 75–89 | B | Good foundation. A few targeted improvements will push you into the top tier. |
|
|
245
|
+
| 60–74 | C | Moderate readiness. Structural or content gaps are likely limiting your citation potential. |
|
|
246
|
+
| 40–59 | D | Significant gaps. Core signals (structure, answerability, authority) need attention. |
|
|
247
|
+
| 0–39 | F | Not AI-ready. Start with Content Extractability. If the content cannot be fetched, nothing else matters. |
|
|
248
|
+
|
|
249
|
+
The per-category breakdown in each report shows exactly where to focus. Start with high-priority recommendations in your lowest-scoring categories.
|
|
250
|
+
|
|
228
251
|
## Output Formats
|
|
229
252
|
|
|
230
253
|
### Pretty (default)
|
|
@@ -243,6 +266,12 @@ Structured report with category tables, factor details, and recommendations grou
|
|
|
243
266
|
|
|
244
267
|
Self-contained single-file report with SVG score gauges, color-coded sections, and recommendations grouped by category. Recommendations with steps and code examples render as inline detail sections below each recommendation row. Best for stakeholder reports and visual review.
|
|
245
268
|
|
|
269
|
+
```bash
|
|
270
|
+
aiseo-audit https://example.com --out report.html
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
> **Tip:** Run this against your own site and open the file in a browser to get the most actionable view of where to focus. The HTML report is the closest equivalent to Lighthouse's output.
|
|
274
|
+
|
|
246
275
|
## Config File
|
|
247
276
|
|
|
248
277
|
Create a config file in your project root to customize behavior. The CLI automatically discovers your config by searching from the current directory up to the filesystem root, looking for (in order):
|
|
@@ -270,7 +299,43 @@ You can also pass an explicit path with `--config path/to/config.json`.
|
|
|
270
299
|
}
|
|
271
300
|
```
|
|
272
301
|
|
|
273
|
-
Weights are relative. Set a category to `2` to double its importance, or `0` to exclude it.
|
|
302
|
+
Weights are relative. Set a category to `2` to double its importance, or `0` to exclude it entirely from scoring.
|
|
303
|
+
|
|
304
|
+
**Example: tuning for a blog or editorial site.** Content that needs to be cited by AI engines should be highly answerable and readable. Double those weights and reduce the emphasis on domain-signal files (`authorityContext` covers schema markup, while `groundingSignals` covers citations and statistics):
|
|
305
|
+
|
|
306
|
+
```json
|
|
307
|
+
{
|
|
308
|
+
"format": "html",
|
|
309
|
+
"failUnder": 65,
|
|
310
|
+
"weights": {
|
|
311
|
+
"contentExtractability": 2,
|
|
312
|
+
"contentStructure": 1,
|
|
313
|
+
"answerability": 2,
|
|
314
|
+
"entityClarity": 1,
|
|
315
|
+
"groundingSignals": 2,
|
|
316
|
+
"authorityContext": 1,
|
|
317
|
+
"readabilityForCompression": 2
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
**Example: tuning for a product or docs site.** Authority and structure matter more when content needs to be trusted and navigable:
|
|
323
|
+
|
|
324
|
+
```json
|
|
325
|
+
{
|
|
326
|
+
"format": "html",
|
|
327
|
+
"failUnder": 70,
|
|
328
|
+
"weights": {
|
|
329
|
+
"contentExtractability": 2,
|
|
330
|
+
"contentStructure": 2,
|
|
331
|
+
"answerability": 1,
|
|
332
|
+
"entityClarity": 1,
|
|
333
|
+
"groundingSignals": 1,
|
|
334
|
+
"authorityContext": 2,
|
|
335
|
+
"readabilityForCompression": 1
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
```
|
|
274
339
|
|
|
275
340
|
## Programmatic API
|
|
276
341
|
|
|
@@ -341,13 +406,13 @@ It is:
|
|
|
341
406
|
|
|
342
407
|
## Compatibility Notes
|
|
343
408
|
|
|
344
|
-
**Node.js**
|
|
409
|
+
**Node.js** - Requires Node 20 or later. The `engines` field in `package.json` enforces this. Earlier versions will produce runtime errors.
|
|
345
410
|
|
|
346
|
-
**Zod**
|
|
411
|
+
**Zod** - Uses [Zod 4](https://zod.dev). If you consume the library API and also use Zod in your project, ensure you are on Zod 4+ to avoid type incompatibilities.
|
|
347
412
|
|
|
348
|
-
**CJS bin entry**
|
|
413
|
+
**CJS bin entry** - The `bin/aiseo-audit.js` executable uses `require()` (CommonJS). This is compatible with all Node 20+ environments regardless of your project's module system. The library exports support both ESM (`import`) and CJS (`require`).
|
|
349
414
|
|
|
350
|
-
**Config discovery**
|
|
415
|
+
**Config discovery** - When using the programmatic API, `loadConfig()` searches for config files starting from `process.cwd()`. If your application's working directory differs from where your config file lives, pass an explicit path:
|
|
351
416
|
|
|
352
417
|
```typescript
|
|
353
418
|
const config = await loadConfig("/path/to/aiseo.config.json");
|