yread 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- yread-0.1.0/.env.yread.example +22 -0
- yread-0.1.0/.gitignore +32 -0
- yread-0.1.0/LICENSE +21 -0
- yread-0.1.0/PKG-INFO +254 -0
- yread-0.1.0/README.md +224 -0
- yread-0.1.0/examples/sample-wiki/1-overview.md +13 -0
- yread-0.1.0/examples/sample-wiki/2-agent-pipeline.md +10 -0
- yread-0.1.0/examples/sample-wiki/manifest.json +21 -0
- yread-0.1.0/examples/sample-wiki/wiki.json +29 -0
- yread-0.1.0/pyproject.toml +68 -0
- yread-0.1.0/skills/yread/SKILL.md +105 -0
- yread-0.1.0/src/yread/__init__.py +3 -0
- yread-0.1.0/src/yread/cli.py +173 -0
- yread-0.1.0/src/yread/core.py +1269 -0
- yread-0.1.0/src/yread/viewer.py +179 -0
- yread-0.1.0/tests/test_view.py +13 -0
- yread-0.1.0/tests/test_yread.py +295 -0
- yread-0.1.0/uv.lock +557 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Copy to .env.yread and pass it explicitly:
|
|
2
|
+
# uv run yread generate /path/to/repo --env-file .env.yread
|
|
3
|
+
|
|
4
|
+
# Use any OpenAI Chat Completions compatible endpoint.
|
|
5
|
+
PROVIDER=openai-compatible
|
|
6
|
+
BASE_URL=https://api.example.com/v1
|
|
7
|
+
API_KEY=replace-me
|
|
8
|
+
MODEL=replace-me
|
|
9
|
+
|
|
10
|
+
# Documentation output language code (e.g. zh, en).
|
|
11
|
+
DOC_LANG=en
|
|
12
|
+
|
|
13
|
+
# Optional default export directory, useful for an Obsidian vault.
|
|
14
|
+
# OUTPUT_DIR=/path/to/Obsidian Vault/yread
|
|
15
|
+
|
|
16
|
+
# Agent/tool limits.
|
|
17
|
+
MAX_STEPS=24
|
|
18
|
+
MAX_TOPICS=30
|
|
19
|
+
CONCURRENCY=3
|
|
20
|
+
|
|
21
|
+
# Set to 0 to remove run_bash from the agent tool list.
|
|
22
|
+
ENABLE_SHELL=1
|
yread-0.1.0/.gitignore
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*.egg-info/
|
|
5
|
+
dist/
|
|
6
|
+
build/
|
|
7
|
+
|
|
8
|
+
# yread output (generated wiki — not version-controlled)
|
|
9
|
+
.yread/
|
|
10
|
+
|
|
11
|
+
# Local comparison runs and generated fixtures
|
|
12
|
+
experiments/
|
|
13
|
+
|
|
14
|
+
# Environment
|
|
15
|
+
.venv/
|
|
16
|
+
venv/
|
|
17
|
+
.env
|
|
18
|
+
.env.*
|
|
19
|
+
!.env.yread.example
|
|
20
|
+
.env.yread
|
|
21
|
+
.env.yread.local
|
|
22
|
+
.pytest_cache/
|
|
23
|
+
|
|
24
|
+
# IDE
|
|
25
|
+
.idea/
|
|
26
|
+
.vscode/
|
|
27
|
+
*.swp
|
|
28
|
+
*.swo
|
|
29
|
+
|
|
30
|
+
# OS
|
|
31
|
+
.DS_Store
|
|
32
|
+
Thumbs.db
|
yread-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 yread contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
yread-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: yread
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Local lightweight repo-to-wiki generator inspired by zread.
|
|
5
|
+
Project-URL: Homepage, https://github.com/cyzlmh/yread
|
|
6
|
+
Project-URL: Repository, https://github.com/cyzlmh/yread
|
|
7
|
+
Project-URL: Issues, https://github.com/cyzlmh/yread/issues
|
|
8
|
+
Author: yread contributors
|
|
9
|
+
License-Expression: MIT
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Keywords: cli,codebase,documentation,llm,wiki
|
|
12
|
+
Classifier: Development Status :: 3 - Alpha
|
|
13
|
+
Classifier: Environment :: Console
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
16
|
+
Classifier: Operating System :: MacOS
|
|
17
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
18
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
23
|
+
Classifier: Topic :: Software Development :: Documentation
|
|
24
|
+
Classifier: Topic :: Utilities
|
|
25
|
+
Requires-Python: >=3.10
|
|
26
|
+
Requires-Dist: markdown>=3.6
|
|
27
|
+
Requires-Dist: openai>=1.30
|
|
28
|
+
Requires-Dist: pypinyin>=0.51
|
|
29
|
+
Description-Content-Type: text/markdown
|
|
30
|
+
|
|
31
|
+
# yread
|
|
32
|
+
|
|
33
|
+
> Turn a local source repository into a structured Markdown wiki.
|
|
34
|
+
|
|
35
|
+
`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.
|
|
36
|
+
|
|
37
|
+
The `y` is intentional: it is zread's alphabet neighbor, and it also hints at "yet another" small local implementation.
|
|
38
|
+
|
|
39
|
+
## Why
|
|
40
|
+
|
|
41
|
+
Zread popularized the idea of generating a developer guide from a GitHub repository. `yread` keeps the same core idea, but narrows the scope:
|
|
42
|
+
|
|
43
|
+
- Local repositories only
|
|
44
|
+
- Direct OpenAI-compatible provider calls
|
|
45
|
+
- A small, readable Python implementation
|
|
46
|
+
- Markdown output that can be checked into notes, opened in Obsidian, or served locally
|
|
47
|
+
|
|
48
|
+
This is not a hosted wiki platform. It is a local code-reading tool.
|
|
49
|
+
|
|
50
|
+
## How It Works
|
|
51
|
+
|
|
52
|
+
`yread` runs two LLM-driven phases:
|
|
53
|
+
|
|
54
|
+
```text
|
|
55
|
+
Phase 1: Catalog Agent
|
|
56
|
+
Inspect the repository
|
|
57
|
+
Plan sections, groups, and topics
|
|
58
|
+
Attach relevant source paths to each topic
|
|
59
|
+
|
|
60
|
+
Phase 2: Page Agents
|
|
61
|
+
Start one fresh conversation per topic
|
|
62
|
+
Inspect the relevant source files
|
|
63
|
+
Write Markdown wrapped as a wiki page
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Agents only receive three read-only tools:
|
|
67
|
+
|
|
68
|
+
| Tool | Purpose |
|
|
69
|
+
| --- | --- |
|
|
70
|
+
| `get_dir_structure` | Show a filtered directory tree |
|
|
71
|
+
| `view_file_in_detail` | Read source files by line range |
|
|
72
|
+
| `run_bash` | Run conservative read-only commands; disable with `ENABLE_SHELL=0` |
|
|
73
|
+
|
|
74
|
+
## Install and Run
|
|
75
|
+
|
|
76
|
+
From a checkout, `generate` defaults to the current directory:
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
cd /path/to/repo
|
|
80
|
+
uv run yread generate # or: uv run yread generate /path/to/repo
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
Install as a uv tool:
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
uv tool install .
|
|
87
|
+
cd /path/to/repo && yread generate
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Output defaults to:
|
|
91
|
+
|
|
92
|
+
```text
|
|
93
|
+
<repo>/.yread/wiki/
|
|
94
|
+
├── current
|
|
95
|
+
└── versions/<YYYY-MM-DD-HHMMSS>/
|
|
96
|
+
├── <slug>.md
|
|
97
|
+
├── wiki.json
|
|
98
|
+
├── manifest.json
|
|
99
|
+
└── SUMMARY.md
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## Provider Configuration
|
|
103
|
+
|
|
104
|
+
`yread` can use `minimax-cn`, `deepseek`, or any OpenAI Chat Completions compatible endpoint.
|
|
105
|
+
|
|
106
|
+
For a generic OpenAI-compatible provider:
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
cp .env.yread.example .env.yread
|
|
110
|
+
$EDITOR .env.yread
|
|
111
|
+
uv run yread generate /path/to/repo --env-file .env.yread
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
All tunables (provider, model, language, concurrency, output) live in config rather than on the `generate` command, keeping the command surface lean.
|
|
115
|
+
|
|
116
|
+
Persistent config lives at:
|
|
117
|
+
|
|
118
|
+
```text
|
|
119
|
+
~/.yread/config.env
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
Set it up interactively:
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
yread config init
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
Or manage individual keys:
|
|
129
|
+
|
|
130
|
+
```bash
|
|
131
|
+
yread config path
|
|
132
|
+
yread config set PROVIDER openai-compatible
|
|
133
|
+
yread config set BASE_URL https://api.example.com/v1
|
|
134
|
+
yread config set API_KEY sk-...
|
|
135
|
+
yread config set MODEL your-model
|
|
136
|
+
yread config set DOC_LANG en
|
|
137
|
+
yread config show
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
Config precedence is:
|
|
141
|
+
|
|
142
|
+
```text
|
|
143
|
+
process environment > --env-file > ~/.yread/config.env > defaults
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
| Key | Default | Description |
|
|
147
|
+
| --- | --- | --- |
|
|
148
|
+
| `PROVIDER` | `minimax-cn` | `minimax-cn`, `deepseek`, or `openai-compatible` |
|
|
149
|
+
| `BASE_URL` | auto-resolved | OpenAI-compatible `/v1` endpoint |
|
|
150
|
+
| `API_KEY` | auto-resolved | Provider API key |
|
|
151
|
+
| `MODEL` | provider default | Model name |
|
|
152
|
+
| `DOC_LANG` | `en` | Documentation language code, e.g. `zh`, `en` |
|
|
153
|
+
| `MAX_STEPS` | `24` | Max tool-call rounds per agent |
|
|
154
|
+
| `MAX_TOPICS` | `30` | Catalog topic cap |
|
|
155
|
+
| `CONCURRENCY` | `1` | Parallel page agents |
|
|
156
|
+
| `ENABLE_SHELL` | `1` | Expose `run_bash` to agents |
|
|
157
|
+
| `OUTPUT_DIR` | `<repo>/.yread/wiki` | Default export directory |
|
|
158
|
+
|
|
159
|
+
For `minimax-cn` and `deepseek`, missing credentials are resolved from `~/.pi/agent/models.json` and `~/.pi/agent/auth.json` when available.
|
|
160
|
+
|
|
161
|
+
## Export to Obsidian
|
|
162
|
+
|
|
163
|
+
Set `OUTPUT_DIR` to a directory inside your vault:
|
|
164
|
+
|
|
165
|
+
```bash
|
|
166
|
+
yread config set OUTPUT_DIR "/path/to/Obsidian Vault/Code Wikis/yread"
|
|
167
|
+
yread generate /path/to/repo
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
## Resume and Regenerate
|
|
171
|
+
|
|
172
|
+
If a previous run was interrupted or left failed pages, a plain `yread generate`
|
|
173
|
+
auto-detects the incomplete version and resumes it instead of starting a new one
|
|
174
|
+
(use `--force` to start fresh). A build that produces no pages never replaces a
|
|
175
|
+
previously-good wiki.
|
|
176
|
+
|
|
177
|
+
Explicitly resume the current version, regenerating only missing, failed, or
|
|
178
|
+
source-affected pages:
|
|
179
|
+
|
|
180
|
+
```bash
|
|
181
|
+
yread generate /path/to/repo --resume
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
Regenerate one page by slug, title, or Markdown filename:
|
|
185
|
+
|
|
186
|
+
```bash
|
|
187
|
+
yread generate /path/to/repo --page 1-overview
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
Disable shell access for agents (config-only):
|
|
191
|
+
|
|
192
|
+
```bash
|
|
193
|
+
yread config set ENABLE_SHELL 0
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
## Browse Locally
|
|
197
|
+
|
|
198
|
+
The source repository is recorded in `wiki.json` at generation time, so source
|
|
199
|
+
citations resolve automatically — from inside the repo, just run:
|
|
200
|
+
|
|
201
|
+
```bash
|
|
202
|
+
yread browse # serves ./.yread/wiki
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
Or point at a wiki explicitly; `--repo` overrides the recorded source root:
|
|
206
|
+
|
|
207
|
+
```bash
|
|
208
|
+
uv run yread browse /path/to/repo/.yread/wiki --host localhost --port 8000
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
## Codex Skill
|
|
212
|
+
|
|
213
|
+
A companion Codex skill is available at [skills/yread/SKILL.md](skills/yread/SKILL.md).
|
|
214
|
+
|
|
215
|
+
Install it for local discovery:
|
|
216
|
+
|
|
217
|
+
```bash
|
|
218
|
+
cp -R skills/yread "${CODEX_HOME:-$HOME/.codex}/skills/"
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
## Example Output
|
|
222
|
+
|
|
223
|
+
See [examples/sample-wiki](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.
|
|
224
|
+
|
|
225
|
+
## Development
|
|
226
|
+
|
|
227
|
+
```bash
|
|
228
|
+
uv run --dev pytest -q
|
|
229
|
+
uv build
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
## Privacy
|
|
233
|
+
|
|
234
|
+
`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.
|
|
235
|
+
|
|
236
|
+
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.
|
|
237
|
+
|
|
238
|
+
## Design Notes
|
|
239
|
+
|
|
240
|
+
- No hosted service: output is local Markdown.
|
|
241
|
+
- No AST parser: repository understanding is LLM-driven.
|
|
242
|
+
- No symbolic incremental engine: resume uses a file-level manifest plus per-page associated paths.
|
|
243
|
+
- 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.
|
|
244
|
+
|
|
245
|
+
## Related Projects
|
|
246
|
+
|
|
247
|
+
- [zread.ai](https://zread.ai)
|
|
248
|
+
- [ZreadAI/zread_cli](https://github.com/ZreadAI/zread_cli)
|
|
249
|
+
- [bb-boy680/open-zread](https://github.com/bb-boy680/open-zread)
|
|
250
|
+
- [ejfkdev/zread](https://github.com/ejfkdev/zread)
|
|
251
|
+
|
|
252
|
+
## License
|
|
253
|
+
|
|
254
|
+
MIT
|
yread-0.1.0/README.md
ADDED
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
# yread
|
|
2
|
+
|
|
3
|
+
> Turn a local source repository into a structured Markdown wiki.
|
|
4
|
+
|
|
5
|
+
`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.
|
|
6
|
+
|
|
7
|
+
The `y` is intentional: it is zread's alphabet neighbor, and it also hints at "yet another" small local implementation.
|
|
8
|
+
|
|
9
|
+
## Why
|
|
10
|
+
|
|
11
|
+
Zread popularized the idea of generating a developer guide from a GitHub repository. `yread` keeps the same core idea, but narrows the scope:
|
|
12
|
+
|
|
13
|
+
- Local repositories only
|
|
14
|
+
- Direct OpenAI-compatible provider calls
|
|
15
|
+
- A small, readable Python implementation
|
|
16
|
+
- Markdown output that can be checked into notes, opened in Obsidian, or served locally
|
|
17
|
+
|
|
18
|
+
This is not a hosted wiki platform. It is a local code-reading tool.
|
|
19
|
+
|
|
20
|
+
## How It Works
|
|
21
|
+
|
|
22
|
+
`yread` runs two LLM-driven phases:
|
|
23
|
+
|
|
24
|
+
```text
|
|
25
|
+
Phase 1: Catalog Agent
|
|
26
|
+
Inspect the repository
|
|
27
|
+
Plan sections, groups, and topics
|
|
28
|
+
Attach relevant source paths to each topic
|
|
29
|
+
|
|
30
|
+
Phase 2: Page Agents
|
|
31
|
+
Start one fresh conversation per topic
|
|
32
|
+
Inspect the relevant source files
|
|
33
|
+
Write Markdown wrapped as a wiki page
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Agents only receive three read-only tools:
|
|
37
|
+
|
|
38
|
+
| Tool | Purpose |
|
|
39
|
+
| --- | --- |
|
|
40
|
+
| `get_dir_structure` | Show a filtered directory tree |
|
|
41
|
+
| `view_file_in_detail` | Read source files by line range |
|
|
42
|
+
| `run_bash` | Run conservative read-only commands; disable with `ENABLE_SHELL=0` |
|
|
43
|
+
|
|
44
|
+
## Install and Run
|
|
45
|
+
|
|
46
|
+
From a checkout, `generate` defaults to the current directory:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
cd /path/to/repo
|
|
50
|
+
uv run yread generate # or: uv run yread generate /path/to/repo
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Install as a uv tool:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
uv tool install .
|
|
57
|
+
cd /path/to/repo && yread generate
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Output defaults to:
|
|
61
|
+
|
|
62
|
+
```text
|
|
63
|
+
<repo>/.yread/wiki/
|
|
64
|
+
├── current
|
|
65
|
+
└── versions/<YYYY-MM-DD-HHMMSS>/
|
|
66
|
+
├── <slug>.md
|
|
67
|
+
├── wiki.json
|
|
68
|
+
├── manifest.json
|
|
69
|
+
└── SUMMARY.md
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## Provider Configuration
|
|
73
|
+
|
|
74
|
+
`yread` can use `minimax-cn`, `deepseek`, or any OpenAI Chat Completions compatible endpoint.
|
|
75
|
+
|
|
76
|
+
For a generic OpenAI-compatible provider:
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
cp .env.yread.example .env.yread
|
|
80
|
+
$EDITOR .env.yread
|
|
81
|
+
uv run yread generate /path/to/repo --env-file .env.yread
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
All tunables (provider, model, language, concurrency, output) live in config rather than on the `generate` command, keeping the command surface lean.
|
|
85
|
+
|
|
86
|
+
Persistent config lives at:
|
|
87
|
+
|
|
88
|
+
```text
|
|
89
|
+
~/.yread/config.env
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Set it up interactively:
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
yread config init
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Or manage individual keys:
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
yread config path
|
|
102
|
+
yread config set PROVIDER openai-compatible
|
|
103
|
+
yread config set BASE_URL https://api.example.com/v1
|
|
104
|
+
yread config set API_KEY sk-...
|
|
105
|
+
yread config set MODEL your-model
|
|
106
|
+
yread config set DOC_LANG en
|
|
107
|
+
yread config show
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
Config precedence is:
|
|
111
|
+
|
|
112
|
+
```text
|
|
113
|
+
process environment > --env-file > ~/.yread/config.env > defaults
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
| Key | Default | Description |
|
|
117
|
+
| --- | --- | --- |
|
|
118
|
+
| `PROVIDER` | `minimax-cn` | `minimax-cn`, `deepseek`, or `openai-compatible` |
|
|
119
|
+
| `BASE_URL` | auto-resolved | OpenAI-compatible `/v1` endpoint |
|
|
120
|
+
| `API_KEY` | auto-resolved | Provider API key |
|
|
121
|
+
| `MODEL` | provider default | Model name |
|
|
122
|
+
| `DOC_LANG` | `en` | Documentation language code, e.g. `zh`, `en` |
|
|
123
|
+
| `MAX_STEPS` | `24` | Max tool-call rounds per agent |
|
|
124
|
+
| `MAX_TOPICS` | `30` | Catalog topic cap |
|
|
125
|
+
| `CONCURRENCY` | `1` | Parallel page agents |
|
|
126
|
+
| `ENABLE_SHELL` | `1` | Expose `run_bash` to agents |
|
|
127
|
+
| `OUTPUT_DIR` | `<repo>/.yread/wiki` | Default export directory |
|
|
128
|
+
|
|
129
|
+
For `minimax-cn` and `deepseek`, missing credentials are resolved from `~/.pi/agent/models.json` and `~/.pi/agent/auth.json` when available.
|
|
130
|
+
|
|
131
|
+
## Export to Obsidian
|
|
132
|
+
|
|
133
|
+
Set `OUTPUT_DIR` to a directory inside your vault:
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
yread config set OUTPUT_DIR "/path/to/Obsidian Vault/Code Wikis/yread"
|
|
137
|
+
yread generate /path/to/repo
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
## Resume and Regenerate
|
|
141
|
+
|
|
142
|
+
If a previous run was interrupted or left failed pages, a plain `yread generate`
|
|
143
|
+
auto-detects the incomplete version and resumes it instead of starting a new one
|
|
144
|
+
(use `--force` to start fresh). A build that produces no pages never replaces a
|
|
145
|
+
previously-good wiki.
|
|
146
|
+
|
|
147
|
+
Explicitly resume the current version, regenerating only missing, failed, or
|
|
148
|
+
source-affected pages:
|
|
149
|
+
|
|
150
|
+
```bash
|
|
151
|
+
yread generate /path/to/repo --resume
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
Regenerate one page by slug, title, or Markdown filename:
|
|
155
|
+
|
|
156
|
+
```bash
|
|
157
|
+
yread generate /path/to/repo --page 1-overview
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
Disable shell access for agents (config-only):
|
|
161
|
+
|
|
162
|
+
```bash
|
|
163
|
+
yread config set ENABLE_SHELL 0
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
## Browse Locally
|
|
167
|
+
|
|
168
|
+
The source repository is recorded in `wiki.json` at generation time, so source
|
|
169
|
+
citations resolve automatically — from inside the repo, just run:
|
|
170
|
+
|
|
171
|
+
```bash
|
|
172
|
+
yread browse # serves ./.yread/wiki
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
Or point at a wiki explicitly; `--repo` overrides the recorded source root:
|
|
176
|
+
|
|
177
|
+
```bash
|
|
178
|
+
uv run yread browse /path/to/repo/.yread/wiki --host localhost --port 8000
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
## Codex Skill
|
|
182
|
+
|
|
183
|
+
A companion Codex skill is available at [skills/yread/SKILL.md](skills/yread/SKILL.md).
|
|
184
|
+
|
|
185
|
+
Install it for local discovery:
|
|
186
|
+
|
|
187
|
+
```bash
|
|
188
|
+
cp -R skills/yread "${CODEX_HOME:-$HOME/.codex}/skills/"
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
## Example Output
|
|
192
|
+
|
|
193
|
+
See [examples/sample-wiki](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.
|
|
194
|
+
|
|
195
|
+
## Development
|
|
196
|
+
|
|
197
|
+
```bash
|
|
198
|
+
uv run --dev pytest -q
|
|
199
|
+
uv build
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
## Privacy
|
|
203
|
+
|
|
204
|
+
`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.
|
|
205
|
+
|
|
206
|
+
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.
|
|
207
|
+
|
|
208
|
+
## Design Notes
|
|
209
|
+
|
|
210
|
+
- No hosted service: output is local Markdown.
|
|
211
|
+
- No AST parser: repository understanding is LLM-driven.
|
|
212
|
+
- No symbolic incremental engine: resume uses a file-level manifest plus per-page associated paths.
|
|
213
|
+
- 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.
|
|
214
|
+
|
|
215
|
+
## Related Projects
|
|
216
|
+
|
|
217
|
+
- [zread.ai](https://zread.ai)
|
|
218
|
+
- [ZreadAI/zread_cli](https://github.com/ZreadAI/zread_cli)
|
|
219
|
+
- [bb-boy680/open-zread](https://github.com/bb-boy680/open-zread)
|
|
220
|
+
- [ejfkdev/zread](https://github.com/ejfkdev/zread)
|
|
221
|
+
|
|
222
|
+
## License
|
|
223
|
+
|
|
224
|
+
MIT
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Overview
|
|
2
|
+
|
|
3
|
+
`yread` turns a local source repository into a structured Markdown wiki. It first builds a catalog, then starts independent page agents to inspect code and write focused documentation.
|
|
4
|
+
|
|
5
|
+
```mermaid
|
|
6
|
+
flowchart LR
|
|
7
|
+
Repo[Local repository] --> Catalog[Catalog Agent]
|
|
8
|
+
Catalog --> WikiJson[wiki.json]
|
|
9
|
+
WikiJson --> PageAgents[Page Agents]
|
|
10
|
+
PageAgents --> Pages[Markdown pages]
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
This static sample demonstrates the output layout. It is not a real model-generated run.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# Agent Pipeline
|
|
2
|
+
|
|
3
|
+
`yread` has two main phases: the Catalog Agent plans the page structure, and Page Agents gather evidence and write each page.
|
|
4
|
+
|
|
5
|
+
| Phase | Input | Output |
|
|
6
|
+
| --- | --- | --- |
|
|
7
|
+
| Catalog | Repository structure and key files | Wiki catalog |
|
|
8
|
+
| Page | One page task and navigation context | Markdown document |
|
|
9
|
+
|
|
10
|
+
This static sample demonstrates the output layout. It is not a real model-generated run.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 1,
|
|
3
|
+
"generated_at": "2026-06-29T00:00:00.000000Z",
|
|
4
|
+
"files": [
|
|
5
|
+
{
|
|
6
|
+
"path": "README.md",
|
|
7
|
+
"hash": "sample-readme",
|
|
8
|
+
"size": 6426
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"path": "pyproject.toml",
|
|
12
|
+
"hash": "sample-project",
|
|
13
|
+
"size": 330
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"path": "src/yread/core.py",
|
|
17
|
+
"hash": "sample-yread",
|
|
18
|
+
"size": 44210
|
|
19
|
+
}
|
|
20
|
+
]
|
|
21
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "sample",
|
|
3
|
+
"generated_at": "2026-06-29T00:00:00.000000Z",
|
|
4
|
+
"language": "en",
|
|
5
|
+
"pages": [
|
|
6
|
+
{
|
|
7
|
+
"slug": "1-overview",
|
|
8
|
+
"title": "Overview",
|
|
9
|
+
"file": "1-overview.md",
|
|
10
|
+
"section": "Get Started",
|
|
11
|
+
"level": "Beginner",
|
|
12
|
+
"associatedFiles": [
|
|
13
|
+
"README.md",
|
|
14
|
+
"pyproject.toml"
|
|
15
|
+
]
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"slug": "2-agent-pipeline",
|
|
19
|
+
"title": "Agent Pipeline",
|
|
20
|
+
"file": "2-agent-pipeline.md",
|
|
21
|
+
"section": "Deep Dive",
|
|
22
|
+
"group": "Core Mechanics",
|
|
23
|
+
"level": "Intermediate",
|
|
24
|
+
"associatedFiles": [
|
|
25
|
+
"src/yread/core.py"
|
|
26
|
+
]
|
|
27
|
+
}
|
|
28
|
+
]
|
|
29
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "yread"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
description = "Local lightweight repo-to-wiki generator inspired by zread."
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
authors = [
|
|
7
|
+
{ name = "yread contributors" }
|
|
8
|
+
]
|
|
9
|
+
requires-python = ">=3.10"
|
|
10
|
+
license = "MIT"
|
|
11
|
+
license-files = ["LICENSE"]
|
|
12
|
+
dependencies = [
|
|
13
|
+
"markdown>=3.6",
|
|
14
|
+
"openai>=1.30",
|
|
15
|
+
"pypinyin>=0.51",
|
|
16
|
+
]
|
|
17
|
+
keywords = ["wiki", "documentation", "codebase", "llm", "cli"]
|
|
18
|
+
classifiers = [
|
|
19
|
+
"Development Status :: 3 - Alpha",
|
|
20
|
+
"Environment :: Console",
|
|
21
|
+
"Intended Audience :: Developers",
|
|
22
|
+
"License :: OSI Approved :: MIT License",
|
|
23
|
+
"Operating System :: MacOS",
|
|
24
|
+
"Operating System :: POSIX :: Linux",
|
|
25
|
+
"Operating System :: Microsoft :: Windows",
|
|
26
|
+
"Programming Language :: Python :: 3.10",
|
|
27
|
+
"Programming Language :: Python :: 3.11",
|
|
28
|
+
"Programming Language :: Python :: 3.12",
|
|
29
|
+
"Programming Language :: Python :: 3.13",
|
|
30
|
+
"Topic :: Software Development :: Documentation",
|
|
31
|
+
"Topic :: Utilities",
|
|
32
|
+
]
|
|
33
|
+
|
|
34
|
+
[project.urls]
|
|
35
|
+
Homepage = "https://github.com/cyzlmh/yread"
|
|
36
|
+
Repository = "https://github.com/cyzlmh/yread"
|
|
37
|
+
Issues = "https://github.com/cyzlmh/yread/issues"
|
|
38
|
+
|
|
39
|
+
[project.scripts]
|
|
40
|
+
yread = "yread.cli:main"
|
|
41
|
+
|
|
42
|
+
[build-system]
|
|
43
|
+
requires = ["hatchling"]
|
|
44
|
+
build-backend = "hatchling.build"
|
|
45
|
+
|
|
46
|
+
[tool.hatch.build.targets.sdist]
|
|
47
|
+
include = [
|
|
48
|
+
"/.env.yread.example",
|
|
49
|
+
"/examples",
|
|
50
|
+
"/LICENSE",
|
|
51
|
+
"/README.md",
|
|
52
|
+
"/pyproject.toml",
|
|
53
|
+
"/skills",
|
|
54
|
+
"/src",
|
|
55
|
+
"/tests",
|
|
56
|
+
"/uv.lock",
|
|
57
|
+
]
|
|
58
|
+
|
|
59
|
+
[tool.hatch.build.targets.wheel]
|
|
60
|
+
packages = ["src/yread"]
|
|
61
|
+
|
|
62
|
+
[dependency-groups]
|
|
63
|
+
dev = [
|
|
64
|
+
"pytest>=8.0",
|
|
65
|
+
]
|
|
66
|
+
|
|
67
|
+
[tool.pytest.ini_options]
|
|
68
|
+
testpaths = ["tests"]
|