Skip to main content

zero deps python pypi version CI MIT Docker GHCR

ctx 🧳

Pack any project into a single file and feed it straight to your AI. One command, zero dependencies, local-only — your code never leaves your machine.

Know the drill: you're about to ask ChatGPT / Claude / a coding agent to "look at my repo", and you end up copy-pasting a hand-picked pile of files. ctx bundles an entire codebase into one clean markdown file — a file index plus every source file in language-tagged blocks — sized by tokens, ready to paste, save, or copy.

ctx .                    # -> ./<folder>.ctx.md  (bundled, token-counted)
ctx src -o project.md    # bundle just a subfolder
ctx --lang python go      # only certain languages
ctx --clipboard           # straight to your clipboard

✨ Features

📦 One file, whole project file index + every source file in clean ```lang blocks
📊 Token & line counts know exactly how much context you're sending
🗂️ Smart scanning gitignore-aware, skips node_modules, binaries, .git, etc.
🎛️ Filters --exclude, --lang, --include, --max-files
📋 Clipboard --clipboard (macOS / Linux / Windows)
🌍 50+ languages tagged automatically from extensions
💸 100% free zero dependencies, no AI, no server, no API keys

🔧 Install

pip install repobundler

No dependencies. No compiled extensions. Python 3.8+.

🐳 Docker

docker pull ghcr.io/dsk-dev-ai/ctx:latest
docker run --rm -v "$PWD:/proj" -w /proj ghcr.io/dsk-dev-ai/ctx:latest stats

🚀 Usage

ctx [folder]                    # bundle into ./<folder>.ctx.md
ctx -o bundle.md                # pick the output file
ctx src -o src.md               # bundle a subfolder
ctx --stdout > all.txt          # print to a file / pipe anywhere
ctx --clipboard                 # copy the bundle to your clipboard
ctx --no-header                 # skip the title + file index
ctx --files                     # just list what would be bundled
ctx --stats                     # files / size / language breakdown
ctx --lang python rust --lang go   # restrict to certain languages
ctx -x tests -x docs            # extra paths to skip (gitignore-style)
ctx --include "*.py"            # only matching file globs
ctx --max-files 50              # cap how many files are included

See ctx --help for the full list.

Example bundle output
# myapp

_14 files bundled by ctx_

## File index

- `src/main.py` (Python) — 2.1KB
- `src/util.py` (Python) — 1.4KB
- `README.md` (Markdown) — 0.8KB

---

## src/main.py

    ```python
    import os
    print("hello")
    ```

🧠 How it works

  1. Scan the folder, honoring .gitignore and skipping repos, binaries, node_modules, .venv, etc.
  2. Classify every file by extension into 50+ languages.
  3. Index them, then render into one markdown file with clean code blocks.
  4. Count tokens and lines so you know your context size before you send it.

🧪 Tests

python -m pytest

Tested on Python 3.8–3.12 via GitHub Actions.

🤝 Contributing

Open an issue or a PR. Want a new language or a smarter layout? It's one small module in ctx/.

📄 License

MIT.

⭐ Support

If ctx saved you a copy-paste marathon, give it a star ⭐.

Prefer to support the work directly? Consider becoming a sponsor on GitHub — every bit helps keep ctx free and dependency-free.

Download files

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

Source Distribution

repobundler-1.0.0.tar.gz (12.4 kB view details)

Uploaded Source

Built Distribution

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

repobundler-1.0.0-py3-none-any.whl (10.1 kB view details)

Uploaded Python 3

File details

Details for the file repobundler-1.0.0.tar.gz.

File metadata

  • Download URL: repobundler-1.0.0.tar.gz
  • Upload date:
  • Size: 12.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.3

File hashes

Hashes for repobundler-1.0.0.tar.gz
Algorithm Hash digest
SHA256 9c266f286ca3a85615f8f5cf2891e0c8fcc3c22c9d5050c6105fec17e2fc9165
MD5 bf79fdd4b1fb7b3a57c95800b163887f
BLAKE2b-256 5598ab46742267627699ce04788fe69d86910bd9d642aa3a0f31ffb4ea8b0135

See more details on using hashes here.

File details

Details for the file repobundler-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: repobundler-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 10.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.3

File hashes

Hashes for repobundler-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d87479310b06cef14dd7b3624cb56284321f353b34a40b1aa90d6000328034c0
MD5 b8f6003aed16112f53f2bc1b42bdb930
BLAKE2b-256 bb0e56ea82f828f3b064821d24d311470a0575019e48f4a56fdbd6ae5e825c13

See more details on using hashes here.

Release history Release notifications | RSS feed

1.0.1

2 files

This release

1.0.0 This release

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