Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

p2ctx

Bundles a project's source (code, structure, Go dependency graph) into a single compact JSON or Markdown file, ready to feed to an LLM.

Compresses function/method bodies down to signatures + docstrings/JSDoc for Go, Python, and JS/TS/JSX/TSX, so tokens aren't spent on implementation details the model doesn't need to see.

Install

pip install p2ctx

Usage

p2ctx .                                  # current dir -> <dirname>_context.json
p2ctx /path/to/proj -o out.json
p2ctx . --format md                      # markdown instead of JSON
p2ctx . --stdout | pbcopy                # print to stdout instead of a file
p2ctx . --copy                           # copy result straight to clipboard
p2ctx . --include "*.py" --exclude "tests/*"
p2ctx . --respect-gitignore
p2ctx . --no-compress-go                 # skip Go compression
p2ctx . --no-compress-py                 # skip Python compression
p2ctx . --no-compress-js                 # skip JS/TS/JSX/TSX compression
p2ctx . --no-compress                    # skip all compression
p2ctx . --max-size 300000
p2ctx . --tiktoken                       # exact token count

Optional dependencies

pip install p2ctx[clipboard]   # for --copy
pip install p2ctx[tokens]      # for --tiktoken

About

Compress your project into a single compact file, ready to feed to an LLM.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages