pagegraph

CLI commands

Every pagegraph CLI command with a one-line description, the agentic workflow command table, and the stdout and stderr convention.

The pagegraph binary runs on Bun (bunx pagegraph). It bundles PageGraph's Effect, TypeSafe provider runtime and Pi agent runtime, so it does not depend on the app's Effect version. vite stays a peer, because graph commands load your app through Vite at runtime, and lighthouse is only needed by pagegraph audit.

The graph commands acquire your graph through pagegraph.config.ts at the app root. Rename an existing seo.config.ts, .js or .mjs to its pagegraph.config.* equivalent.

Graph commands

pagegraph check                 # CI gate — exit 1 on structural violations
pagegraph check --site <url>    # also check every declared page's rendered HTML
pagegraph stale                 # refresh queue: sitemap pages past the freshness policy
pagegraph graph                 # the graph as a tree · --format mermaid | json
pagegraph inspect /pricing      # one node: policy, sitemap status, in/out edges
pagegraph inspect <url> --live  # fetch a deployed page, validate its rendered <head>
pagegraph links verify <url>    # crawl served HTML: depth, orphans, declared-vs-rendered
pagegraph links verify <url> --assert-coverage  # also assert pagegraph.config.ts coverage on served anchors
pagegraph links verify <url> --emit-rendered <file>  # save the rendered edge set
pagegraph links candidates      # propose contextual links from the declared graph
pagegraph research keywords --query "email api"  # combine graph, Executor, and Jev evidence
pagegraph improve metadata --page /pricing       # apply a clean-tree source improvement
pagegraph apply <run-id>                         # apply a dry-run's recorded edits
pagegraph sitemap               # print sitemap.xml
pagegraph robots                # print robots.txt
CommandWhat it does
checkRuns every rule on the declared graph; exits 1 on structural violations
check --site <url>Also checks the server-rendered HTML of every declared page
staleLists sitemap-eligible pages past the freshness policy, oldest first
graphPrints the graph as a tree, or with --format mermaid or json
inspect <path>Shows one node: policy, sitemap status, incoming and outgoing edges
inspect <url> --liveFetches a deployed page and validates its rendered <head>
links verify <url>Crawls served HTML for depth, orphans and the declared-vs-rendered link diff
links candidatesProposes contextual links from the declared graph
sitemapPrints sitemap.xml
robotsPrints robots.txt
apply <run-id>Applies the recorded edits of a dry run
diff <before> <after>Compares two audit reports by semantic SEO outcome
audit <url...>Audits any website without pagegraph.config.ts
initScaffolds the shared agent preset under .pagegraph/agent
claims checkAsks for missing claims answers and replays committed ones
markdown show, find, lockInspects captured Markdown documents and maintains markdown.lock.json
skills list, skills get corePrints the bundled TanStack Start integration skill

Workflow commands

These run an agent through Pi. See Run agent workflows for setup.

CommandResult
research keywordsQuery demand, intent, and page ownership opportunities
research competitorsCompetitor topics, pages, and positioning evidence
research authorityQualified editorial, directory, partner, and community opportunities
analyze serpSearch-result intent and page-shape fit
analyze contentSubstance, answer quality, and intent overlap
analyze ai-searchCitation readiness and answer-engine coverage
plan architectureA page-backed information-architecture plan
improve contentEvidence-backed source copy edits
improve metadataTitle and description edits at the owning source
improve schemaStructured-data edits justified by visible content
improve linksContextual internal-link edits from graph and page evidence

The four improve commands apply edits by default and require a clean Git tree. --dry-run records edits without changing files, and --allow-dirty applies them alongside existing changes.

Agent skill

pagegraph skills list
pagegraph skills get core

The skill is maintained at skill-data/core/SKILL.md and compiled into the CLI, so the instructions match the installed PageGraph version. skills get core prints Markdown to stdout, and --json returns a structured payload.

Output convention

Stdout is data, stderr is status. pagegraph check --json | jq just works. Check the exit code as well as the output.

Common flags

FlagApplies toMeaning
--jsonmost commandsEmit versioned structured output on stdout
--site <url>check, links candidatesFetch rendered pages from a running server
--allow-privatecheck --site, audit, links, improve linksPermit private and reserved destinations; for local development and CI
--require-inbound "<glob>=<n>"checkOverride the coverage policy for one run
--limitlinks verify, links candidates, workflowsBound the crawl, plan or result count
--rendered <path>links verify, links candidatesReplay a saved rendered edge set instead of crawling
--from <run-dir|run-id>workflow commandsResume a prior run
--dev <origin>markdown, claims checkUse the development bundle instead of the build
--refreshclaims check, workflowsAsk again and replace cached answers

Read next

Edit this page on GitHubView as Markdown