Skip to main content

⚡ context-gen-cli (ctx) — Python Edition

PyPI version Python Versions License: MIT

⚡ 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): Type ctx anywhere 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 inside context/.
  • ⚡ All-In-One Default Mode (-d): Auto-generates triple context formats in context/ 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.json to 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

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

Metadata

Release files for context-gen-cli 1.2.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for context-gen-cli 1.2.5
File Size Uploaded Provenance Actions
context_gen_cli-1.2.5.tar.gz 20.6 kB Without provenance Details for context_gen_cli-1.2.5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for context-gen-cli 1.2.5
File Interpreter ABI Platform Actions
context_gen_cli-1.2.5-py3-none-any.whl Python 3 none any Details for context_gen_cli-1.2.5-py3-none-any.whl

Total release size: 41.8 kB

Release files / context_gen_cli-1.2.5.tar.gz

Download URL context_gen_cli-1.2.5.tar.gz
Size 20.6 kB
Tags Source
SHA-256 checksum
How to use checksums
da32d5cf947a918b20588d6ef860bb1c596d55d2113389b69b85693d3ca3f2b1
BLAKE2b-256 checksum
How to use checksums
12df552928a861c9f7ba03839c02a8a8895dd9f15d369b95a824cf885e409dee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.5

Release files / context_gen_cli-1.2.5-py3-none-any.whl

Download URL context_gen_cli-1.2.5-py3-none-any.whl
Size 21.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a18ecfce29decc6dd23c17bd637c7aa2d67e7bb2918eba44a2296421b81f24d6
BLAKE2b-256 checksum
How to use checksums
fe596f3949a82c968672f09e7c9d8533730fae65e81272a5de709f1072260aec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.5

Security for context-gen-cli 1.2.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page