CLI prose analysis for developers and technical writers.
pth analyzes text files -- READMEs, documentation, markdown, and PDFs -- and reports on structure, quality, readability, and style. Fully local, no hosted backend, no API keys required.
pip install git+ssh://git@github.com/rick-does/pith.gitThen download the spaCy language model (required for pth check):
python -m spacy download en_core_web_smAll commands remember the last file used. If you run pth scan README.md and then pth stats, it will reuse README.md.
5-second triage. How long is it? What kind of document is it? What's the rough shape? Any obvious red flags -- no headings in a 2000-word file, images missing alt text, bare links.
pth scan README.mdPure numbers. Word count, sentence count, paragraph count, average sentence length, readability scores (Flesch-Kincaid, Gunning Fog, and more). No judgment -- just quantitative data.
pth stats README.mdThe skeleton. Heading hierarchy, section nesting, section word counts. Like a table of contents with metadata -- how deep does nesting go, are sections balanced, are there orphaned subsections. For PDFs, uses the document's bookmark outline when available; falls back to font-size heuristics.
pth structure README.md
pth structure README.md --depth 2
pth structure document.pdfThe quality pass. Passive voice, overly long sentences, style issues. Flags problems with explanations. Requires spaCy.
pth check README.mdStructural diff. Not just what lines changed -- what sections were added, removed, or significantly rewritten between two versions of a document.
pth compare v1.md v2.mdData pull. Extracts headings, links, code blocks, and images as structured output. JSON by default, pipeable into other tools.
pth extract README.md
pth extract README.md --output textFast, CI-friendly pass. Flags structure issues, long sentences, missing alt text, and bare links. No spaCy required. Exits 1 if problems found.
pth lint README.md
pth lint README.md --quiet # exit code only, no outputAggregate analysis across a directory. Covers markdown, text, and PDF files. Average readability scores, total word count, per-file breakdown, most complex and largest files.
pth batch ./docs
pth batch ./docs --output json--output json|text Output format (default varies by command)
--depth <n> Max heading depth (structure command)
--quiet Exit code only, no output (lint command, CI use)
--pattern Glob pattern for batch (default: **/*.md)
--help Help for any command
PiTH is a markdown development environment. pth is its CLI. Fully local. No hosted backend.