Skip to main content

Dump a project's source files into a single Markdown file for sharing with LLMs.

Project description

context-dump

Dump a project's source files into one Markdown file, ready to paste into an LLM. Respects .gitignore and never re-includes its own output on re-runs.

Install

pip install .

This registers the context-dump command.

Use

# Dump the current directory
context-dump .

# Dump specific paths
context-dump src/ README.md pyproject.toml

# Custom output file
context-dump . -o my_dump.md

# Ignore .gitignore (include everything the filters allow)
context-dump . --no-gitignore

# Plain text instead of Markdown
context-dump . --format txt

By default the output is written to AI_CONTEXT_<stems>.md in the current working directory. For context-dump . that's AI_CONTEXT_..md — usually you want to override with -o, e.g. context-dump . -o context.md.

What it filters

Layered filters, evaluated in order:

  1. Hard-ignored dirs/files (IGNORE_DIRS / IGNORE_FILES in ai_context/config.py) — node_modules, .git, build outputs, lockfiles, etc.
  2. .gitignore — patterns from the repo's .gitignore (and parent .gitignore files up to the .git boundary) are applied on top.
  3. Include filter (INCLUDE_EXTENSIONS / INCLUDE_FILENAMES) — only these extensions/filenames appear in the tree at all. Empty both = include everything that survived step 2.
  4. Content hiding (HIDE_CONTENT_FOR or ONLY_SHOW_CONTENT_FOR) — file appears in the tree, but its body is hidden. Mutually exclusive.

Self-exclusion

Re-running context-dump will not include the previous dump in the next one (unless you pass --include-self). Without this, every run would grow the file by its own previous size — guaranteed to hit the size cap eventually.

Configuration

Edit src/ai_context/config.py to change defaults: include filters, ignore patterns, max file size, format, etc. CLI flags override per-run.

Layout

ai_context_project/
├── pyproject.toml
├── README.md
└── src/
    └── ai_context/
        ├── __init__.py
        ├── config.py      # editable defaults
        ├── walker.py      # filesystem traversal + .gitignore
        ├── render.py      # tree, manifest, fenced file dump
        └── cli.py         # `context-dump` entry point
```"# context-dump"

#\x00 \x00c\x00o\x00n\x00t\x00e\x00x\x00t\x00-\x00d\x00u\x00m\x00p\x00 \x00 \x00

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

context_dump-0.1.0.tar.gz (11.8 kB view details)

Uploaded Source

Built Distribution

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

context_dump-0.1.0-py3-none-any.whl (12.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: context_dump-0.1.0.tar.gz
  • Upload date:
  • Size: 11.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for context_dump-0.1.0.tar.gz
Algorithm Hash digest
SHA256 42f0849c92cd063426bd3640801191447e8a7961178023b9fe031c7f6342136d
MD5 3929d10f591fa9ff06d90ccb752ccb58
BLAKE2b-256 72dda355342d15149341e0b44648ddc87b67351446901c5ddf283e8c3786bc5f

See more details on using hashes here.

Provenance

The following attestation bundles were made for context_dump-0.1.0.tar.gz:

Publisher: publish.yml on MuhammadDev99/context-dump

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: context_dump-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 12.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for context_dump-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 94e846d7f2c8938f528f6f762f3de9ca01de6e9d8eeecae20a30a7d3a9e4da93
MD5 a43c5fec225f82f61437df71694bfd6d
BLAKE2b-256 74a65027f6fdd9578ec9298063c20b78227dfc8d8b2243cd68edcd903b36887c

See more details on using hashes here.

Provenance

The following attestation bundles were made for context_dump-0.1.0-py3-none-any.whl:

Publisher: publish.yml on MuhammadDev99/context-dump

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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