@ai-lighthouse/cli 1.0.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.
Files changed (103) hide show
  1. package/.ai-lighthouse/audit_example.com_2025-12-15T12-10-43.json +183 -0
  2. package/.ai-lighthouse/audit_fayeed.dev_2026-01-07T19-32-28.html +743 -0
  3. package/.ai-lighthouse/audit_fayeed.dev_2026-01-07T19-33-02.html +757 -0
  4. package/.ai-lighthouse/audit_github.com_2025-12-15T11-53-21.json +168 -0
  5. package/.ai-lighthouse/audit_github.com_2025-12-15T12-04-06.json +168 -0
  6. package/.ai-lighthouse/audit_github.com_2025-12-15T12-05-10.json +168 -0
  7. package/.ai-lighthouse/audit_github.com_2025-12-15T12-09-45.json +168 -0
  8. package/.ai-lighthouse/audit_github.com_2025-12-15T12-11-07.json +168 -0
  9. package/.ai-lighthouse/audit_github.com_2025-12-15T12-13-28.json +168 -0
  10. package/.ai-lighthouse/audit_github.com_2025-12-15T12-14-59.json +205 -0
  11. package/.ai-lighthouse/audit_github.com_2025-12-15T12-18-07.json +205 -0
  12. package/.ai-lighthouse/audit_github.com_2025-12-15T12-18-44.json +205 -0
  13. package/.ai-lighthouse/audit_github.com_2025-12-15T12-21-38.json +205 -0
  14. package/.ai-lighthouse/audit_github.com_2025-12-15T12-22-21.json +205 -0
  15. package/.ai-lighthouse/audit_github.com_2025-12-15T12-22-46.json +205 -0
  16. package/.ai-lighthouse/audit_github.com_2025-12-15T12-23-18.json +205 -0
  17. package/.ai-lighthouse/audit_github.com_2025-12-15T12-24-43.json +205 -0
  18. package/.ai-lighthouse/audit_github.com_2025-12-17T12-15-08.json +168 -0
  19. package/.ai-lighthouse/audit_github.com_2025-12-17T12-15-57.json +168 -0
  20. package/.ai-lighthouse/audit_github.com_2025-12-17T12-17-11.json +168 -0
  21. package/.ai-lighthouse/audit_github.com_2025-12-17T12-22-17.json +168 -0
  22. package/.ai-lighthouse/audit_github.com_2025-12-17T12-22-42.json +168 -0
  23. package/.ai-lighthouse/audit_github.com_2025-12-17T12-23-56.json +168 -0
  24. package/.ai-lighthouse/audit_github.com_2025-12-17T12-25-24.json +168 -0
  25. package/.ai-lighthouse/audit_github.com_2025-12-17T12-25-40.json +168 -0
  26. package/.ai-lighthouse/audit_github.com_2025-12-17T12-27-02.json +168 -0
  27. package/.ai-lighthouse/audit_github.com_2025-12-17T12-27-20.json +168 -0
  28. package/.ai-lighthouse/audit_github.com_2025-12-17T12-29-56.json +168 -0
  29. package/.ai-lighthouse/audit_github.com_2025-12-17T12-32-27.json +168 -0
  30. package/.ai-lighthouse/audit_github.com_2025-12-17T12-33-00.json +168 -0
  31. package/.ai-lighthouse/audit_github.com_2025-12-17T12-34-49.json +168 -0
  32. package/.ai-lighthouse/audit_stripe.com_2025-12-15T12-11-31.json +168 -0
  33. package/.ai-lighthouse/audit_stripe.com_2025-12-15T12-11-45.json +168 -0
  34. package/.ai-lighthouse/audit_tailwindcss.com_2025-12-15T12-12-01.json +169 -0
  35. package/.ai-lighthouse/crawl_example.com_2025-12-15T12-03-08.json +24 -0
  36. package/.ai-lighthouse/crawl_example.com_2025-12-15T12-03-23.json +24 -0
  37. package/.ai-lighthouse/crawl_github.com_2025-12-15T11-41-34.json +21 -0
  38. package/.ai-lighthouse/crawl_github.com_2025-12-15T11-42-09.json +21 -0
  39. package/.ai-lighthouse/crawl_github.com_2025-12-15T11-42-45.json +21 -0
  40. package/.ai-lighthouse/crawl_github.com_2025-12-15T11-43-02.json +21 -0
  41. package/.ai-lighthouse/crawl_github.com_2025-12-15T11-43-26.json +21 -0
  42. package/.ai-lighthouse/crawl_github.com_2025-12-15T11-47-46.json +906 -0
  43. package/.ai-lighthouse/crawl_github.com_2025-12-15T11-50-27.json +906 -0
  44. package/.ai-lighthouse/crawl_github.com_2025-12-15T11-52-59.json +906 -0
  45. package/.ai-lighthouse/crawl_github.com_2025-12-15T12-03-33.json +28 -0
  46. package/CLI_UI_README.md +211 -0
  47. package/EXAMPLES.md +87 -0
  48. package/IMPLEMENTATION.md +215 -0
  49. package/README.md +166 -0
  50. package/USAGE.md +264 -0
  51. package/WIZARD_GUIDE.md +340 -0
  52. package/bin/cli.js +2 -0
  53. package/dist/commands/audit-interactive.d.ts +2 -0
  54. package/dist/commands/audit-interactive.js +106 -0
  55. package/dist/commands/audit-wizard.d.ts +2 -0
  56. package/dist/commands/audit-wizard.js +110 -0
  57. package/dist/commands/audit.d.ts +2 -0
  58. package/dist/commands/audit.js +940 -0
  59. package/dist/commands/crawl.d.ts +2 -0
  60. package/dist/commands/crawl.js +267 -0
  61. package/dist/commands/report.d.ts +2 -0
  62. package/dist/commands/report.js +304 -0
  63. package/dist/index.d.ts +1 -0
  64. package/dist/index.js +16 -0
  65. package/dist/ui/AuditReportUI.d.ts +10 -0
  66. package/dist/ui/AuditReportUI.js +76 -0
  67. package/dist/ui/SetupWizard.d.ts +18 -0
  68. package/dist/ui/SetupWizard.js +179 -0
  69. package/dist/ui/components/AIUnderstandingSection.d.ts +6 -0
  70. package/dist/ui/components/AIUnderstandingSection.js +87 -0
  71. package/dist/ui/components/HallucinationSection.d.ts +6 -0
  72. package/dist/ui/components/HallucinationSection.js +84 -0
  73. package/dist/ui/components/IssuesSection.d.ts +6 -0
  74. package/dist/ui/components/IssuesSection.js +84 -0
  75. package/dist/ui/components/MessageAlignmentSection.d.ts +6 -0
  76. package/dist/ui/components/MessageAlignmentSection.js +108 -0
  77. package/dist/ui/components/OverviewSection.d.ts +6 -0
  78. package/dist/ui/components/OverviewSection.js +107 -0
  79. package/dist/ui/components/ScoreDisplay.d.ts +8 -0
  80. package/dist/ui/components/ScoreDisplay.js +41 -0
  81. package/dist/ui/components/TechnicalSection.d.ts +7 -0
  82. package/dist/ui/components/TechnicalSection.js +110 -0
  83. package/dist/utils/comprehensive-formatter.d.ts +5 -0
  84. package/dist/utils/comprehensive-formatter.js +370 -0
  85. package/package.json +49 -0
  86. package/src/commands/audit-interactive.ts +149 -0
  87. package/src/commands/audit-wizard.ts +137 -0
  88. package/src/commands/audit.ts +1012 -0
  89. package/src/commands/crawl.ts +307 -0
  90. package/src/commands/report.ts +321 -0
  91. package/src/index.ts +22 -0
  92. package/src/ui/AuditReportUI.tsx +151 -0
  93. package/src/ui/SetupWizard.tsx +294 -0
  94. package/src/ui/components/AIUnderstandingSection.tsx +183 -0
  95. package/src/ui/components/HallucinationSection.tsx +172 -0
  96. package/src/ui/components/IssuesSection.tsx +140 -0
  97. package/src/ui/components/MessageAlignmentSection.tsx +203 -0
  98. package/src/ui/components/OverviewSection.tsx +157 -0
  99. package/src/ui/components/ScoreDisplay.tsx +58 -0
  100. package/src/ui/components/TechnicalSection.tsx +200 -0
  101. package/src/utils/comprehensive-formatter.ts +455 -0
  102. package/test.sh +31 -0
  103. package/tsconfig.json +25 -0
