readmegen-agent 0.2.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.
- readmegen_agent-0.2.0/.gitignore +20 -0
- readmegen_agent-0.2.0/LICENSE +21 -0
- readmegen_agent-0.2.0/PKG-INFO +198 -0
- readmegen_agent-0.2.0/README.md +155 -0
- readmegen_agent-0.2.0/docs/architecture.md +35 -0
- readmegen_agent-0.2.0/docs/release-notes-0.2.0.md +28 -0
- readmegen_agent-0.2.0/docs/releasing.md +48 -0
- readmegen_agent-0.2.0/frontend/.gitignore +24 -0
- readmegen_agent-0.2.0/frontend/eslint.config.js +38 -0
- readmegen_agent-0.2.0/frontend/index.html +13 -0
- readmegen_agent-0.2.0/frontend/package-lock.json +4039 -0
- readmegen_agent-0.2.0/frontend/package.json +31 -0
- readmegen_agent-0.2.0/frontend/public/readmegen.svg +5 -0
- readmegen_agent-0.2.0/frontend/src/App.jsx +7 -0
- readmegen_agent-0.2.0/frontend/src/components/ConnectionPanel.css +16 -0
- readmegen_agent-0.2.0/frontend/src/components/ConnectionPanel.jsx +205 -0
- readmegen_agent-0.2.0/frontend/src/components/FileUpload.css +16 -0
- readmegen_agent-0.2.0/frontend/src/components/FileUpload.jsx +69 -0
- readmegen_agent-0.2.0/frontend/src/components/GitUrlInput.css +7 -0
- readmegen_agent-0.2.0/frontend/src/components/GitUrlInput.jsx +22 -0
- readmegen_agent-0.2.0/frontend/src/index.css +20 -0
- readmegen_agent-0.2.0/frontend/src/main.jsx +10 -0
- readmegen_agent-0.2.0/frontend/src/pages/Home.css +130 -0
- readmegen_agent-0.2.0/frontend/src/pages/Home.jsx +285 -0
- readmegen_agent-0.2.0/frontend/src/services/api.js +22 -0
- readmegen_agent-0.2.0/frontend/src/services/projectService.js +24 -0
- readmegen_agent-0.2.0/frontend/tests/api.test.js +48 -0
- readmegen_agent-0.2.0/frontend/vite.config.js +20 -0
- readmegen_agent-0.2.0/pyproject.toml +72 -0
- readmegen_agent-0.2.0/scripts/build_frontend.py +23 -0
- readmegen_agent-0.2.0/scripts/check_distribution.py +34 -0
- readmegen_agent-0.2.0/scripts/check_version.py +16 -0
- readmegen_agent-0.2.0/scripts/smoke_ui.py +33 -0
- readmegen_agent-0.2.0/src/readmegen/__init__.py +8 -0
- readmegen_agent-0.2.0/src/readmegen/__main__.py +3 -0
- readmegen_agent-0.2.0/src/readmegen/auth/__init__.py +0 -0
- readmegen_agent-0.2.0/src/readmegen/auth/chatgpt.py +356 -0
- readmegen_agent-0.2.0/src/readmegen/auth/credentials.py +60 -0
- readmegen_agent-0.2.0/src/readmegen/cli.py +286 -0
- readmegen_agent-0.2.0/src/readmegen/concurrency.py +16 -0
- readmegen_agent-0.2.0/src/readmegen/config.py +65 -0
- readmegen_agent-0.2.0/src/readmegen/errors.py +17 -0
- readmegen_agent-0.2.0/src/readmegen/generation/__init__.py +0 -0
- readmegen_agent-0.2.0/src/readmegen/generation/agents.py +167 -0
- readmegen_agent-0.2.0/src/readmegen/generation/chatgpt_model.py +169 -0
- readmegen_agent-0.2.0/src/readmegen/generation/limits.py +61 -0
- readmegen_agent-0.2.0/src/readmegen/generation/tools.py +55 -0
- readmegen_agent-0.2.0/src/readmegen/providers.py +106 -0
- readmegen_agent-0.2.0/src/readmegen/service.py +54 -0
- readmegen_agent-0.2.0/src/readmegen/sources.py +264 -0
- readmegen_agent-0.2.0/src/readmegen/storage.py +29 -0
- readmegen_agent-0.2.0/src/readmegen/web/__init__.py +0 -0
- readmegen_agent-0.2.0/src/readmegen/web/app.py +258 -0
- readmegen_agent-0.2.0/src/readmegen/web/jobs.py +124 -0
- readmegen_agent-0.2.0/src/readmegen/web/server.py +104 -0
- readmegen_agent-0.2.0/src/readmegen/web/static/assets/index-4Z1VFxq0.css +1 -0
- readmegen_agent-0.2.0/src/readmegen/web/static/assets/index-DVWzzQ9X.js +8 -0
- readmegen_agent-0.2.0/src/readmegen/web/static/index.html +14 -0
- readmegen_agent-0.2.0/src/readmegen/web/static/readmegen.svg +5 -0
- readmegen_agent-0.2.0/tests/conftest.py +28 -0
- readmegen_agent-0.2.0/tests/test_chatgpt.py +255 -0
- readmegen_agent-0.2.0/tests/test_cli.py +65 -0
- readmegen_agent-0.2.0/tests/test_generation.py +109 -0
- readmegen_agent-0.2.0/tests/test_jobs.py +29 -0
- readmegen_agent-0.2.0/tests/test_providers.py +113 -0
- readmegen_agent-0.2.0/tests/test_server.py +28 -0
- readmegen_agent-0.2.0/tests/test_service.py +59 -0
- readmegen_agent-0.2.0/tests/test_sources.py +115 -0
- readmegen_agent-0.2.0/tests/test_web.py +111 -0
- readmegen_agent-0.2.0/uv.lock +2290 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
node_modules/
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
.env
|
|
5
|
+
.env.*
|
|
6
|
+
!.env.example
|
|
7
|
+
.venv/
|
|
8
|
+
.pytest_cache/
|
|
9
|
+
.ruff_cache/
|
|
10
|
+
.coverage
|
|
11
|
+
coverage.xml
|
|
12
|
+
htmlcov/
|
|
13
|
+
dist/
|
|
14
|
+
build/
|
|
15
|
+
*.egg-info/
|
|
16
|
+
src/readmegen/web/static/
|
|
17
|
+
# Previous local checkout state; never include keys or imported source in releases.
|
|
18
|
+
.local/
|
|
19
|
+
README.generated.md
|
|
20
|
+
.playwright-mcp/
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Amine Ferjani
|
|
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.
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: readmegen-agent
|
|
3
|
+
Version: 0.2.0
|
|
4
|
+
Summary: Generate evidence-based project READMEs from your terminal or browser.
|
|
5
|
+
Project-URL: Homepage, https://github.com/FerjaniMedAmine/ReadMeGen
|
|
6
|
+
Project-URL: Repository, https://github.com/FerjaniMedAmine/ReadMeGen
|
|
7
|
+
Project-URL: Issues, https://github.com/FerjaniMedAmine/ReadMeGen/issues
|
|
8
|
+
Author: Amine Ferjani
|
|
9
|
+
License-Expression: MIT
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Keywords: cli,documentation,langgraph,llm,readme
|
|
12
|
+
Classifier: Development Status :: 4 - Beta
|
|
13
|
+
Classifier: Environment :: Console
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
19
|
+
Classifier: Topic :: Software Development :: Documentation
|
|
20
|
+
Requires-Python: >=3.12
|
|
21
|
+
Requires-Dist: filelock<4,>=3.16
|
|
22
|
+
Requires-Dist: httpx<1,>=0.28
|
|
23
|
+
Requires-Dist: keyring<26,>=25
|
|
24
|
+
Requires-Dist: langchain-anthropic<2,>=1
|
|
25
|
+
Requires-Dist: langchain-google-genai<5,>=4
|
|
26
|
+
Requires-Dist: langchain-openai<2,>=1
|
|
27
|
+
Requires-Dist: langchain<2,>=1.0
|
|
28
|
+
Requires-Dist: platformdirs<5,>=4
|
|
29
|
+
Requires-Dist: pyjwt[crypto]<3,>=2.10
|
|
30
|
+
Requires-Dist: typer<1,>=0.16
|
|
31
|
+
Provides-Extra: dev
|
|
32
|
+
Requires-Dist: build<2,>=1.2; extra == 'dev'
|
|
33
|
+
Requires-Dist: pytest-asyncio<2,>=1; extra == 'dev'
|
|
34
|
+
Requires-Dist: pytest-cov<8,>=6; extra == 'dev'
|
|
35
|
+
Requires-Dist: pytest<10,>=8; extra == 'dev'
|
|
36
|
+
Requires-Dist: ruff<1,>=0.12; extra == 'dev'
|
|
37
|
+
Requires-Dist: twine<7,>=6; extra == 'dev'
|
|
38
|
+
Provides-Extra: web
|
|
39
|
+
Requires-Dist: fastapi<1,>=0.115; extra == 'web'
|
|
40
|
+
Requires-Dist: python-multipart<1,>=0.0.20; extra == 'web'
|
|
41
|
+
Requires-Dist: uvicorn<1,>=0.34; extra == 'web'
|
|
42
|
+
Description-Content-Type: text/markdown
|
|
43
|
+
|
|
44
|
+
# ReadMeGen
|
|
45
|
+
|
|
46
|
+
**Generate a useful project README from the code you already have.**
|
|
47
|
+
|
|
48
|
+
ReadMeGen inspects a local directory, ZIP archive, or public Git repository and produces a Markdown draft grounded in source-file evidence. Use your terminal or launch the bundled browser interface with one command.
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
readmegen generate ./my-project
|
|
52
|
+
readmegen ui
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Features
|
|
56
|
+
|
|
57
|
+
- **Source-based research:** a coordinator assigns specific files to focused research agents; a separate writer turns their findings into documentation.
|
|
58
|
+
- **Two interfaces, one engine:** CLI and browser share ingestion rules, generation, settings, and provider adapters.
|
|
59
|
+
- **Your connection, your model:** Gemini, OpenAI, and Anthropic API keys; an experimental ChatGPT-plan connection for eligible local installations.
|
|
60
|
+
- **No project `.env` editing:** hidden key prompts, OS credential storage, session-only GUI connections, or environment variables for automation.
|
|
61
|
+
- **Protected outputs:** the CLI writes `README.generated.md` and refuses to replace existing files without `--force`.
|
|
62
|
+
- **Local GUI:** Python serves the compiled React app and API together. End users do not need Node.js.
|
|
63
|
+
|
|
64
|
+
Review the generated draft before committing it. Selected source files are sent to the chosen provider. Filename filtering cannot guarantee detection of every embedded secret.
|
|
65
|
+
|
|
66
|
+
## Install from GitHub
|
|
67
|
+
|
|
68
|
+
Requires Python 3.12+. Git is needed for repository imports. Node.js 22.12+ and npm are needed only to build the GUI from source.
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
git clone https://github.com/FerjaniMedAmine/ReadMeGen.git
|
|
72
|
+
cd ReadMeGen
|
|
73
|
+
python -m venv .venv
|
|
74
|
+
source .venv/bin/activate
|
|
75
|
+
python -m pip install -e '.[web]'
|
|
76
|
+
npm ci --prefix frontend
|
|
77
|
+
python scripts/build_frontend.py
|
|
78
|
+
readmegen ui
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
On Windows, activate with `.venv\Scripts\Activate.ps1`. For CLI-only installation, omit the `web` extra and frontend build.
|
|
82
|
+
|
|
83
|
+
### Install a release
|
|
84
|
+
|
|
85
|
+
Release wheels and source distributions include the GUI. Install a downloaded wheel with:
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
python -m pip install './readmegen_agent-0.2.0-py3-none-any.whl[web]'
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Install from PyPI with `pip install 'readmegen-agent[web]'` or `pipx install 'readmegen-agent[web]'`. The terminal command and Python import package are both `readmegen`.
|
|
92
|
+
|
|
93
|
+
## Choose authentication and model
|
|
94
|
+
|
|
95
|
+
Run `readmegen setup`, or use the connection panel in `readmegen ui`.
|
|
96
|
+
|
|
97
|
+
For an API key, choose Gemini, OpenAI, or Anthropic, enter the key, and select a model with tool-calling support. A catalog can include unsuitable models; listing does not guarantee inference access.
|
|
98
|
+
|
|
99
|
+
CLI setup saves credentials in the OS credential store. In the GUI, leave **Save credentials** unchecked for session-only use. ReadMeGen never silently falls back to plaintext credential files. With provider and model configured, interactive CLI generation can prompt for a session key when none is available.
|
|
100
|
+
|
|
101
|
+
For automation, supply credentials through your shell or CI secret manager:
|
|
102
|
+
|
|
103
|
+
| Provider | Environment variable |
|
|
104
|
+
| --- | --- |
|
|
105
|
+
| Gemini | `GOOGLE_API_KEY` or `GEMINI_API_KEY` |
|
|
106
|
+
| OpenAI | `OPENAI_API_KEY` |
|
|
107
|
+
| Anthropic | `ANTHROPIC_API_KEY` |
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
readmegen generate ./project --provider gemini --model YOUR_MODEL_ID
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
Environment keys take precedence over saved/session keys. `READMEGEN_PROVIDER` and `READMEGEN_MODEL` override saved preferences; command options override those preferences for a generation run.
|
|
114
|
+
|
|
115
|
+
### Sign in with ChatGPT — experimental
|
|
116
|
+
|
|
117
|
+
Choose **Continue with ChatGPT**, authorize plan usage in your browser, then select an account model. Identity sign-in alone does not authorize inference. Connections for different accounts and workspaces remain separate; usage counts toward the account's plan limits.
|
|
118
|
+
|
|
119
|
+
The adapter follows OpenAI's local/open-source preview contract: loopback OAuth with PKCE, ID-token verification, token refresh, account-specific catalogs, and streamed Responses requests with `store=false`. It preserves reasoning/tool history and accepts only completed responses.
|
|
120
|
+
|
|
121
|
+
OAuth and transport behavior are covered by simulated tests. **Validate live sign-in and generation with an eligible account before treating this connection as stable.** Paid or remotely hosted apps require separate onboarding. See [OpenAI's integration documentation](https://developers.openai.com/siwc/token-sharing-open-source) and [preview limitations](https://developers.openai.com/siwc/token-sharing-open-source/preview-limitations).
|
|
122
|
+
|
|
123
|
+
## Usage
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
readmegen generate .
|
|
127
|
+
readmegen generate project.zip --output docs/README.draft.md
|
|
128
|
+
readmegen generate https://github.com/owner/repo
|
|
129
|
+
readmegen generate . --output README.md --force
|
|
130
|
+
readmegen models
|
|
131
|
+
readmegen logout
|
|
132
|
+
readmegen ui --no-browser --port 8080
|
|
133
|
+
readmegen shell
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
In the interactive shell, `/ui` launches the GUI and prints its address. `/ui --no-browser` prints it without opening a browser; repeating `/ui` reuses the shell's server. Other commands: `/setup`, `/models`, `/generate`, `/logout`, `/help`, `/exit`.
|
|
137
|
+
|
|
138
|
+
The GUI binds only to `127.0.0.1`. The default port is 8765; if occupied, the launcher selects a free port. An explicitly requested occupied port fails clearly; `--port 0` chooses a free port. Keep the terminal running. Ctrl+C or shell exit stops the server.
|
|
139
|
+
|
|
140
|
+
## How it works
|
|
141
|
+
|
|
142
|
+
```mermaid
|
|
143
|
+
flowchart LR
|
|
144
|
+
CLI[CLI / shell] --> Service[Shared generation service]
|
|
145
|
+
UI[React GUI] --> API[FastAPI]
|
|
146
|
+
API --> Service
|
|
147
|
+
Service --> Import[Import and filter]
|
|
148
|
+
Import --> Coordinator[Coordinator]
|
|
149
|
+
Coordinator --> Readers[Scoped research agents]
|
|
150
|
+
Readers --> Writer[Evidence-based writer]
|
|
151
|
+
Writer --> Output[Markdown draft]
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
The coordinator assigns up to eight specialists, each with up to twelve unique paths. Readers access only assigned files within the project and return bounded, numbered source excerpts. The writer uses their research reports; missing essential information becomes an open question.
|
|
155
|
+
|
|
156
|
+
Limits include 50 MB compressed ZIPs, 300 MB retained extracted/downloaded data, 3,000 readable files, 500 KB per source file, bounded graph recursion, and a generation timeout. ZIP traversal, symlinks, duplicate paths, and encrypted files are rejected. Git imports restrict HTTPS hosts and disable redirects, hooks, helpers, and submodules. Ingestion never executes repository code. These controls bound resources, not monetary cost: one generation may make multiple model requests.
|
|
157
|
+
|
|
158
|
+
## Structure
|
|
159
|
+
|
|
160
|
+
```text
|
|
161
|
+
src/readmegen/
|
|
162
|
+
cli.py CLI and interactive shell
|
|
163
|
+
config.py Validated preferences
|
|
164
|
+
auth/ OS credentials and ChatGPT OAuth
|
|
165
|
+
providers.py Model clients and catalogs
|
|
166
|
+
sources.py Local, ZIP, Git ingestion
|
|
167
|
+
generation/ Coordinator, readers, writer, plan adapter
|
|
168
|
+
service.py Shared generation use case
|
|
169
|
+
web/ Local API, persistent jobs, GUI launcher
|
|
170
|
+
frontend/ React interface and API client
|
|
171
|
+
tests/ Workflow, CLI, security, OAuth, API tests
|
|
172
|
+
scripts/ GUI build and distribution verification
|
|
173
|
+
docs/ Architecture and release instructions
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
Preferences and public registration metadata use the platform's user configuration directory. Web jobs and generated documents use the user cache directory. Imported source is temporary; uploads are removed after processing. Jobs older than seven days are removed when the server next starts. `READMEGEN_HOME` overrides these locations for isolated development/testing.
|
|
177
|
+
|
|
178
|
+
## Development and checks
|
|
179
|
+
|
|
180
|
+
```bash
|
|
181
|
+
python -m pip install -e '.[web,dev]'
|
|
182
|
+
npm ci --prefix frontend
|
|
183
|
+
ruff check src tests scripts
|
|
184
|
+
ruff format --check src tests scripts
|
|
185
|
+
pytest --cov=readmegen --cov-report=term-missing
|
|
186
|
+
npm run lint --prefix frontend
|
|
187
|
+
npm test --prefix frontend
|
|
188
|
+
python scripts/build_frontend.py
|
|
189
|
+
python -m build
|
|
190
|
+
twine check dist/*
|
|
191
|
+
python scripts/check_distribution.py dist
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
For frontend development, run `readmegen ui --no-browser --port 8765` and `npm run dev --prefix frontend`. Vite proxies `/api` to Python. Rebuild bundled assets after changes; end-user installations never start Vite.
|
|
195
|
+
|
|
196
|
+
CI tests Python 3.12–3.14, lints both interfaces, audits npm dependencies, verifies distributions, and installs a wheel outside the checkout. Tests use simulated models and credentials and need no paid inference.
|
|
197
|
+
|
|
198
|
+
Read [architecture and tradeoffs](docs/architecture.md) and [release instructions](docs/releasing.md). Licensed under [MIT](LICENSE).
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
# ReadMeGen
|
|
2
|
+
|
|
3
|
+
**Generate a useful project README from the code you already have.**
|
|
4
|
+
|
|
5
|
+
ReadMeGen inspects a local directory, ZIP archive, or public Git repository and produces a Markdown draft grounded in source-file evidence. Use your terminal or launch the bundled browser interface with one command.
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
readmegen generate ./my-project
|
|
9
|
+
readmegen ui
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## Features
|
|
13
|
+
|
|
14
|
+
- **Source-based research:** a coordinator assigns specific files to focused research agents; a separate writer turns their findings into documentation.
|
|
15
|
+
- **Two interfaces, one engine:** CLI and browser share ingestion rules, generation, settings, and provider adapters.
|
|
16
|
+
- **Your connection, your model:** Gemini, OpenAI, and Anthropic API keys; an experimental ChatGPT-plan connection for eligible local installations.
|
|
17
|
+
- **No project `.env` editing:** hidden key prompts, OS credential storage, session-only GUI connections, or environment variables for automation.
|
|
18
|
+
- **Protected outputs:** the CLI writes `README.generated.md` and refuses to replace existing files without `--force`.
|
|
19
|
+
- **Local GUI:** Python serves the compiled React app and API together. End users do not need Node.js.
|
|
20
|
+
|
|
21
|
+
Review the generated draft before committing it. Selected source files are sent to the chosen provider. Filename filtering cannot guarantee detection of every embedded secret.
|
|
22
|
+
|
|
23
|
+
## Install from GitHub
|
|
24
|
+
|
|
25
|
+
Requires Python 3.12+. Git is needed for repository imports. Node.js 22.12+ and npm are needed only to build the GUI from source.
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
git clone https://github.com/FerjaniMedAmine/ReadMeGen.git
|
|
29
|
+
cd ReadMeGen
|
|
30
|
+
python -m venv .venv
|
|
31
|
+
source .venv/bin/activate
|
|
32
|
+
python -m pip install -e '.[web]'
|
|
33
|
+
npm ci --prefix frontend
|
|
34
|
+
python scripts/build_frontend.py
|
|
35
|
+
readmegen ui
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
On Windows, activate with `.venv\Scripts\Activate.ps1`. For CLI-only installation, omit the `web` extra and frontend build.
|
|
39
|
+
|
|
40
|
+
### Install a release
|
|
41
|
+
|
|
42
|
+
Release wheels and source distributions include the GUI. Install a downloaded wheel with:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
python -m pip install './readmegen_agent-0.2.0-py3-none-any.whl[web]'
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Install from PyPI with `pip install 'readmegen-agent[web]'` or `pipx install 'readmegen-agent[web]'`. The terminal command and Python import package are both `readmegen`.
|
|
49
|
+
|
|
50
|
+
## Choose authentication and model
|
|
51
|
+
|
|
52
|
+
Run `readmegen setup`, or use the connection panel in `readmegen ui`.
|
|
53
|
+
|
|
54
|
+
For an API key, choose Gemini, OpenAI, or Anthropic, enter the key, and select a model with tool-calling support. A catalog can include unsuitable models; listing does not guarantee inference access.
|
|
55
|
+
|
|
56
|
+
CLI setup saves credentials in the OS credential store. In the GUI, leave **Save credentials** unchecked for session-only use. ReadMeGen never silently falls back to plaintext credential files. With provider and model configured, interactive CLI generation can prompt for a session key when none is available.
|
|
57
|
+
|
|
58
|
+
For automation, supply credentials through your shell or CI secret manager:
|
|
59
|
+
|
|
60
|
+
| Provider | Environment variable |
|
|
61
|
+
| --- | --- |
|
|
62
|
+
| Gemini | `GOOGLE_API_KEY` or `GEMINI_API_KEY` |
|
|
63
|
+
| OpenAI | `OPENAI_API_KEY` |
|
|
64
|
+
| Anthropic | `ANTHROPIC_API_KEY` |
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
readmegen generate ./project --provider gemini --model YOUR_MODEL_ID
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Environment keys take precedence over saved/session keys. `READMEGEN_PROVIDER` and `READMEGEN_MODEL` override saved preferences; command options override those preferences for a generation run.
|
|
71
|
+
|
|
72
|
+
### Sign in with ChatGPT — experimental
|
|
73
|
+
|
|
74
|
+
Choose **Continue with ChatGPT**, authorize plan usage in your browser, then select an account model. Identity sign-in alone does not authorize inference. Connections for different accounts and workspaces remain separate; usage counts toward the account's plan limits.
|
|
75
|
+
|
|
76
|
+
The adapter follows OpenAI's local/open-source preview contract: loopback OAuth with PKCE, ID-token verification, token refresh, account-specific catalogs, and streamed Responses requests with `store=false`. It preserves reasoning/tool history and accepts only completed responses.
|
|
77
|
+
|
|
78
|
+
OAuth and transport behavior are covered by simulated tests. **Validate live sign-in and generation with an eligible account before treating this connection as stable.** Paid or remotely hosted apps require separate onboarding. See [OpenAI's integration documentation](https://developers.openai.com/siwc/token-sharing-open-source) and [preview limitations](https://developers.openai.com/siwc/token-sharing-open-source/preview-limitations).
|
|
79
|
+
|
|
80
|
+
## Usage
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
readmegen generate .
|
|
84
|
+
readmegen generate project.zip --output docs/README.draft.md
|
|
85
|
+
readmegen generate https://github.com/owner/repo
|
|
86
|
+
readmegen generate . --output README.md --force
|
|
87
|
+
readmegen models
|
|
88
|
+
readmegen logout
|
|
89
|
+
readmegen ui --no-browser --port 8080
|
|
90
|
+
readmegen shell
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
In the interactive shell, `/ui` launches the GUI and prints its address. `/ui --no-browser` prints it without opening a browser; repeating `/ui` reuses the shell's server. Other commands: `/setup`, `/models`, `/generate`, `/logout`, `/help`, `/exit`.
|
|
94
|
+
|
|
95
|
+
The GUI binds only to `127.0.0.1`. The default port is 8765; if occupied, the launcher selects a free port. An explicitly requested occupied port fails clearly; `--port 0` chooses a free port. Keep the terminal running. Ctrl+C or shell exit stops the server.
|
|
96
|
+
|
|
97
|
+
## How it works
|
|
98
|
+
|
|
99
|
+
```mermaid
|
|
100
|
+
flowchart LR
|
|
101
|
+
CLI[CLI / shell] --> Service[Shared generation service]
|
|
102
|
+
UI[React GUI] --> API[FastAPI]
|
|
103
|
+
API --> Service
|
|
104
|
+
Service --> Import[Import and filter]
|
|
105
|
+
Import --> Coordinator[Coordinator]
|
|
106
|
+
Coordinator --> Readers[Scoped research agents]
|
|
107
|
+
Readers --> Writer[Evidence-based writer]
|
|
108
|
+
Writer --> Output[Markdown draft]
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
The coordinator assigns up to eight specialists, each with up to twelve unique paths. Readers access only assigned files within the project and return bounded, numbered source excerpts. The writer uses their research reports; missing essential information becomes an open question.
|
|
112
|
+
|
|
113
|
+
Limits include 50 MB compressed ZIPs, 300 MB retained extracted/downloaded data, 3,000 readable files, 500 KB per source file, bounded graph recursion, and a generation timeout. ZIP traversal, symlinks, duplicate paths, and encrypted files are rejected. Git imports restrict HTTPS hosts and disable redirects, hooks, helpers, and submodules. Ingestion never executes repository code. These controls bound resources, not monetary cost: one generation may make multiple model requests.
|
|
114
|
+
|
|
115
|
+
## Structure
|
|
116
|
+
|
|
117
|
+
```text
|
|
118
|
+
src/readmegen/
|
|
119
|
+
cli.py CLI and interactive shell
|
|
120
|
+
config.py Validated preferences
|
|
121
|
+
auth/ OS credentials and ChatGPT OAuth
|
|
122
|
+
providers.py Model clients and catalogs
|
|
123
|
+
sources.py Local, ZIP, Git ingestion
|
|
124
|
+
generation/ Coordinator, readers, writer, plan adapter
|
|
125
|
+
service.py Shared generation use case
|
|
126
|
+
web/ Local API, persistent jobs, GUI launcher
|
|
127
|
+
frontend/ React interface and API client
|
|
128
|
+
tests/ Workflow, CLI, security, OAuth, API tests
|
|
129
|
+
scripts/ GUI build and distribution verification
|
|
130
|
+
docs/ Architecture and release instructions
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
Preferences and public registration metadata use the platform's user configuration directory. Web jobs and generated documents use the user cache directory. Imported source is temporary; uploads are removed after processing. Jobs older than seven days are removed when the server next starts. `READMEGEN_HOME` overrides these locations for isolated development/testing.
|
|
134
|
+
|
|
135
|
+
## Development and checks
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
python -m pip install -e '.[web,dev]'
|
|
139
|
+
npm ci --prefix frontend
|
|
140
|
+
ruff check src tests scripts
|
|
141
|
+
ruff format --check src tests scripts
|
|
142
|
+
pytest --cov=readmegen --cov-report=term-missing
|
|
143
|
+
npm run lint --prefix frontend
|
|
144
|
+
npm test --prefix frontend
|
|
145
|
+
python scripts/build_frontend.py
|
|
146
|
+
python -m build
|
|
147
|
+
twine check dist/*
|
|
148
|
+
python scripts/check_distribution.py dist
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
For frontend development, run `readmegen ui --no-browser --port 8765` and `npm run dev --prefix frontend`. Vite proxies `/api` to Python. Rebuild bundled assets after changes; end-user installations never start Vite.
|
|
152
|
+
|
|
153
|
+
CI tests Python 3.12–3.14, lints both interfaces, audits npm dependencies, verifies distributions, and installs a wheel outside the checkout. Tests use simulated models and credentials and need no paid inference.
|
|
154
|
+
|
|
155
|
+
Read [architecture and tradeoffs](docs/architecture.md) and [release instructions](docs/releasing.md). Licensed under [MIT](LICENSE).
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Architecture and tradeoffs
|
|
2
|
+
|
|
3
|
+
ReadMeGen is a local developer tool. CLI and HTTP are adapters over `service.generate`, which owns model construction, source preparation, filtering, generation timeout, and temporary-file cleanup. Imports raise application errors; FastAPI translates them at the boundary.
|
|
4
|
+
|
|
5
|
+
## Boundaries
|
|
6
|
+
|
|
7
|
+
- `config` stores validated preferences; importing it creates no directories.
|
|
8
|
+
- `auth` owns secrets and OAuth. Browser responses contain public connection metadata, never tokens. The OS store is optional; session credentials remain in memory.
|
|
9
|
+
- `sources` reads local input without copying or executing it. ZIP and Git inputs are isolated in temporary workspaces.
|
|
10
|
+
- `generation` owns prompts and scoped tools. Models are injected rather than constructed inside agents.
|
|
11
|
+
- `web` owns persistent job status and the loopback server, using the same generation service as the CLI.
|
|
12
|
+
|
|
13
|
+
SQLite preserves job metadata and completed results across restart. Interrupted jobs become failed jobs and are not rerun or charged automatically. One generation is accepted at a time rather than accumulating an unbounded queue. Preferences are snapshotted at submission; connection changes are blocked during generation.
|
|
14
|
+
|
|
15
|
+
## Resource and trust controls
|
|
16
|
+
|
|
17
|
+
ZIP entries are validated before extraction. Dependency/credential files are excluded, duplicates rejected, and bytes counted during extraction. Git runs without shell interpolation, hooks, redirects, credential helpers, or submodules. Download checks are periodic: transient disk use can exceed the threshold before termination. This is not a hardened multi-tenant importer.
|
|
18
|
+
|
|
19
|
+
Traversal prunes dependencies and does not follow symlinks. Readers check containment at access and bound file size and output chunks. Source and model reports remain untrusted; prompt wording and filename filtering cannot eliminate prompt injection or embedded secrets. Review the generated document before use.
|
|
20
|
+
|
|
21
|
+
Provider timeouts, retries, graph recursion, specialist/file limits, and an overall generation timeout bound work; there is no exact spending cap. Cancelled filesystem threads are joined before temporary-file cleanup. Git subprocesses are terminated and awaited.
|
|
22
|
+
|
|
23
|
+
## Local HTTP interface
|
|
24
|
+
|
|
25
|
+
The launcher binds to `127.0.0.1`, uses one worker, rejects untrusted Host headers and cross-site API requests, and disables proxy-header trust. Validation errors omit submitted values. Frontend and API share an origin. The content security policy restricts scripts/network access and framing. Access logs are disabled to avoid recording sensitive authorization material.
|
|
26
|
+
|
|
27
|
+
Hosted user isolation, team permissions, internet-facing authentication, durable job scheduling, and billing would require separate architecture.
|
|
28
|
+
|
|
29
|
+
## Provider compatibility
|
|
30
|
+
|
|
31
|
+
API-key providers use their LangChain integrations and require tool-capable models. A catalog is useful for selection, not proof of access or compatibility. Reasoning-model defaults are preserved where generic sampling settings are rejected.
|
|
32
|
+
|
|
33
|
+
The ChatGPT-plan adapter is separate because the preview Responses contract differs from API-key requests. It groups tools into a namespace, uses streaming with `store=false`, replays original reasoning/tool items, serializes refreshes with a cross-process lock, and rejects incomplete streams. Identity verification checks signature, issuer, audience, expiry, and nonce. Client/workspace registrations remain distinct; email is a display label.
|
|
34
|
+
|
|
35
|
+
Live account eligibility, access, rotation, and usage-limit behavior must be verified before a stable release claim. Automated tests use controlled provider responses.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# ReadMeGen 0.2.0 beta
|
|
2
|
+
|
|
3
|
+
Generate source-based README drafts from a local directory, ZIP archive, or public Git repository using the CLI or bundled local browser interface.
|
|
4
|
+
|
|
5
|
+
- Shared Python generation engine for terminal and browser use.
|
|
6
|
+
- Gemini, OpenAI, and Anthropic API-key connections, with OS credential storage or session-only connections.
|
|
7
|
+
- Experimental ChatGPT-plan connection.
|
|
8
|
+
- Scoped research agents, protected output files, and bounded source ingestion.
|
|
9
|
+
- Bundled GUI in the wheel and source distribution; Node.js is only needed when building from source.
|
|
10
|
+
|
|
11
|
+
## Validation
|
|
12
|
+
|
|
13
|
+
The release candidate passed 60 Python tests on Python 3.12/Linux, with 76% coverage. Python and frontend lint checks, frontend tests, GUI build, wheel and source distribution checks, and installation into a fresh environment passed. The installed GUI served its HTML, assets, and health API and shut down cleanly. Dependency audits of the development environment and frontend reported no known vulnerabilities on 2026-10-13.
|
|
14
|
+
|
|
15
|
+
GitHub CI passed on Python 3.12–3.14 for commit `6f20402`. The PyPI distribution name is `readmegen-agent`; the CLI and import package remain `readmegen`. TestPyPI installation was not performed. Real provider generation, credential persistence/restart, and live ChatGPT sign-in have not been validated in this release session. ChatGPT support remains experimental. Windows and macOS were not tested in this session.
|
|
16
|
+
|
|
17
|
+
## Installation
|
|
18
|
+
|
|
19
|
+
After successful PyPI publication:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
python -m pip install 'readmegen-agent[web]'
|
|
23
|
+
readmegen setup
|
|
24
|
+
readmegen generate ./my-project
|
|
25
|
+
readmegen ui
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Python 3.12 or later is required. Git is required for repository URL imports. Review generated drafts before committing them; selected source files are sent to the configured provider.
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# Releasing
|
|
2
|
+
|
|
3
|
+
GitHub and Python distributions share one version. Wheels and source distributions include built GUI assets; Node.js is needed to build them, not to run them.
|
|
4
|
+
|
|
5
|
+
## Maintainer setup
|
|
6
|
+
|
|
7
|
+
1. Use `readmegen-agent` as the PyPI distribution name. The CLI and import package remain `readmegen`; PyPI rejected `readmegen` because it is too similar to an existing project.
|
|
8
|
+
2. Configure a PyPI Trusted Publisher for `FerjaniMedAmine/ReadMeGen`, workflow `publish.yml`, environment `pypi`.
|
|
9
|
+
Configure a separate pending publisher on TestPyPI using the same repository and workflow, with environment `testpypi`.
|
|
10
|
+
3. Require a reviewer on GitHub's `pypi` environment so publishing has a final human approval step.
|
|
11
|
+
4. Validate sign-in, model selection, generation, logout, and restart against real providers and an eligible ChatGPT account. Record tested models in release notes without credentials or private source.
|
|
12
|
+
|
|
13
|
+
Production publication runs when a GitHub release is published. A manual run of the **Publish** workflow builds, tests, installs, and uploads the package to TestPyPI. Adding or pushing source does not publish a package. See [PyPI Trusted Publishing](https://docs.pypi.org/trusted-publishers/using-a-publisher/).
|
|
14
|
+
|
|
15
|
+
## Build and review
|
|
16
|
+
|
|
17
|
+
Update versions in `pyproject.toml` and `frontend/package.json`, refresh lockfiles, and run CI checks. Then:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
npm ci --prefix frontend
|
|
21
|
+
python scripts/build_frontend.py
|
|
22
|
+
python -m build
|
|
23
|
+
twine check dist/*
|
|
24
|
+
python scripts/check_distribution.py dist
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Check that neither archive includes local keys, imported projects, virtual environments, or Node modules. The GUI must include `readmegen/web/static/index.html` and its referenced assets.
|
|
28
|
+
|
|
29
|
+
Install the wheel in a fresh environment, change outside the checkout, and verify help, version, and `readmegen ui --no-browser`. Verify that CLI-only installations give clear GUI dependency instructions.
|
|
30
|
+
|
|
31
|
+
Create `v<project-version>` only after verification. Publication validates the tag, builds and tests before obtaining PyPI credentials, and uses OIDC rather than a long-lived PyPI token. Trial a first release against TestPyPI before production publication.
|
|
32
|
+
|
|
33
|
+
## First publication
|
|
34
|
+
|
|
35
|
+
1. Push the release candidate and wait for every CI job, including Python 3.12–3.14, to pass.
|
|
36
|
+
2. In GitHub Actions, select **Publish**, then **Run workflow** on the verified branch. This targets TestPyPI only.
|
|
37
|
+
3. In a fresh environment, install the locally built wheel with its `web` extra to obtain dependencies from PyPI, then reinstall the trial package without resolving dependencies:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
python -m pip install './dist/readmegen_agent-0.2.0-py3-none-any.whl[web]'
|
|
41
|
+
python -m pip install --force-reinstall --no-deps --index-url https://test.pypi.org/simple/ readmegen-agent==0.2.0
|
|
42
|
+
readmegen --version
|
|
43
|
+
readmegen ui --no-browser
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
4. Record live provider validation and any remaining limitations in release notes.
|
|
47
|
+
5. Publish the GitHub release `v0.2.0`; select **pre-release** for the initial beta. The workflow uploads to PyPI after the `pypi` environment approval and attaches the wheel and source archive to the GitHub release.
|
|
48
|
+
6. Check both publishing jobs and verify `python -m pip install 'readmegen-agent[web]'` from PyPI in a fresh environment before announcing availability. If a version was already uploaded manually, publish a new version through the workflow; PyPI does not allow reusing uploaded files.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Logs
|
|
2
|
+
logs
|
|
3
|
+
*.log
|
|
4
|
+
npm-debug.log*
|
|
5
|
+
yarn-debug.log*
|
|
6
|
+
yarn-error.log*
|
|
7
|
+
pnpm-debug.log*
|
|
8
|
+
lerna-debug.log*
|
|
9
|
+
|
|
10
|
+
node_modules
|
|
11
|
+
dist
|
|
12
|
+
dist-ssr
|
|
13
|
+
*.local
|
|
14
|
+
|
|
15
|
+
# Editor directories and files
|
|
16
|
+
.vscode/*
|
|
17
|
+
!.vscode/extensions.json
|
|
18
|
+
.idea
|
|
19
|
+
.DS_Store
|
|
20
|
+
*.suo
|
|
21
|
+
*.ntvs*
|
|
22
|
+
*.njsproj
|
|
23
|
+
*.sln
|
|
24
|
+
*.sw?
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import js from '@eslint/js'
|
|
2
|
+
import globals from 'globals'
|
|
3
|
+
import react from 'eslint-plugin-react'
|
|
4
|
+
import reactHooks from 'eslint-plugin-react-hooks'
|
|
5
|
+
import reactRefresh from 'eslint-plugin-react-refresh'
|
|
6
|
+
|
|
7
|
+
export default [
|
|
8
|
+
{ ignores: ['dist'] },
|
|
9
|
+
{
|
|
10
|
+
files: ['**/*.{js,jsx}'],
|
|
11
|
+
languageOptions: {
|
|
12
|
+
ecmaVersion: 2020,
|
|
13
|
+
globals: globals.browser,
|
|
14
|
+
parserOptions: {
|
|
15
|
+
ecmaVersion: 'latest',
|
|
16
|
+
ecmaFeatures: { jsx: true },
|
|
17
|
+
sourceType: 'module',
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
settings: { react: { version: '18.3' } },
|
|
21
|
+
plugins: {
|
|
22
|
+
react,
|
|
23
|
+
'react-hooks': reactHooks,
|
|
24
|
+
'react-refresh': reactRefresh,
|
|
25
|
+
},
|
|
26
|
+
rules: {
|
|
27
|
+
...js.configs.recommended.rules,
|
|
28
|
+
...react.configs.recommended.rules,
|
|
29
|
+
...react.configs['jsx-runtime'].rules,
|
|
30
|
+
...reactHooks.configs.recommended.rules,
|
|
31
|
+
'react/jsx-no-target-blank': 'off',
|
|
32
|
+
'react-refresh/only-export-components': [
|
|
33
|
+
'warn',
|
|
34
|
+
{ allowConstantExport: true },
|
|
35
|
+
],
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
]
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<link rel="icon" type="image/svg+xml" href="/readmegen.svg" />
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
|
+
<title>ReadMeGen — Project README Generator</title>
|
|
8
|
+
</head>
|
|
9
|
+
<body>
|
|
10
|
+
<div id="root"></div>
|
|
11
|
+
<script type="module" src="/src/main.jsx"></script>
|
|
12
|
+
</body>
|
|
13
|
+
</html>
|