Python CLI reference
ai-visibility audit <url> fetches a live page and prints a full AI-visibility report; crawlers lists the registry; generate llms-txt/generate robots-txt write the respective files to stdout. This is a separate binary from the npm package's CLI, but the command names and shape are intentionally identical. Requires the cli extra.
Install
pip install ai-visibility[cli]Adds click, httpx, and rich as dependencies and registers the ai-visibility console script (ai_visibility.cli:main). It's a Click command group:
Usage: ai-visibility [OPTIONS] COMMAND [ARGS]...
ai-visibility: make your site optimally visible to AI crawlers.
Options:
--version Show the version and exit.
--help Show this message and exit.
Commands:
audit Fetch URL, score it for AI-visibility, and print a report.
crawlers List all known AI crawlers in the registry.
generate Generate llms.txt / robots.txt content to stdout.audit — the headline command
Fetches a live URL over HTTP, best-effort checks for /llms.txt and /ai.txt at the same origin, and scores the response with analyze_content() — the same function documented on the API reference:
Usage: ai-visibility audit [OPTIONS] URL
Fetch URL, score it for AI-visibility, and print a report.
Options:
--timeout FLOAT HTTP request timeout in seconds. [default: 10.0]
--help Show this message and exit.Real output, run against a bare-bones fixture page (a single H1 and one short paragraph, no schema, no llms.txt):
AI-Visibility Report for http://localhost:8931/
AI-visibility is poor (24/100). 1 critical issue likely block AI crawlers from
understanding this page well. 3 warnings should be addressed. Weakest area: eeat
signals (0/100).
Overall score: 24/100
Answer Front Loading 20/100
Eeat Signals 0/100
Heading Structure 100/100
Schema Coverage 0/100
Fact Density 10/100
Snippability 0/100
Crawler Accessibility 40/100
Findings:
[CRITICAL] No JSON-LD structured data found on the page.
Fix: Add JSON-LD schema markup, e.g. via ai_visibility.schema.article_schema().
[WARNING] No llms.txt found.
Fix: Generate one with ai_visibility.generators.generate_llms_txt().
[WARNING] Very little content appears before the reader has to dig further into the page.
Fix: Lead with at least 40 words directly answering the page's main question.
[WARNING] Missing authority/trust signals: an author meta tag, author/publisher in JSON-LD, a contact link (mailto:/tel:).
Fix: Add an author meta tag, author/publisher JSON-LD, and a contact link to establish E-E-A-T signals.
[INFO] No ai.txt found.
Fix: Generate one with ai_visibility.generators.generate_ai_txt().
[INFO] Low factual density (0.0 concrete numbers/stats per 100 words).
Fix: Include more concrete numbers, dates, and statistics to make content easier to cite.
[INFO] Some sections have too little content under their heading to stand alone as an excerpt.
Fix: Ensure each section has at least 20 words of self-contained content.
exit: 1audit exits 1 if any finding is CRITICAL, and 0 otherwise — enough to drop straight into a CI step without a separate --fail-under flag:
- name: GEO audit
run: |
pip install ai-visibility[cli]
ai-visibility audit https://staging.example.comUnlike the npm CLI's audit/lint, the Python CLI has one audit command, no --dir local-directory mode, no --fail-under <n> numeric threshold, and no --json output in 0.5.0 — the exit code is a fixed any-critical-finding gate. For programmatic access to the full ScoreResult/AnalysisResult objects (JSON-serializable via dataclasses.asdict()), call analyze_content() directly instead of shelling out to the CLI.
crawlers — list the registry
Usage: ai-visibility crawlers [OPTIONS]
List all known AI crawlers in the registry.
Options:
--help Show this message and exit.GPTBot OpenAI training (verified)
ChatGPT-User OpenAI search (verified)
OAI-SearchBot OpenAI search (verified)
ClaudeBot Anthropic training (verified)
Claude-User Anthropic search (verified)
Claude-SearchBot Anthropic search (verified)
PerplexityBot Perplexity AI search (verified)
...
Bytespider ByteDance training (unverified)
YouBot You.com search (unverified)
cohere-ai Cohere training (unverified)
Diffbot Diffbot indexing (unverified)Reads straight from get_all_crawlers() — see the crawler registry referencefor the full, annotated list with source URLs and what "verified" means.
generate llms-txt
Usage: ai-visibility generate llms-txt [OPTIONS]
Generate llms.txt content.
Options:
--title TEXT Site or project title (used as the H1). [required]
--description TEXT One-line summary (used as the blockquote).
--url TEXT Homepage URL, added as a link entry.
--help Show this message and exit.# Acme
> Acme makes widgets.
## Links
- [Acme](https://acme.com)For anything beyond a single title/summary/link (multiple sections, per-link descriptions, an llms-full.txt with inlined page content), build a LlmsTxtConfig/LlmsFullTxtConfig and call generate_llms_txt()/generate_llms_full_txt() programmatically — see the generators API reference.
generate robots-txt
Usage: ai-visibility generate robots-txt [OPTIONS]
Generate an AI-aware robots.txt.
Options:
--help Show this message and exit.User-agent: *
Allow: /In 0.5.0 this subcommand takes no flags — it always generates the default, fully-permissive RobotsTxtConfig(). For crawler-category blocking, per-crawler rules, or sitemap URLs, call generate_robots_txt(RobotsTxtConfig(...)) directly instead of the CLI — see the generators API reference for the full RobotsTxtConfig shape.
Same interface as the npm CLI, on purpose
audit, crawlers, and generatemirror the npm package's command names deliberately — a team running both a Next.js frontend and a Django/Flask/FastAPI backend can reach for the same mental model (and largely the same muscle memory) in either language, even though the two binaries are separate implementations with some flags that don't (yet) match one-for-one — see the note under audit above for the current gaps. See the npm CLI referencefor the Node.js equivalent's fuller flag set (--dir, --fail-under, --json, lint).
See the scoring guide for what the seven breakdown dimensions in an audit report mean, and the API reference for the programmatic equivalent of every command above.