Context Export is a deterministic CLI tool that generates clean, structured project snapshots optimized for Large Language Models (LLMs).
It extracts relevant source code, configuration, and selected files into a single, shareable output designed for AI-assisted review, refactoring, and architectural analysis.
LLM workflows often require pasting large portions of a codebase into prompts. Manual selection is inconsistent, error-prone, and difficult to reproduce.
Context Export provides:
- Deterministic, repeatable project snapshots
- Gitignore-aware file selection
- Explicit, configurable “important files”
- Clean output structure optimized for LLM context
- Atomic writes for safe file generation
- Zero heavy dependencies
Install globally with pipx (recommended):
python3 -m pip install --user pipx
python3 -m pipx ensurepath
pipx install .Run from anywhere:
context-exportExport the current project:
context-exportWrite to a file:
context-export --out context.mdSpecify a project root:
context-export --project-root /path/to/projectCreate context-export.toml in your project root:
[context_export]
exclude_from_dir_list = [".venv", "__pycache__"]
important_files = [
"README.md",
"pyproject.toml",
"src/**/*.py",
]
respect_gitignore = true # defaultPatterns use .gitignore-style syntax.
Most common cache directories and unwanted files are excluded automatically.
.git is always excluded.