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
- Scan the folder, honoring
.gitignoreand skipping repos, binaries,node_modules,.venv, etc. - Classify every file by extension into 50+ languages.
- Index them, then render into one markdown file with clean code blocks.
- 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.
Metadata
Release files for repobundler 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| repobundler-1.0.1.tar.gz | 12.3 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| repobundler-1.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 22.4 kB
Release files / repobundler-1.0.1.tar.gz
| Download URL | repobundler-1.0.1.tar.gz |
|---|---|
| Size | 12.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cf0a217ada8503f0452f1faaabdc3996fac9cf342cb700b3e5b3cec6c6ccd47b
|
|
BLAKE2b-256 checksum How to use checksums |
2daeca2861af8d513241a84004569aac5c0bdb427d0f77b4269e1ac67a0b0bcc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / repobundler-1.0.1-py3-none-any.whl
| Download URL | repobundler-1.0.1-py3-none-any.whl |
|---|---|
| Size | 10.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ca5320d1936fb45d0f0851fba6e37d633fc23459ee6474dd1fba163f5454d8d5
|
|
BLAKE2b-256 checksum How to use checksums |
6f8d02736829504127c090e709f0caaaedf14554496a06bb11fe38fb510c846c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Security for repobundler 1.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.