Metadata-Version: 2.4
Name: repobundler
Version: 1.0.0
Summary: Pack any project into a single file for your AI/LLM context. Zero dependencies.
Author: dsk-dev-ai
License: MIT
Project-URL: Homepage, https://github.com/dsk-dev-ai/ctx
Project-URL: Repository, https://github.com/dsk-dev-ai/ctx
Project-URL: Funding, https://github.com/sponsors/dsk-dev-ai
Keywords: context,llm,ai,chatgpt,claude,codebase,bundle,cli,productivity
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Utilities
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

<p align="center">
  <img src="https://img.shields.io/badge/dependencies-ZERO-22c55e?style=flat-square" alt="zero deps">
  <img src="https://img.shields.io/badge/python-3.8+-4B8BBE?style=flat-square&logo=python&logoColor=white" alt="python">
  <img src="https://img.shields.io/pypi/v/repobundler?style=flat-square" alt="pypi version">
  <a href="https://github.com/dsk-dev-ai/ctx/actions"><img src="https://img.shields.io/github/actions/workflow/status/dsk-dev-ai/ctx/ci.yml?style=flat-square" alt="CI"></a>
  <img src="https://img.shields.io/badge/license-MIT-blue?style=flat-square" alt="MIT">
  <a href="https://github.com/users/dsk-dev-ai/packages/container/package/ctx"><img src="https://img.shields.io/badge/docker-ghcr-2496ED?style=flat-square&logo=docker&logoColor=white" alt="Docker GHCR"></a>
</p>

# 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.

```bash
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

```bash
pip install repobundler
```

No dependencies. No compiled extensions. Python 3.8+.

## 🐳 Docker

```bash
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

```bash
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.

<details>
<summary><b>Example bundle output</b></summary>

```markdown
# 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")
    ```
```
</details>

## 🧠 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](LICENSE).

## ⭐ Support

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

Prefer to support the work directly? Consider [becoming a sponsor](https://github.com/sponsors/dsk-dev-ai) on GitHub — every bit helps keep `ctx` free and dependency-free.
