@rankture/cli 0.1.1 → 0.1.3

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 CHANGED
@@ -74,14 +74,27 @@ rankture check ./src --staged # Only check git staged files (pre-commit)
74
74
 
75
75
  | Option | Description | Default |
76
76
  |--------|-------------|---------|
77
- | `-f, --format <format>` | Output format: `terminal`, `json`, `html` | `terminal` |
77
+ | `-f, --format <format>` | Output format: `terminal`, `json`, `html`, `sarif`, `markdown` | `terminal` |
78
78
  | `-o, --output <file>` | Write output to file | stdout |
79
- | `--fail-on <level>` | Exit code 1 on: `none`, `critical`, `warning`, `any` | `none` |
79
+ | `--fail-on <level>` | Exit code 1 on: `none`, `critical`, `warning`, `any`, `new` | `none` |
80
80
  | `--ignore <patterns...>` | Glob patterns to ignore | `[]` |
81
81
  | `--config <file>` | Config file path | - |
82
82
  | `-w, --watch` | Watch for file changes and re-run checks | `false` |
83
83
  | `--changed` | Only check files changed in git (staged + unstaged) | `false` |
84
84
  | `--staged` | Only check git staged files (for pre-commit hooks) | `false` |
85
+ | `--quiet` | Suppress progress and informational terminal output | `false` |
86
+ | `--no-color` | Disable ANSI colors | `false` |
87
+ | `--baseline <file>` | Suppress known issues from a committed baseline | - |
88
+ | `--update-baseline` | Write current failures to the baseline | `false` |
89
+ | `--max-warnings <number>` | Fail when fresh warnings exceed this count | - |
90
+ | `--max-critical <number>` | Fail when fresh critical issues exceed this count | - |
91
+ | `--min-score <number>` | Fail when the overall score is below this percentage | - |
92
+ | `--annotations` | Emit GitHub Actions workflow-command annotations | `false` |
93
+ | `--serve` | Validate links through an ephemeral localhost server | `false` |
94
+ | `--serve-port <number>` | Preferred localhost port (`0` chooses one) | `0` |
95
+ | `--open` | Open a generated HTML report | `false` |
96
+ | `--sync` | Upload the report to Rankture | `false` |
97
+ | `--website-id <id>` | Associate a synced report with a website | - |
85
98
 
86
99
  **Output Formats:**
87
100
 
@@ -94,6 +107,22 @@ rankture check ./dist -f json -o seo-report.json
94
107
 
95
108
  # HTML output - visual report to open in browser
96
109
  rankture check ./dist -f html -o seo-report.html
110
+
111
+ # SARIF output - upload to GitHub code scanning
112
+ rankture check ./dist -f sarif -o rankture.sarif
113
+
114
+ # Compact Markdown for pull requests and AI agents
115
+ rankture check ./dist -f markdown -o rankture.md
116
+
117
+ # Establish a baseline, then fail only on regressions
118
+ rankture check ./dist --baseline .rankture-baseline.json --update-baseline
119
+ rankture check ./dist --baseline .rankture-baseline.json --fail-on new
120
+
121
+ # Resolve links exactly as a local web server would
122
+ rankture check ./dist --serve
123
+
124
+ # Sync a pre-deploy run to Rankture
125
+ rankture check ./dist --serve --sync --website-id YOUR_WEBSITE_ID
97
126
  ```
98
127
 
99
128
  ### `init`
@@ -112,7 +141,8 @@ Validate SEO assets like sitemaps, robots.txt, or schema.
112
141
  ```bash
113
142
  rankture validate sitemap ./public/sitemap.xml
114
143
  rankture validate robots ./public/robots.txt
115
- rankture validate schema ./schema.json # Coming soon
144
+ rankture validate schema ./schema.json
145
+ rankture validate schema ./dist/index.html
116
146
  ```
117
147
 
118
148
  **Robots.txt Validation:**
@@ -131,15 +161,42 @@ rankture validate schema ./schema.json # Coming soon
131
161
  - File size warnings (Google limit: 50MB, 50,000 URLs)
132
162
  - URL accessibility sampling
133
163
 
134
- ### `audit <url>` (Coming Soon)
164
+ ### Hosted login, sync, and audits
165
+
166
+ Create a CLI key under **Account Settings → Rankture CLI**, then:
167
+
168
+ ```bash
169
+ rankture login --api-key rk_live_xxx
170
+ rankture whoami
171
+ rankture websites
172
+ rankture check ./dist --sync --website-id YOUR_WEBSITE_ID
173
+ rankture audit https://example.com --pages 10
174
+ rankture audit https://example.com --pages 10 --wait --format json
175
+ ```
176
+
177
+ The server stores only a SHA-256 hash of each key. The local credential file is
178
+ created with owner-only permissions. `RANKTURE_API_KEY` and `RANKTURE_API_URL`
179
+ can be used instead of storing credentials, which is recommended in CI.
135
180
 
136
- Audit a live URL with optional Pro features.
181
+ ### Local MCP and framework integrations
137
182
 
138
183
  ```bash
