Skip to content

NickStafford2/ContextExport

Repository files navigation

Context Export

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.

Why

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

Installation

Install globally with pipx (recommended):

python3 -m pip install --user pipx
python3 -m pipx ensurepath
pipx install .

Run from anywhere:

context-export

Usage

Export the current project:

context-export

Write to a file:

context-export --out context.md

Specify a project root:

context-export --project-root /path/to/project

Configuration

Create 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 # default

Patterns use .gitignore-style syntax. Most common cache directories and unwanted files are excluded automatically.

.git is always excluded.

About

CLI tool that generates clean, structured project snapshots optimized for Large Language Models (LLMs).

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages