Skip to main content

Automatically gather project context and generate Markdown prompt packages for LLMs

Project description

ctxpack

Automatically gather project context and generate Markdown prompt packages for LLMs.

Stop manually copy-pasting files into ChatGPT. ctxpack intelligently selects the most relevant files from your project and packages them into a single Markdown document ready for any LLM.

Installation

pip install ctxpack

Quick Start

# Initialize ctxpack in your project
cd my-project
ctxpack init

# Generate a context package
ctxpack pack

# Generate with smart mode (import/reference analysis)
ctxpack pack --mode smart

# Watch for changes and auto-regenerate
ctxpack watch --out context.md

Commands

ctxpack init

Creates a .ctxpack/ configuration folder and .ctxpackignore file with sensible defaults.

ctxpack init          # Initialize in current directory
ctxpack init --force  # Overwrite existing configuration

ctxpack pack [PATH]

Scans your project, ranks files by relevance, and outputs a Markdown context package.

ctxpack pack                           # Pack current directory
ctxpack pack ./src                     # Pack specific path
ctxpack pack --max-files 10            # Limit to 10 files
ctxpack pack --max-bytes 50000         # Limit to 50KB
ctxpack pack --extensions .py,.js      # Only Python and JavaScript
ctxpack pack --include-tests           # Include test files
ctxpack pack --mode smart              # Use import graph analysis
ctxpack pack --out context.md          # Output to file
ctxpack pack --verbose                 # Show scoring details

ctxpack watch [PATH]

Watches for file changes and auto-regenerates the context package.

ctxpack watch --out context.md         # Watch and output to file
ctxpack watch --debounce 2.0           # Wait 2 seconds after changes

Configuration

After running ctxpack init, you can customize .ctxpack/config.toml:

[pack]
max_files = 20
max_bytes = 100000
extensions = [".py", ".ts", ".js", ".md"]
exclude_tests = true
mode = "simple"

[scoring]
recency_weight = 0.7
size_weight = 0.3

Selection Modes

  • Simple mode (default): Ranks files by recency and size
  • Smart mode: Adds import/reference graph analysis to boost frequently-used files

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ctxpack-0.1.0.tar.gz (22.9 kB view details)

Uploaded Source

Built Distribution

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

ctxpack-0.1.0-py3-none-any.whl (20.5 kB view details)

Uploaded Python 3

File details

Details for the file ctxpack-0.1.0.tar.gz.

File metadata

  • Download URL: ctxpack-0.1.0.tar.gz
  • Upload date:
  • Size: 22.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for ctxpack-0.1.0.tar.gz
Algorithm Hash digest
SHA256 df2abb0978231cbd0389915e3ae4f6ec4f3eb18e79dffd06b3968af96aa1bc23
MD5 c3326f5537fa6b3cd4bb8c1406b98e71
BLAKE2b-256 30fe20d7501c08e09ee60210c356eb02d0f7905d45cea7bed1f4e6636fd12740

See more details on using hashes here.

File details

Details for the file ctxpack-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: ctxpack-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 20.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for ctxpack-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fe7338c5f05f6cbe072f777e7b4a6a9f129c56051eb87ce78088039fadb0ddab
MD5 ee94cde89ef6c91d0ad84dfb1ea1d04b
BLAKE2b-256 28b5455084162a31af6993223082b95afda3d4b20e2ed40d7de75836f652b3a5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page