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

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

context_gen_cli-1.2.5.tar.gz (20.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

context_gen_cli-1.2.5-py3-none-any.whl (21.3 kB view details)

Uploaded Python 3

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

Hashes for context_gen_cli-1.2.5.tar.gz
Algorithm Hash digest
SHA256 da32d5cf947a918b20588d6ef860bb1c596d55d2113389b69b85693d3ca3f2b1
MD5 ad3e2a3f4f88d4a0ae509eabf21fb96c
BLAKE2b-256 12df552928a861c9f7ba03839c02a8a8895dd9f15d369b95a824cf885e409dee

See more details on using hashes here.

File details

Details for the file context_gen_cli-1.2.5-py3-none-any.whl.

File metadata

File hashes

Hashes for context_gen_cli-1.2.5-py3-none-any.whl
Algorithm Hash digest
SHA256 a18ecfce29decc6dd23c17bd637c7aa2d67e7bb2918eba44a2296421b81f24d6
MD5 a47af0d4872cb0aeeed9712f6afa0d9e
BLAKE2b-256 fe596f3949a82c968672f09e7c9d8533730fae65e81272a5de709f1072260aec

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.2.5 This release

2 files

1.2.4

2 files

1.2.0

2 files

1.0.0

2 files

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