reza 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.
reza-0.1.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Suweb Reza
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.
reza-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,547 @@
1
+ Metadata-Version: 2.4
2
+ Name: reza
3
+ Version: 0.1.0
4
+ Summary: Universal LLM context database — instant project awareness for Claude, Cursor, Codex, Aider, Kilocode and any AI coding tool
5
+ Author: Suweb Reza
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/swebreza/reza
8
+ Project-URL: Repository, https://github.com/swebreza/reza
9
+ Project-URL: Issues, https://github.com/swebreza/reza/issues
10
+ Project-URL: Changelog, https://github.com/swebreza/reza/blob/main/CHANGELOG.md
11
+ Keywords: llm,context,claude,codex,cursor,aider,kilocode,ai-tools,developer-tools,sqlite,project-awareness,session
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Environment :: Console
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: License :: OSI Approved :: MIT License
16
+ Classifier: Operating System :: OS Independent
17
+ Classifier: Programming Language :: Python :: 3
18
+ Classifier: Programming Language :: Python :: 3.8
19
+ Classifier: Programming Language :: Python :: 3.9
20
+ Classifier: Programming Language :: Python :: 3.10
21
+ Classifier: Programming Language :: Python :: 3.11
22
+ Classifier: Programming Language :: Python :: 3.12
23
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
24
+ Classifier: Topic :: Utilities
25
+ Requires-Python: >=3.8
26
+ Description-Content-Type: text/markdown
27
+ License-File: LICENSE
28
+ Requires-Dist: click>=8.0
29
+ Requires-Dist: watchdog>=3.0
30
+ Requires-Dist: rich>=13.0
31
+ Provides-Extra: dev
32
+ Requires-Dist: pytest>=7.0; extra == "dev"
33
+ Requires-Dist: pytest-cov>=4.0; extra == "dev"
34
+ Requires-Dist: black>=23.0; extra == "dev"
35
+ Requires-Dist: ruff>=0.1.0; extra == "dev"
36
+ Dynamic: license-file
37
+
38
+ # reza
39
+
40
+ **Universal LLM Context Database** — give any AI coding tool instant awareness of your project.
41
+
42
+ Index your project once. Never re-explain it again.
43
+
44
+ [![PyPI version](https://img.shields.io/pypi/v/reza.svg)](https://pypi.org/project/reza/)
45
+ [![Python 3.8+](https://img.shields.io/badge/python-3.8+-blue.svg)](https://www.python.org/downloads/)
46
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
47
+ [![Works with](https://img.shields.io/badge/works%20with-Claude%20%7C%20Cursor%20%7C%20Codex%20%7C%20Aider%20%7C%20Kilocode-green.svg)](#integrations)
48
+
49
+ ---
50
+
51
+ ## The Problem
52
+
53
+ Every time you start a new AI session, you waste 5–15 minutes re-explaining your project:
54
+
55
+ - What the stack is
56
+ - Where the key files are
57
+ - What was already tried
58
+ - Why certain decisions were made
59
+
60
+ Switch from Claude to Cursor mid-task? Start over. Hit a context limit? Your architectural decisions vanish. Use two AI tools at once? They have no idea what each other did.
61
+
62
+ **This is a solved problem. reza solves it.**
63
+
64
+ ---
65
+
66
+ ## The Solution
67
+
68
+ reza creates a local SQLite database (`.reza/context.db`) in your project that stores:
69
+
70
+ - Every file path, type, line count, and **purpose** (extracted from docstrings and comments)
71
+ - All active LLM sessions and their progress
72
+ - A real-time change log synced via file watcher and git hooks
73
+ - Handoff notes so any LLM can continue where another left off
74
+
75
+ Any AI tool can query this database instead of scanning your files.
76
+
77
+ ---
78
+
79
+ ## Quick Start
80
+
81
+ ```bash
82
+ pip install reza
83
+ cd your-project
84
+ reza init
85
+ ```
86
+
87
+ That's it. Your project is now indexed.
88
+
89
+ ```bash
90
+ reza status # what reza knows about your project
91
+ reza query # full context overview
92
+ reza watch & # optional: real-time file sync
93
+ ```
94
+
95
+ ---
96
+
97
+ ## Install as an AI CLI Skill
98
+
99
+ Install reza once into your AI tool so it auto-activates on every project — no manual setup per session.
100
+
101
+ ### Claude Code
102
+
103
+ Installs `/reza` as a slash command. Type `/reza` in any Claude Code session to instantly load your project context.
104
+
105
+ **One-line install:**
106
+
107
+ ```bash
108
+ mkdir -p ~/.claude/skills/reza && curl -fsSL \
109
+ https://raw.githubusercontent.com/swebreza/reza/main/integrations/claude-code/SKILL.md \
110
+ -o ~/.claude/skills/reza/SKILL.md
111
+ ```
112
+
113
+ **Or manually:**
114
+
115
+ ```bash
116
+ mkdir -p ~/.claude/skills/reza
117
+ cp integrations/claude-code/SKILL.md ~/.claude/skills/reza/SKILL.md
118
+ ```
119
+
120
+ Restart Claude Code, then type `/` — you'll see **reza** in the skill list.
121
+
122
+ It also **auto-triggers** whenever you say:
123
+ - "pick up where I left off"
124
+ - "what is this project"
125
+ - "continue from last session"
126
+ - "what was I working on"
127
+
128
+ ---
129
+
130
+ ### Cursor
131
+
132
+ Copy the `.cursorrules` file into your project root:
133
+
134
+ ```bash
135
+ cp integrations/cursor/.cursorrules your-project/.cursorrules
136
+ ```
137
+
138
+ Or add globally to `~/.cursor/rules/reza.mdc`:
139
+
140
+ ```bash
141
+ mkdir -p ~/.cursor/rules
142
+ cp integrations/cursor/.cursorrules ~/.cursor/rules/reza.mdc
143
+ ```
144
+
145
+ Cursor will now prompt reza queries automatically at session start.
146
+
147
+ ---
148
+
149
+ ### Kilocode
150
+
151
+ ```bash
152
+ # Copy into your project:
153
+ cp integrations/kilocode/rules.md your-project/.kilocode/reza.md
154
+
155
+ # Or add globally to Kilocode's rules directory:
156
+ cp integrations/kilocode/rules.md ~/.kilocode/rules/reza.md
157
+ ```
158
+
159
+ ---
160
+
161
+ ### Aider
162
+
163
+ ```bash
164
+ # Add to your project's .aider.conf.yml:
165
+ echo "read:" >> .aider.conf.yml
166
+ echo " - .reza/CONTEXT.md" >> .aider.conf.yml
167
+
168
+ # Generate the context file before each session:
169
+ reza export
170
+
171
+ # Then just run aider normally — context is always included:
172
+ aider
173
+ ```
174
+
175
+ Or pass it inline per session:
176
+
177
+ ```bash
178
+ reza export && aider --read .reza/CONTEXT.md
179
+ ```
180
+
181
+ ---
182
+
183
+ ### GitHub Copilot
184
+
185
+ ```bash
186
+ # Creates .github/copilot-instructions.md (Copilot reads this automatically):
187
+ mkdir -p .github
188
+ cp integrations/github-copilot/README.md .github/copilot-instructions.md
189
+ ```
190
+
191
+ Then in Copilot Chat, reference the exported context:
192
+
193
+ ```
194
+ #file:.reza/CONTEXT.md what files handle authentication?
195
+ ```
196
+
197
+ ---
198
+
199
+ ### Continue.dev
200
+
201
+ ```bash
202
+ # Generate context file:
203
+ reza export
204
+
205
+ # Reference in chat:
206
+ @.reza/CONTEXT.md
207
+ ```
208
+
209
+ Or add to `~/.continue/config.json` to auto-include on every session — see [integrations/continue/README.md](integrations/continue/README.md).
210
+
211
+ ---
212
+
213
+ ### Codeium / Windsurf
214
+
215
+ ```bash
216
+ reza export --format context # generates .reza/CONTEXT.md
217
+ ```
218
+
219
+ In Windsurf Cascade:
220
+ ```
221
+ @.reza/CONTEXT.md
222
+ ```
223
+
224
+ In Codeium: keep `.reza/CONTEXT.md` open in an editor tab — Codeium reads open files.
225
+
226
+ ---
227
+
228
+ ### OpenAI Codex CLI
229
+
230
+ ```bash
231
+ # Create a shell alias that auto-injects reza context:
232
+ alias codex-reza='reza export --format context -o /tmp/.reza_ctx.md && codex --system-prompt "$(cat /tmp/.reza_ctx.md)"'
233
+
234
+ # Use it:
235
+ codex-reza "find the authentication middleware"
236
+ ```
237
+
238
+ ---
239
+
240
+ ## Measured Token Savings
241
+
242
+ Tested on a real 1,710-file monorepo (Django + 2× FastAPI + 4× React):
243
+
244
+ | Scenario | Without reza | With reza | Reduction |
245
+ |----------|-------------|-----------|-----------|
246
+ | Task orientation (find relevant files) | ~18,000 tokens | ~4,900 tokens | **73%** |
247
+ | Cross-LLM handoff | ~10,000 tokens | ~1,250 tokens | **88%** |
248
+ | Find a specific file | ~7,200 tokens | ~450 tokens | **94%** |
249
+
250
+ **At 500 sessions/month on Claude Sonnet: ~$14/month saved in API costs.**
251
+ More importantly: **58+ hours of developer wait time returned.**
252
+
253
+ ---
254
+
255
+ ## CLI Reference
256
+
257
+ ### Core commands
258
+
259
+ ```bash
260
+ reza init # Initialize reza in the current project
261
+ reza status # Quick project overview
262
+ reza watch # Start real-time file watcher
263
+ reza upgrade # Re-scan all files (after big refactors)
264
+ ```
265
+
266
+ ### Querying
267
+
268
+ ```bash
269
+ reza query # Full project overview
270
+ reza query --find "auth" # Search files by path or purpose
271
+ reza query --recent # Last 30 file changes
272
+ reza query --sessions # Active / interrupted sessions
273
+ reza query --file src/api.py # Full info about one file
274
+ reza query --json # Machine-readable JSON output
275
+ ```
276
+
277
+ ### Session management
278
+
279
+ ```bash
280
+ # Start a session (get back a session ID)
281
+ reza session start --llm claude --task "implementing JWT auth"
282
+
283
+ # Save progress
284
+ reza session save --id claude-abc12345 \
285
+ --summary "Models and serializers done, starting views" \
286
+ --context "Decided on JWT over sessions — see auth/tokens.py. Avoid circular import in models.py" \
287
+ --files "auth/models.py, auth/serializers.py"
288
+
289
+ # Check for interrupted sessions (cross-LLM handoff)
290
+ reza session handoff
291
+
292
+ # List all sessions
293
+ reza session list
294
+
295
+ # Close a session
296
+ reza session end --id claude-abc12345
297
+ ```
298
+
299
+ ### Exporting (for tools without direct DB access)
300
+
301
+ ```bash
302
+ reza export # .reza/CONTEXT.md (human-readable markdown)
303
+ reza export --format json # .reza/context.json (machine-readable)
304
+ reza export --format context # compact format optimized for LLM prompts
305
+ reza export -o /path/to/output.md # custom output path
306
+ ```
307
+
308
+ ### Git hooks
309
+
310
+ ```bash
311
+ reza hooks # Install pre-commit hook (auto-update on commit)
312
+ reza hooks --uninstall # Remove the hook
313
+ ```
314
+
315
+ ---
316
+
317
+ ## Integrations
318
+
319
+ reza works with every major AI coding tool.
320
+
321
+ | Tool | Skill Install | Per-Project Setup | Guide |
322
+ |------|--------------|-------------------|-------|
323
+ | **Claude Code** | `curl` into `~/.claude/skills/reza/` | `reza init` | [→](integrations/claude-code/SKILL.md) |
324
+ | **Cursor** | Copy `.cursorrules` globally | `reza init` | [→](integrations/cursor/.cursorrules) |
325
+ | **Kilocode** | Copy `rules.md` to `~/.kilocode/rules/` | `reza init` | [→](integrations/kilocode/rules.md) |
326
+ | **Aider** | Add to `.aider.conf.yml` | `reza export` | [→](integrations/aider/README.md) |
327
+ | **Continue.dev** | Edit `~/.continue/config.json` | `reza export` | [→](integrations/continue/README.md) |
328
+ | **GitHub Copilot** | Copy to `.github/copilot-instructions.md` | `reza export` | [→](integrations/github-copilot/README.md) |
329
+ | **Codeium / Windsurf** | Open context file in editor | `reza export` | [→](integrations/codeium/README.md) |
330
+ | **OpenAI Codex** | Shell alias with `--system-prompt` | `reza export` | [→](integrations/codex/README.md) |
331
+ | **Any other tool** | `reza export` → paste output | `reza export` | — |
332
+
333
+ ### Universal approach (works with any tool)
334
+
335
+ ```bash
336
+ reza export --format context
337
+ # Paste .reza/CONTEXT.md content into your tool's context window
338
+ ```
339
+
340
+ ---
341
+
342
+ ## Cross-LLM Handoff
343
+
344
+ This is reza's killer feature. Hand off work between AI tools without re-explaining anything.
345
+
346
+ **Scenario**: Claude was implementing auth, hit its context limit. You switch to Cursor.
347
+
348
+ **Without reza**: Cursor starts from scratch. Re-explains stack, re-reads files, may contradict Claude's decisions.
349
+
350
+ **With reza**:
351
+
352
+ ```bash
353
+ # In Cursor:
354
+ reza session handoff
355
+
356
+ # Output:
357
+ # Interrupted session: [claude] claude-abc12345
358
+ # Working on: JWT authentication implementation
359
+ # Summary: Models and serializers complete. Starting on views.
360
+ # Context: Decided on JWT over sessions because of multi-service architecture.
361
+ # Avoid circular import in models.py — use string references.
362
+ # Next: implement auth/views.py and wire up to urls.py
363
+ # Files modified: auth/models.py, auth/serializers.py
364
+ ```
365
+
366
+ Cursor now knows exactly where to continue, what decisions were made, and what to avoid. Zero re-explanation.
367
+
368
+ ---
369
+
370
+ ## How It Works
371
+
372
+ ```
373
+ Your project
374
+ ├── .reza/
375
+ │ ├── context.db ← SQLite database (the brain)
376
+ │ └── CONTEXT.md ← Exported markdown (for tools without SQL)
377
+ ├── src/
378
+ │ └── ...your code...
379
+ └── .git/
380
+ └── hooks/
381
+ └── pre-commit ← Auto-updates DB on every commit
382
+ ```
383
+
384
+ **Database schema (6 tables):**
385
+
386
+ | Table | What it stores |
387
+ |-------|---------------|
388
+ | `project_meta` | Language, framework, project name |
389
+ | `files` | All files with path, type, line count, purpose |
390
+ | `sessions` | LLM sessions with progress and context |
391
+ | `changes` | Real-time change log linked to sessions |
392
+ | `dependencies` | File import relationships |
393
+ | `conflicts` | Simultaneous edit detection |
394
+
395
+ **Three sync mechanisms:**
396
+
397
+ 1. **`reza init`** — full scan on first use
398
+ 2. **`reza watch`** — file watcher (Python `watchdog`) for real-time updates
399
+ 3. **git pre-commit hook** — updates staged files on every commit
400
+
401
+ ---
402
+
403
+ ## Installation
404
+
405
+ ### From PyPI (recommended)
406
+
407
+ ```bash
408
+ pip install reza
409
+ ```
410
+
411
+ ### From source
412
+
413
+ ```bash
414
+ git clone https://github.com/swebreza/reza
415
+ cd reza
416
+ pip install -e .
417
+ ```
418
+
419
+ ### Requirements
420
+
421
+ - Python 3.8+
422
+ - `click` — CLI framework
423
+ - `rich` — terminal output
424
+ - `watchdog` — file watching (only needed for `reza watch`)
425
+
426
+ All dependencies install automatically with `pip install reza`.
427
+
428
+ ---
429
+
430
+ ## Per-Project Setup
431
+
432
+ ```bash
433
+ cd your-project
434
+ reza init
435
+ ```
436
+
437
+ This:
438
+ 1. Creates `.reza/context.db`
439
+ 2. Scans all source files and extracts purposes from docstrings/comments
440
+ 3. Detects your project's language and framework
441
+ 4. Installs a pre-commit git hook
442
+ 5. Adds a comment to `.gitignore` (you decide whether to commit `.reza/`)
443
+
444
+ ### Should I commit `.reza/`?
445
+
446
+ **Team projects**: Yes — commit it. Everyone gets shared context and session history.
447
+
448
+ **Solo projects**: Optional. The DB regenerates quickly with `reza init`.
449
+
450
+ ---
451
+
452
+ ## Supported Languages & Frameworks
453
+
454
+ Purpose extraction works for:
455
+
456
+ | Language | Purpose extracted from |
457
+ |----------|----------------------|
458
+ | Python | Module docstrings (`"""..."""`) |
459
+ | JavaScript / TypeScript | JSDoc comments (`/** ... */`) |
460
+ | Markdown | First `#` heading |
461
+ | Go / Java / Kotlin / Swift | `//` first-line comments |
462
+ | Rust | `///` doc comments |
463
+ | HTML / XML | `<!-- ... -->` comments |
464
+ | SQL / Lua | `--` comments |
465
+ | Ruby / Shell / YAML | `#` comments |
466
+
467
+ Framework detection: Django, FastAPI, Flask, React, Vue, Next.js, Nuxt, Svelte, Astro, Express, Fastify, Go, Rust/Cargo, Maven, Gradle, Rails, and more.
468
+
469
+ ---
470
+
471
+ ## Configuration
472
+
473
+ reza works with zero configuration. For advanced use:
474
+
475
+ ### Extra ignore patterns
476
+
477
+ ```bash
478
+ reza init --ignore generated --ignore vendor --ignore legacy
479
+ ```
480
+
481
+ ### Skip git hooks
482
+
483
+ ```bash
484
+ reza init --no-hooks
485
+ ```
486
+
487
+ ### Custom project directory
488
+
489
+ ```bash
490
+ reza init --dir /path/to/project
491
+ ```
492
+
493
+ ---
494
+
495
+ ## Real-World Example
496
+
497
+ ```bash
498
+ # Day 1: Start with Claude Code
499
+ cd my-saas-project
500
+ reza init
501
+ # → Indexed 847 files in 8.2 seconds
502
+
503
+ reza session start --llm claude --task "build subscription billing"
504
+ # → Session started: claude-f3a91b2c
505
+
506
+ # ... Claude implements Stripe integration ...
507
+
508
+ reza session save --id claude-f3a91b2c \
509
+ --summary "Stripe webhook handler done. Subscription model created." \
510
+ --context "Use Stripe's idempotency keys on all POST calls. Don't use our old PaymentMethod model — deprecated. Next: wire up frontend checkout flow." \
511
+ --files "billing/models.py, billing/webhooks.py, billing/stripe.py"
512
+
513
+ # Day 2: Switch to Cursor for frontend work
514
+ reza session handoff
515
+ # → Shows claude-f3a91b2c with full context
516
+
517
+ reza session start --llm cursor --task "frontend checkout flow"
518
+ # → Cursor now knows the Stripe setup, deprecations, and next steps
519
+ ```
520
+
521
+ ---
522
+
523
+ ## Contributing
524
+
525
+ Contributions are welcome. See [CONTRIBUTING.md](CONTRIBUTING.md).
526
+
527
+ **High-value contributions:**
528
+
529
+ - New tool integrations (in `integrations/`)
530
+ - Better purpose extraction heuristics
531
+ - Language-specific parsers (AST-based)
532
+ - VS Code extension that reads `.reza/context.db` directly
533
+ - Web UI for browsing the context database
534
+
535
+ ---
536
+
537
+ ## License
538
+
539
+ MIT — see [LICENSE](LICENSE).
540
+
541
+ ---
542
+
543
+ ## Author
544
+
545
+ Built by [Suweb Reza](https://github.com/swebreza).
546
+
547
+ If reza saves you time, star the repo and tell your team.