Skip to main content

yread

Turn a local source repository into an architecture-first Markdown wiki.

yread is a lightweight, installable Python CLI — turn a local repository into an architecture-first Markdown wiki, powered by LLMs. Inspired by zread.

Why

Zread popularized the idea of generating a developer guide from a GitHub repository. yread keeps the same core idea, but narrows the scope:

  • Local repositories only
  • Direct OpenAI-compatible provider calls
  • A small, readable Python implementation
  • Markdown output focused on human architectural understanding

This is not a hosted wiki platform. It is a local project-understanding tool.

How It Works

yread runs two LLM-driven phases:

Phase 1: Catalog Agent
  Inspect the repository
  Build a lightweight project profile
  Plan architecture-first topics with evidence paths

Phase 2: Page Agents
  Start one fresh conversation per topic
  Inspect evidence files
  Write human-oriented architecture and maintenance guidance

Agents only receive three read-only tools:

Tool Purpose
get_dir_structure Show a filtered directory tree
view_file_in_detail Read source files by line range
run_bash Run conservative read-only commands; disable with ENABLE_SHELL=0

Install and Run

Install from PyPI:

uv tool install yread        # or: pipx install yread, pip install yread

generate defaults to the current directory:

cd /path/to/repo
yread generate               # or: yread generate /path/to/repo

From a checkout, run without installing:

uv run yread generate /path/to/repo

Output defaults to:

<repo>/.yread/
├── wiki/
│   └── <slug>.md
├── wiki.json
├── manifest.json
└── SUMMARY.md

Project Profile

Inspect a repository's profile without calling an LLM — a dense, at-a-glance read on a project's size, languages, and activity:

yread profile               # or: yread profile /path/to/repo
Project    /path/to/repo
Files      237 source · 320 total · depth 6
Code       14,695 loc · avg 62/file · tests 53 loc (0.00x)

Languages
  Swift             7,673   73 files
  Objective-C       4,888   70 files
  C/C++               831   80 files
  Go                  692    5 files

Git        18 commits · 3 contributors · 2025-09-25→2026-07-06 · 5 in 30d · v0.3.0
GitHub     owner/repo · 12★ · MIT · pushed 2026-07-06

Every line count is core code — blank and comment-only lines are excluded, and bundled dependencies (Pods, Carthage, vendor, 3rdparty, build output, …) are skipped, so the numbers track the team's own logic. The Languages table lists each language's core code lines and sums to the Code total. Tests are counted separately and shown as a ratio of core code.

For any git repository it adds a git: section — commit count, history span (first/last commit dates), commits in the last 30 days, contributor count, latest tag, and whether the working tree is dirty — all from local git, no network.

When the repo's origin remote points to GitHub, it adds a github: section from a single API call: description, stars, forks, watchers, open issues, topics, license, homepage, default branch, last push, and archived/fork flags. Set GITHUB_TOKEN for higher rate limits and private repos. On failure the star line shows n/a with the reason (offline or HTTP <code>, e.g. a rate-limited or private repo).

Documentation Mode

Not every repository is a conventional software project. For ML / model projects — training, fine-tuning, conversion, or deployment — the substance lives in configs, training recipes, and model artifacts, which a pure architecture view under-weights.

MODE selects the documentation mode. It is explicit — there is no auto-detection:

  • software (default) — the standard architecture-first lens.
  • ml — treats configs, training recipes, and shell scripts as primary evidence, and unlocks extra topic kinds: model-architecture, training, data-pipeline, evaluation, model-conversion, and model-serving. Binary weights are not read as text — the agent is told to infer the model inventory from configs and export/convert scripts instead.
yread config set MODE ml        # switch to the ML lens
yread generate /path/to/repo --mode ml   # or per run

To decide which mode a repo needs, run yread profile: an Assets section surfaces model weights and datasets — the files a source-line count ignores — with counts and sizes. If it lists weights, reach for --mode ml.

Provider Configuration

yread can use minimax-cn, deepseek, or any OpenAI Chat Completions compatible endpoint.

For a generic OpenAI-compatible provider:

cp .env.yread.example .env.yread
$EDITOR .env.yread
uv run yread generate /path/to/repo --env-file .env.yread

All tunables (provider, model, language, depth, concurrency, output) live in config rather than on the generate command, keeping the command surface lean.

Persistent config lives at:

~/.yread/config.env

Set it up interactively:

yread config init

Or manage individual keys:

yread config path
yread config set PROVIDER openai-compatible
yread config set BASE_URL https://api.example.com/v1
yread config set API_KEY sk-...
yread config set MODEL your-model
yread config set DOC_LANG en
yread config set DEPTH standard
yread config show

Config precedence is:

YREAD_* environment variable > --env-file > ~/.yread/config.env > defaults