139
- rankture audit https://example.com
140
- rankture audit https://example.com --api-key YOUR_KEY --sync
184
+ rankture mcp --root .
141
185
  ```
142
186
 
187
+ The stdio MCP exposes `check_path`, `validate_schema`, `list_rules`, and
188
+ `explain_rule`, and rejects paths outside the configured root. Astro and Vite
189
+ build hooks are available from the package API:
190
+
191
+ ```ts
192
+ import { ranktureAstro, ranktureVite } from '@rankture/cli';
193
+ ```
194
+
195
+ Authenticated keys also include read-only dashboard MCP access at
196
+ `https://rankture.com/api/mcp`. Send the key as a Bearer token. The hosted
197
+ server exposes `list_websites`, `list_check_runs`, `get_check_run`,
198
+ `get_latest_audit`, and `list_audit_issues`; it has no mutation tools.
199
+
143
200
  ## Checks Performed
144
201
 
145
202
  The CLI runs **21 offline checks** across 5 categories:
@@ -460,7 +517,9 @@ const imageResults = checkImages(parsed);
460
517
 
461
518
  ## Configuration
462
519
 
463
- Create a `rankture.config.json` in your project root:
520
+ Create a `rankture.config.json` in your project root. The CLI also discovers
521
+ `rankture.config.js`, `rankture.config.mjs`, or a `rankture` object in
522
+ `package.json`:
464
523
 
465
524
  ```json
466
525
  {
@@ -470,14 +529,24 @@ Create a `rankture.config.json` in your project root:
470
529
  "**/_*.html"
471
530
  ],
472
531
  "checks": {
473
- "title-length": { "min": 30, "max": 60 },
474
- "meta-description-length": { "min": 120, "max": 160 },
475
- "h1-count": { "expected": 1 }
532
+ "meta-title": true,
533
+ "meta-description": true,
534
+ "schema-howto": false
535
+ },
536
+ "rules": {
537
+ "image-alt": "critical",
538
+ "open-graph": "info"
476
539
  },
477
- "failOn": "critical"
540
+ "thresholds": {
541
+ "titleLength": { "min": 30, "max": 60 },
542
+ "descriptionLength": { "min": 120, "max": 160 }
543
+ }
478
544
  }
479
545
  ```
480
546
 
547
+ Command-line `--ignore` patterns are combined with config ignores. Unknown
548
+ check IDs, invalid severities, and invalid thresholds fail with exit code 1.
549
+
481
550
  ## Output Formats
482
551
 
483
552
  ### Terminal (default)
@@ -549,14 +618,13 @@ jobs:
549
618
 
550
619
  - name: Build site
551
620
  run: npm run build
552
-
553
- # Option 1: Check only changed files (fast)
554
- - name: SEO Check (changed files)
555
- run: npx @rankture/cli check ./dist --changed --fail-on critical
556
621
 
557
- # Option 2: Full check on all files
558
- - name: SEO Check (full)
559
- run: npx @rankture/cli check ./dist --fail-on critical
622
+ - uses: ChrisDrinks/Rankture/packages/github-action@v0.1.3
623
+ with:
624
+ path: dist
625
+ fail-on: new
626
+ baseline: .rankture-baseline.json
627
+ serve: true
560
628
  ```
561
629
 
562
630
  ### Pre-commit Hook (with Husky)
@@ -598,7 +666,6 @@ seo-check:
598
666
  With a [Rankture Pro](https://rankture.com/pricing/) subscription, unlock:
599
667
 
600
668
  - 🌐 **Live URL auditing** - Check live sites, not just static files
601
- - 📱 **Mobile & desktop** - Separate audits for each viewport
602
669
  - 🔗 **Broken link checking** - HTTP validation of all links
603
670
  - ⚡ **Core Web Vitals** - LCP, CLS, FID/INP metrics
604
671
  - 📊 **Dashboard sync** - Track progress over time
@@ -606,7 +673,8 @@ With a [Rankture Pro](https://rankture.com/pricing/) subscription, unlock:
606
673
  - 📄 **PDF reports** - Branded reports for clients
607
674
 
608
675
  ```bash
609
- rankture audit https://example.com --api-key YOUR_KEY --sync
676
+ rankture login --api-key rk_live_xxx
677
+ rankture audit https://example.com --pages 10 --wait
610
678
  ```
611
679
 
612
680
  Get your API key at [rankture.com/dashboard/settings](https://rankture.com/dashboard/settings/)
@@ -620,7 +688,7 @@ Get your API key at [rankture.com/dashboard/settings](https://rankture.com/dashb
620
688
  | CI/CD integration | ✅ | ✅ |
621
689
  | Live URL auditing | ❌ | ✅ |
622
690
  | Mobile/Desktop audits | ❌ | ✅ |
623
- | Broken link checking | | ✅ |
691
+ | Local HTTP link checking | | ✅ |
624
692
  | Core Web Vitals | ❌ | ✅ |
625
693
  | Dashboard sync | ❌ | ✅ |
626
694
  | AI suggestions | ❌ | ✅ |