Skip to main content

Local lightweight repo-to-wiki generator inspired by zread.

Project description

yread

Turn a local source repository into a structured Markdown wiki.

yread is a lightweight, installable Python CLI inspired by zread. It uses a two-phase LLM workflow to inspect a local repository, plan a wiki outline, and write one Markdown page per topic.

The y is intentional: it is zread's alphabet neighbor, and it also hints at "yet another" small local implementation.

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 that can be checked into notes, opened in Obsidian, or served locally

This is not a hosted wiki platform. It is a local code-reading tool.

How It Works

yread runs two LLM-driven phases:

Phase 1: Catalog Agent
  Inspect the repository
  Plan sections, groups, and topics
  Attach relevant source paths to each topic

Phase 2: Page Agents
  Start one fresh conversation per topic
  Inspect the relevant source files
  Write Markdown wrapped as a wiki page

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

From a checkout, generate defaults to the current directory:

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

Install as a uv tool:

uv tool install .
cd /path/to/repo && yread generate

Output defaults to:

<repo>/.yread/wiki/
├── current
└── versions/<YYYY-MM-DD-HHMMSS>/
    ├── <slug>.md
    ├── wiki.json
    ├── manifest.json
    └── SUMMARY.md

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, 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 show

Config precedence is:

process environment > --env-file > ~/.yread/config.env > defaults
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
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/wiki Default export directory

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

Resume and Regenerate

If a previous run was interrupted or left failed pages, a plain yread generate auto-detects the incomplete version and resumes it instead of starting a new one (use --force to start fresh). A build that produces no pages never replaces a previously-good wiki.

Explicitly resume the current version, regenerating only missing, failed, or source-affected pages:

yread generate /path/to/repo --resume

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/wiki

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

uv run yread browse /path/to/repo/.yread/wiki --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 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.
  • No symbolic incremental engine: resume uses a file-level manifest plus per-page associated 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

Project details


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.1.0.tar.gz (62.6 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.1.0-py3-none-any.whl (27.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: yread-0.1.0.tar.gz
  • Upload date:
  • Size: 62.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.25 {"installer":{"name":"uv","version":"0.11.25","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.1.0.tar.gz
Algorithm Hash digest
SHA256 1cc5948b244f942e84e53de35d5d16a3b66d00ea61f4f1f4a2820f904bcbbab6
MD5 d3e596aad1a273a69a1f3e04467005c3
BLAKE2b-256 ada7d3b28cc774a99423d317bed6196aae357a7c378664b457dc46850f5fd167

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yread-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 27.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.25 {"installer":{"name":"uv","version":"0.11.25","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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 200de998c9ca413c846de64dd94ff4303b406c53959bbf99ddcb57ea5f05fd43
MD5 f7a4d5977ce264d100d158bd3a525813
BLAKE2b-256 69e30ec4a3b2ff4a687fa363283ef96f19ee3f5a57b05bc04d4e9ece395e9441

See more details on using hashes here.

Supported by

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