⚡ context-gen-cli (ctx) — Python Edition
⚡ Fast, AST-powered Python CLI tool that scans any project, extracts architecture models, and generates structured LLM context (
agent.md,agent.json,agent.yaml).
🌟 Highlights
- ⚡ Short Command Alias (
ctx): Typectxanywhere in your terminal. - 100% Accurate Python Dependency Graphs: Built using Python's native
ast(Abstract Syntax Tree) module to resolve imports, relative packages, entry points, and utilities. - 📁 Clean Workspace Storage: Everything (
agent.md,agent.json,agent.yaml,.context-gen.json) is saved neatly insidecontext/. - ⚡ All-In-One Default Mode (
-d): Auto-generates triple context formats incontext/and runs a live auto-sync watcher in the background. .gitignore& Multi-Ignore Respect: Automatically parses rules from.gitignore,.npmignore,.dockerignore,.contextignore,.ignore, and filters.env*secrets.- Triple Format Output: Generates Markdown (
agent.md), MCP-compatible structured JSON (agent.json), and clean YAML (agent.yaml). - 🔄 Auto-Sync Watch Mode (
-w): Monitors workspace changes and updates context files automatically on save. - Configuration Parity: Seamlessly reads
context/.context-gen.jsonto maintain unified project settings with the Node.js edition.
📦 Installation
Install from PyPI using pip (or pipx / uv):
pip install context-gen-cli
🚀 Quick Start
1. ⚡ All-In-One Default Mode (Recommended)
Generates all formats in context/ and starts the live auto-sync watcher in background:
ctx -d
2. Generate All Formats (Markdown, JSON, YAML)
Scans the current directory and outputs agent.md, agent.json, and agent.yaml in context/:
ctx
3. Quick Refresh / Regenerate
ctx update
4. Custom Format & Output Destination
ctx update -f json
ctx -o custom_docs/
ctx -p /path/to/project
5. Watch Mode
Keep context files fresh automatically on every file edit:
ctx -w
📖 CLI Reference
| Flag / Command | Alias | Description |
|---|---|---|
ctx -d |
ctx --default |
⚡ All-in-One: Generates context files and starts live auto-sync watcher |
ctx -w |
ctx --watch |
👀 Watch Mode: Auto-regenerates context on file changes |
ctx -f <type> |
ctx --format <type> |
Format: md, json, yaml, or all |
ctx -o <path> |
ctx --output <path> |
Custom Output: Output file/folder path |
ctx -p <path> |
ctx --project <path> |
Target Directory: Directory to analyze |
ctx update |
— | Refresh: Regenerate context files |
ctx --help |
— | View full help options |
📄 License
MIT © yakkshit
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file context_gen_cli-1.2.5.tar.gz.
File metadata
- Download URL: context_gen_cli-1.2.5.tar.gz
- Upload date:
- Size: 20.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.11.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
da32d5cf947a918b20588d6ef860bb1c596d55d2113389b69b85693d3ca3f2b1
|
|
| MD5 |
ad3e2a3f4f88d4a0ae509eabf21fb96c
|
|
| BLAKE2b-256 |
12df552928a861c9f7ba03839c02a8a8895dd9f15d369b95a824cf885e409dee
|
File details
Details for the file context_gen_cli-1.2.5-py3-none-any.whl.
File metadata
- Download URL: context_gen_cli-1.2.5-py3-none-any.whl
- Upload date:
- Size: 21.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.11.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a18ecfce29decc6dd23c17bd637c7aa2d67e7bb2918eba44a2296421b81f24d6
|
|
| MD5 |
a47af0d4872cb0aeeed9712f6afa0d9e
|
|
| BLAKE2b-256 |
fe596f3949a82c968672f09e7c9d8533730fae65e81272a5de709f1072260aec
|