🐍 🏠 - Audit URLs for AI crawler readiness: checks robots.txt, llms.txt, JSON-LD schema and content density,…
Context CLI
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
**Lint any URL for LLM readiness. Get a 0-100 score for token efficiency, RAG readiness, agent compatibility, and LLM extraction quality.**
Table of Contents
- What is Context CLI?
- Features
- Installation
- Quick Start
- CLI Usage
- MCP Integration
- Context Compiler (Generate)
- Serve Modes
- Citation Radar
- Share-of-Recommendation Benchmark
- GitHub Action
- Score Breakdown
- AI Bots Checked
- Development
- License
What is Context CLI?
Context CLI is an LLM Readiness Linter that checks how well a URL is structured for AI consumption. As LLM-powered search engines, RAG pipelines, and AI agents become primary consumers of web content, your pages need to be optimized for token efficiency, structured data extraction, agent interoperability, and machine-readable formatting.
Context CLI analyzes your content across five pillars (V3 scoring) and returns a structured score from 0 to 100.
Features
- **Robots.txt AI bot access** -- checks 13 AI crawlers (GPTBot, ClaudeBot, DeepSeek-AI, Grok, and more)
- **llms.txt & llms-full.txt** -- detects both standard and extended LLM instruction files
- **Schema.org JSON-LD** -- extracts and evaluates structured data with high-value type weighting (Product, Article, FAQ, HowTo)
- **Content density** -- measures useful content vs. boilerplate with readability scoring, heading structure analysis, and answer-first detection
- **Agent Readiness (V3)** -- 20-point pillar checking AGENTS.md, Accept: text/markdown, MCP endpoints, semantic HTML, x402 payment signaling, and NLWeb support
- **Markdown-for-Agents engine** -- convert any URL to clean, token-efficient markdown; open-source alternative to Cloudflare's Markdown for Agents
- **Serve modes** -- reverse proxy, ASGI middleware, and WSGI middleware that serve markdown to agents via Accept: text/markdown
- **Batch mode** -- lint multiple URLs from a file with --file and configurable --concurrency
- **Custom bot list** -- override default bots with --bots for targeted checks
- **Verbose output** -- detailed per-pillar breakdown with scoring explanations and recommendations
- **Rich CLI output** -- formatted tables and scores via Rich
- **JSON / CSV / Markdown output** -- machine-readable results for pipelines
- **MCP server** -- expose the linter as a tool for AI agents via FastMCP (8 tools including agent readiness, markdown conversion, and AGENTS.md generation)
- **Context Compiler** -- LLM-powered llms.txt, schema.jsonld, and AGENTS.md generation, with batch mode for multiple URLs
- **Web server config generation** -- generate nginx, Apache, and Caddy configs for Accept: text/markdown routing
- **x402 payment config generation** -- generate payment signaling configuration for monetizing agent access
- **CI/CD integration** -- --fail-under threshold, --fail-on-blocked-bots, per-pillar thresholds, baseline regression detection, GitHub Step Summary
- **GitHub Action** -- composite action for CI pipelines with baseline support
- **Citation Radar** -- query AI models to see what they cite and recommend, with brand tracking and domain classification
- **Share-of-Recommendation Benchmark** -- track how often AI models mention and recommend your brand vs competitors, with LLM-as-judge analysis
Installation
Context CLI uses a headless browser for content extraction. After installing, run:
Development install
Docker
Build and run Context CLI in a container with all dependencies pre-installed:
Lint a URL:
Pass additional flags as normal:
Quick Start
This runs a full lint and prints a Rich-formatted report with your LLM readiness score.
CLI Usage
Single Page Lint
Lint only the specified URL (skip multi-page discovery):
Multi-Page Site Lint (default)
Discover pages via sitemap/spider and lint up to 10 pages:
Limit Pages
JSON Output
Get structured JSON for CI pipelines, dashboards, or scripting:
CSV / Markdown Output
Verbose Mode
Show detailed per-pillar breakdown with scoring explanations:
Timeout
Set the HTTP timeout (default: 15 seconds):
Custom Bot List
Override the default 13 bots with a custom list:
Batch Mode
Lint multiple URLs from a file (one URL per line, .txt or .csv):