package/README.md ADDED
@@ -0,0 +1,166 @@
1
+ # AI Lighthouse CLI
2
+
3
+ Command-line interface for auditing websites for AI readiness, SEO optimization, and content quality.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ pnpm install
9
+ pnpm build
10
+ ```
11
+
12
+ ## Usage
13
+
14
+ ### Audit a single page
15
+
16
+ ```bash
17
+ ai-lighthouse audit https://example.com --output html
18
+ ```
19
+
20
+ ### Audit with specific rules
21
+
22
+ ```bash
23
+ ai-lighthouse audit https://example.com --rules strict --enable-llm
24
+ ```
25
+
26
+ ### Crawl multiple pages
27
+
28
+ ```bash
29
+ ai-lighthouse crawl https://example.com --depth 2 --sitemap
30
+ ```
31
+
32
+ ### Generate report from saved results
33
+
34
+ ```bash
35
+ ai-lighthouse report ./.ai-lighthouse/last_run.json --open
36
+ ```
37
+
38
+ ## Commands
39
+
40
+ ### `audit <url>`
41
+
42
+ Audit a single webpage for AI readiness.
43
+
44
+ **Options:**
45
+ - `-o, --output <format>` - Output format: json, html, lhr, csv (default: json)
46
+ - `-r, --rules <preset>` - Rule preset: default, strict, minimal (default: default)
47
+ - `-d, --depth <number>` - Crawl depth for multi-page audits (default: 1)
48
+ - `-p, --pages <urls>` - Comma-separated list of specific pages to audit
49
+ - `--cache-ttl <seconds>` - Cache TTL in seconds to avoid re-fetching
50
+ - `--threshold <score>` - Minimum score threshold (exit 1 if below)
51
+ - `--max-chunk-tokens <number>` - Maximum tokens per content chunk (default: 1200)
52
+ - `--chunking-strategy <strategy>` - Chunking strategy: auto, heading-based, paragraph-based (default: auto)
53
+ - `--enable-chunking` - Enable detailed content chunking analysis
54
+ - `--enable-extractability` - Enable extractability mapping
55
+ - `--enable-hallucination` - Enable hallucination detection
56
+ - `--enable-llm` - Enable LLM comprehension analysis
57
+ - `--min-impact <number>` - Minimum impact score to include (default: 8)
58
+ - `--min-confidence <number>` - Minimum confidence to include 0-1 (default: 0.7)
59
+ - `--max-issues <number>` - Maximum issues to return (default: 20)
60
+ - `--llm-provider <provider>` - LLM provider: openai, anthropic, ollama, local
61
+ - `--llm-model <model>` - LLM model name
62
+ - `--llm-base-url <url>` - LLM API base URL
63
+ - `--llm-api-key <key>` - LLM API key
64
+
65
+ **Examples:**
66
+
67
+ ```bash
68
+ # Basic audit
69
+ ai-lighthouse audit https://example.com
70
+
71
+ # HTML report with all features enabled
72
+ ai-lighthouse audit https://example.com \
73
+ --output html \
74
+ --enable-chunking \
75
+ --enable-extractability \
76
+ --enable-hallucination \
77
+ --enable-llm \
78
+ --llm-provider ollama \
79
+ --llm-model qwen2.5:0.5b
80
+
81
+ # Force paragraph-based chunking for consistent chunk sizes
82
+ ai-lighthouse audit https://example.com \
83
+ --enable-chunking \
84
+ --chunking-strategy paragraph-based \
85
+ --max-chunk-tokens 1000
86
+
87
+ # Force heading-based chunking for semantic sections
88
+ ai-lighthouse audit https://example.com \
89
+ --enable-chunking \
90
+ --chunking-strategy heading-based
91
+
92
+ # CI/CD integration with score threshold
93
+ ai-lighthouse audit https://example.com --threshold 80
94
+ ```
95
+
96
+ ### `crawl <url>`
97
+
98
+ Crawl and audit multiple pages from a website.
99
+
100
+ **Options:**
101
+ - `-d, --depth <number>` - Maximum crawl depth (default: 2)
102
+ - `--sitemap` - Parse sitemap.xml for URLs
103
+ - `--max-pages <number>` - Maximum number of pages to crawl (default: 50)
104
+ - `-o, --output <format>` - Output format: json, html (default: json)
105
+ - `--follow-external` - Follow external links
106
+ - `--respect-robots` - Respect robots.txt rules (default: true)
107
+
108
+ **Examples:**
109
+
110
+ ```bash
111
+ # Crawl with sitemap
112
+ ai-lighthouse crawl https://example.com --sitemap --max-pages 100
113
+
114
+ # Deep crawl with custom depth
115
+ ai-lighthouse crawl https://example.com --depth 3 --output html
116
+ ```
117
+
118
+ ### `report <file>`
119
+
120
+ Generate and view reports from saved audit results.
121
+
122
+ **Options:**
123
+ - `--open` - Open the report in browser
124
+ - `-f, --format <format>` - Output format: html, json, csv (default: html)
125
+
126
+ **Examples:**
127
+
128
+ ```bash
129
+ # Generate and open HTML report
130
+ ai-lighthouse report ./.ai-lighthouse/last_run.json --open
131
+
132
+ # Export to CSV
133
+ ai-lighthouse report ./.ai-lighthouse/crawl_*.json --format csv
134
+ ```
135
+
136
+ ## Output Formats
137
+
138
+ ### JSON
139
+ Standard JSON format with all audit data, compatible with CI/CD pipelines.
140
+
141
+ ### HTML
142
+ Beautiful, interactive HTML report with charts and detailed issue breakdowns.
143
+
144
+ ### LHR (Lighthouse Report)
145
+ Lighthouse-compatible JSON format for integration with existing Lighthouse tooling.
146
+
147
+ ### CSV
148
+ Comma-separated values for spreadsheet analysis.
149
+
150
+ ## CI/CD Integration
151
+
152
+ Use the `--threshold` flag to fail builds when scores drop below a threshold:
153
+
154
+ ```yaml
155
+ # GitHub Actions example
156
+ - name: Audit site
157
+ run: ai-lighthouse audit ${{ env.SITE_URL }} --threshold 80
158
+ ```
159
+
160
+ ## Configuration
161
+
162
+ Results are saved to `.ai-lighthouse/` directory in your project root.
163
+
164
+ ## License
165
+
166
+ MIT
package/USAGE.md ADDED
@@ -0,0 +1,264 @@
1
+ # AI Lighthouse CLI - Quick Start Guide
2
+
3
+ ## Simplest Usage (Recommended for New Users)
4
+
5
+ Just run with a URL - the wizard will guide you through the rest!
6
+
7
+ ```bash
8
+ ai-lighthouse audit https://example.com
9
+ ```
10
+
11
+ This will:
12
+ 1. **Ask you** which features to enable (AI Understanding, Chunking, etc.)
13
+ 2. **Guide you** through LLM provider setup if needed
14
+ 3. **Show results** in a beautiful interactive UI
15
+
16
+ ## How It Works
17
+
18
+ ### Basic Audit (No Additional Features)
19
+
20
+ ```bash
21
+ ai-lighthouse audit https://example.com
22
+ ```
23
+
24
+ When the wizard appears:
25
+ - Just press **Enter** on "Continue with selected features"
26
+ - You'll get a basic audit with core metrics
27
+
28
+ ### With AI Analysis
29
+
30
+ ```bash
31
+ ai-lighthouse audit https://example.com
32
+ ```
33
+
34
+ When the wizard appears:
35
+ 1. Select **🧠 AI Understanding** (press Enter to toggle)
36
+ 2. Select **Continue**
37
+ 3. Choose your LLM provider (e.g., **Ollama** for local)
38
+ 4. Enter model name (e.g., `qwen2.5:0.5b`)
39
+ 5. Confirm settings
40
+
41
+ ### Full-Featured Audit
42
+
43
+ ```bash
44
+ ai-lighthouse audit https://example.com
45
+ ```
46
+
47
+ In the wizard, select all features:
48
+ - ✓ 🧠 AI Understanding
49
+ - ✓ 📄 Content Chunking
50
+ - ✓ 🔄 Extractability
51
+ - ✓ ⚠️ Hallucination Detection
52
+ - Continue
53
+
54
+ Then configure your LLM provider.
55
+
56
+ ## Advanced Usage (Skip Wizard)
57
+
58
+ If you know exactly what you want, you can skip the wizard with flags:
59
+
60
+ ### Quick Examples
61
+
62
+ ```bash
63
+ # Basic audit, skip wizard, export as JSON
64
+ ai-lighthouse audit https://example.com --output json
65
+
66
+ # With Ollama (local LLM)
67
+ ai-lighthouse audit https://example.com \
68
+ --enable-llm \
69
+ --llm-provider ollama \
70
+ --llm-model qwen2.5:0.5b
71
+
72
+ # With OpenAI
73
+ ai-lighthouse audit https://example.com \
74
+ --enable-llm \
75
+ --llm-provider openai \
76
+ --llm-api-key sk-...
77
+
78
+ # Full-featured with Ollama
79
+ ai-lighthouse audit https://example.com \
80
+ --enable-llm \
81
+ --enable-chunking \
82
+ --enable-extractability \
83
+ --enable-hallucination \
84
+ --llm-provider ollama \
85
+ --llm-model qwen2.5:0.5b
86
+ ```
87
+
88
+ ## When Does the Wizard Appear?
89
+
90
+ The wizard **automatically shows** when:
91
+ - ✅ You run `ai-lighthouse audit <url>` with NO feature flags
92
+ - ✅ You just provide a URL
93
+
94
+ The wizard **does NOT show** when:
95
+ - ❌ You pass `--enable-llm` or other feature flags
96
+ - ❌ You specify `--output json` (or html, pdf, csv)
97
+ - ❌ You're using the command in a script/CI
98
+
99
+ This means:
100
+ - **Interactive use** = Wizard (easy!)
101
+ - **Scripted use** = No wizard (predictable!)
102
+
103
+ ## Output Formats
104
+
105
+ ```bash
106
+ # Interactive UI (default)
107
+ ai-lighthouse audit https://example.com
108
+
109
+ # JSON (for scripts/CI)
110
+ ai-lighthouse audit https://example.com --output json
111
+
112
+ # HTML report
113
+ ai-lighthouse audit https://example.com --output html
114
+
115
+ # PDF report
116
+ ai-lighthouse audit https://example.com --output pdf
117
+
118
+ # Lighthouse format
119
+ ai-lighthouse audit https://example.com --output lhr
120
+
121
+ # CSV export
122
+ ai-lighthouse audit https://example.com --output csv
123
+ ```
124
+
125
+ ## Common Workflows
126
+
127
+ ### First Time Using the Tool
128
+
129
+ ```bash
130
+ # Just run it!
131
+ ai-lighthouse audit https://yoursite.com
132
+
133
+ # The wizard will guide you through everything
134
+ ```
135
+
136
+ ### Regular Quick Check
137
+
138
+ ```bash
139
+ # Run basic audit (press Enter when wizard appears)
140
+ ai-lighthouse audit https://yoursite.com
141
+ ```
142
+
143
+ ### Deep Analysis
144
+
145
+ ```bash
146
+ # Select all features in the wizard
147
+ ai-lighthouse audit https://yoursite.com
148
+ ```
149
+
150
+ ### Automation / CI/CD
151
+
152
+ ```bash
153
+ # Skip wizard with flags
154
+ ai-lighthouse audit https://yoursite.com \
155
+ --output json \
156
+ --threshold 80
157
+ ```
158
+
159
+ ### Compare Before/After Changes
160
+
161
+ ```bash
162
+ # Before changes
163
+ ai-lighthouse audit https://yoursite.com --output json > before.json
164
+
165
+ # Make changes to your site
166
+
167
+ # After changes
168
+ ai-lighthouse audit https://yoursite.com --output json > after.json
169
+
170
+ # Compare the JSON files
171
+ ```
172
+
173
+ ## Tips
174
+
175
+ ### 🎯 For Beginners
176
+ - Just use `ai-lighthouse audit <url>`
177
+ - Let the wizard guide you
178
+ - Start with basic audit (no features)
179
+ - Enable features one at a time to learn
180
+
181
+ ### 🚀 For Power Users
182
+ - Use flags to skip the wizard
183
+ - Create shell aliases for common configs
184
+ - Use `--output json` for scripting
185
+ - Pipe output to `jq` for filtering
186
+
187
+ ### 🤖 For CI/CD
188
+ - Always use `--output json`
189
+ - Add `--threshold` to fail builds on low scores
190
+ - Store API keys in environment variables
191
+ - Use `--no-color` if needed
192
+
193
+ ## Examples by Use Case
194
+
195
+ ### Local Development with Ollama
196
+
197
+ ```bash
198
+ # 1. Start Ollama
199
+ ollama serve
200
+
201
+ # 2. Pull a small model
202
+ ollama pull qwen2.5:0.5b
203
+
204
+ # 3. Run audit (wizard will auto-detect Ollama settings)
205
+ ai-lighthouse audit http://localhost:3000
206
+ ```
207
+
208
+ ### Production Site Audit
209
+
210
+ ```bash
211
+ # Let wizard guide you
212
+ ai-lighthouse audit https://yourproductionsite.com
213
+
214
+ # Or be specific
215
+ ai-lighthouse audit https://yourproductionsite.com \
216
+ --enable-llm \
217
+ --enable-hallucination \
218
+ --llm-provider openai \
219
+ --llm-api-key $OPENAI_API_KEY
220
+ ```
221
+
222
+ ### CI/CD Pipeline
223
+
224
+ ```yaml
225
+ # .github/workflows/audit.yml
226
+ - name: Audit website
227
+ run: |
228
+ ai-lighthouse audit https://staging.example.com \
229
+ --output json \
230
+ --threshold 80
231
+ ```
232
+
233
+ ### Batch Auditing Multiple URLs
234
+
235
+ ```bash
236
+ # audit-sites.sh
237
+ for url in https://site1.com https://site2.com https://site3.com; do
238
+ ai-lighthouse audit $url --output json > "$(echo $url | sed 's/https:\/\///g').json"
239
+ done
240
+ ```
241
+
242
+ ## Getting Help
243
+
244
+ ```bash
245
+ # Main help
246
+ ai-lighthouse --help
247
+
248
+ # Command help
249
+ ai-lighthouse audit --help
250
+
251
+ # Version
252
+ ai-lighthouse --version
253
+ ```
254
+
255
+ ## What's Next?
256
+
257
+ After you've run a few audits:
258
+
259
+ 1. **Read the full guide**: See [WIZARD_GUIDE.md](./WIZARD_GUIDE.md) for detailed wizard usage
260
+ 2. **Explore the UI**: See [CLI_UI_README.md](./CLI_UI_README.md) for UI features
261
+ 3. **Learn the flags**: Run `ai-lighthouse audit --help` for all options
262
+ 4. **Automate**: Create scripts for regular audits
263
+
264
+ Happy auditing! 🚨✨