Keys are unprefixed in the config file, in --env-file, and with config set (a dedicated file can't clash with anything). As a shell environment variable, prefix the key with YREAD_ so common bare names never collide with unrelated variables:

YREAD_MODE=ml YREAD_DEPTH=deep yread generate /path/to/repo
Key Default Description
PROVIDER minimax-cn minimax-cn, deepseek, or openai-compatible
BASE_URL auto-resolved OpenAI-compatible /v1 endpoint
API_KEY auto-resolved Provider API key
MODEL provider default Model name
DOC_LANG en Documentation language code, e.g. zh, en
DEPTH brief brief, standard, or deep; controls topic budget and page breadth
MODE software software or ml; documentation mode (see Documentation Mode)
MAX_STEPS 24 Max tool-call rounds per agent
MAX_TOPICS 30 Catalog topic cap
CONCURRENCY 1 Parallel page agents
ENABLE_SHELL 1 Expose run_bash to agents
OUTPUT_DIR <repo>/.yread Default export directory
GITHUB_TOKEN unset GitHub token for profile — raises API rate limits, unlocks private repos. Also honors the standard, unprefixed GITHUB_TOKEN environment variable

For minimax-cn and deepseek, missing credentials are resolved from ~/.pi/agent/models.json and ~/.pi/agent/auth.json when available.

Export to Obsidian

Set OUTPUT_DIR to a directory inside your vault:

yread config set OUTPUT_DIR "/path/to/Obsidian Vault/Code Wikis/yread"
yread generate /path/to/repo

Overwrite and Resume

A plain yread generate rebuilds the catalog and overwrites the current output under .yread/. Markdown pages live in .yread/wiki/; wiki.json, manifest.json, and SUMMARY.md live directly under .yread/.

If a previous run was interrupted or left failed pages, explicitly resume the current output, regenerating only missing, failed, or source-affected pages:

yread generate /path/to/repo --resume

Resume and browse require the current v2 wiki schema.

Regenerate one page by slug, title, or Markdown filename:

yread generate /path/to/repo --page 1-overview

Disable shell access for agents (config-only):

yread config set ENABLE_SHELL 0

Browse Locally

The source repository is recorded in wiki.json at generation time, so source citations resolve automatically — from inside the repo, just run:

yread browse                       # serves ./.yread

Or point at a wiki explicitly; --repo overrides the recorded source root:

uv run yread browse /path/to/repo/.yread --host localhost --port 8000

Codex Skill

A companion Codex skill is available at skills/yread/SKILL.md.

Install it for local discovery:

cp -R skills/yread "${CODEX_HOME:-$HOME/.codex}/skills/"

Example Output

See examples/sample-wiki for a static sample of the v2 output layout. It demonstrates wiki.json, manifest.json, and Markdown page files; it is not a real model-generated run.

Development

uv run --dev pytest -q
uv build

Privacy

yread runs locally, but source snippets read by its tools are sent to the configured LLM provider. Do not run it on private or sensitive repositories unless that provider is acceptable for the code.

The file-reading tools block common secret files such as .env, private keys, and credential files. run_bash uses an allowlist and does not invoke a shell.

Design Notes

  • No hosted service: output is local Markdown.
  • No AST parser: repository understanding is LLM-driven.
  • Architecture-first pages: source paths are evidence, not the page structure.
  • No symbolic incremental engine: resume uses a file-level manifest plus per-page evidence paths.
  • Standard package layout: src/yread/core.py for generation, src/yread/cli.py for CLI/config, and src/yread/viewer.py for the local browser.

Related Projects

License

MIT

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

yread-0.4.0.tar.gz (77.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

yread-0.4.0-py3-none-any.whl (38.1 kB view details)

Uploaded Python 3

File details

Details for the file yread-0.4.0.tar.gz.

File metadata

  • Download URL: yread-0.4.0.tar.gz
  • Upload date:
  • Size: 77.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.31 {"installer":{"name":"uv","version":"0.11.31","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for yread-0.4.0.tar.gz
Algorithm Hash digest
SHA256 3c9e1be594904cb5c1e378a2ca45d4838777e8e7d5fe1a196d3b724a3d4c0830
MD5 ac2129022c088a52937916138085521e
BLAKE2b-256 2069695d333f77ec450b51ad2b7100100a13762210cc7f690929e7a808a374e8

See more details on using hashes here.

File details

Details for the file yread-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: yread-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 38.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.31 {"installer":{"name":"uv","version":"0.11.31","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for yread-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0323d38bf8a2bfdd87422f8d0dd6740149db8617dd7c47a4757ff90e96a63cd0
MD5 132d5d48d13349d136ef6835644983ab
BLAKE2b-256 84150bbcf973b939beedf73b8ebd9e28a3f4f8da090f252571ffacebd7fdb2af

See more details on using hashes here.

Release history Release notifications | RSS feed

0.9.1

2 files

0.9.0

2 files

0.8.0

2 files

0.7.0

2 files

0.6.0

2 files

0.5.1

2 files

0.5.0

2 files

This release

0.4.0 This release

2 files

0.3.1

2 files

0.3.0

2 files

0.2.2

2 files

0.2.1

2 files

0.2.0

2 files

0.1.3

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page