wac-seo-analyzer
v1.0.4
Published
Comprehensive SEO analyzer CLI tool with AI-SEO (AEO/GEO) checks
Maintainers
Readme
WAC SEO Analyzer
A comprehensive SEO analyzer CLI tool that scans your project files and generates detailed reports covering Traditional SEO, AEO (Answer Engine Optimization), and GEO (Generative Engine Optimization).
Features
Traditional SEO Checks
- Meta Tags — title, description, keywords, viewport, robots, charset, lang
- Open Graph — og:title, og:description, og:image, og:url, og:type
- Twitter Cards — twitter:card, twitter:title, twitter:description, twitter:image
- Headings — H1 uniqueness, heading hierarchy, empty headings
- Images — alt attributes, dimensions, lazy loading, format optimization
- Canonical Tags — presence, absolute URLs, duplicates
- Hreflang — multi-language support, x-default fallback
- Structured Data — JSON-LD validation, schema completeness
- Links — anchor text quality, noopener, internal/external analysis
- Mobile — viewport configuration, tap targets, theme-color
- Performance — render-blocking resources, DOM size, preload hints
- URL Structure — file naming, special characters, directory depth
- robots.txt — existence, directives, sitemap reference
- sitemap.xml — existence, structure, lastmod dates
AI-SEO Checks (AEO / GEO)
- AEO — FAQ/HowTo/QA schema, question-style headings, concise answer paragraphs, direct answer patterns
- GEO — content structure, citation-worthy content, entity clarity, content depth, E-E-A-T signals, freshness
- AI Crawler — ai.txt, llms.txt, llms-full.txt, AI bot rules in robots.txt
Installation
Global Install
npm install -g wac-seo-analyzerLocal Install (in your project)
npm install --save-dev wac-seo-analyzerThen add to your package.json scripts:
{
"scripts": {
"seo-optimization": "wac-seo-analyzer"
}
}Usage
CLI
# Scan current directory
wac-seo-analyzer
# Scan a specific directory
wac-seo-analyzer --path ./my-project
# Output only CLI report
wac-seo-analyzer --format cli
# Output only HTML report
wac-seo-analyzer --format html --output ./report.html
# Run specific rules only
wac-seo-analyzer --rules meta-tags,headings,aeo,geo
# Show only warnings and failures
wac-seo-analyzer --severity warnnpm Script
npm run seo-optimizationProgrammatic API
import { runCli, scanFiles, parseHTML, runRules, loadConfig } from 'wac-seo-analyzer';
const config = loadConfig('./my-project', '.seorc.json');
const files = await scanFiles('./my-project', config.include, config.exclude);
// ... parse and run rulesConfiguration
Create a .seorc.json file in your project root:
{
"include": ["**/*.html", "src/**/*.{jsx,tsx,vue}"],
"exclude": ["node_modules/**", "dist/**"],
"rules": {
"meta-tags": { "enabled": true },
"open-graph": { "enabled": true },
"twitter-cards": { "enabled": true },
"headings": { "enabled": true },
"images": { "enabled": true },
"canonical": { "enabled": true },
"hreflang": { "enabled": false },
"structured-data": { "enabled": true },
"links": { "enabled": true },
"mobile": { "enabled": true },
"performance": { "enabled": true },
"url-structure": { "enabled": true },
"robots-txt": { "enabled": true },
"sitemap-xml": { "enabled": true },
"aeo": { "enabled": true },
"geo": { "enabled": true },
"ai-crawler": { "enabled": true }
},
"output": {
"html": true,
"htmlPath": "./seo-report.html"
}
}CLI Options
| Option | Description | Default |
|--------|-------------|---------|
| -p, --path <dir> | Project directory to scan | Current directory |
| -c, --config <file> | Config file path | .seorc.json |
| -f, --format <type> | Output format: cli, html, both | both |
| -o, --output <file> | HTML report output path | ./seo-report.html |
| --rules <rules> | Comma-separated rule IDs to run | All rules |
| --severity <level> | Minimum severity: pass, warn, fail | pass |
| -v, --version | Show version | |
| -h, --help | Show help | |
Supported File Types
.html,.htm— Full HTML parsing.jsx,.tsx— JSX/React component parsing.vue— Vue Single File Component parsing
Publishing to npm
See the publishing instructions in the project documentation.
License
MIT
