Skip to main content

A utility to generate a single context file from a project directory.

Project description

Context Creator

Have you ever found yourself manually copying and pasting code into a single file to feed to an AI model? Or maybe you needed to give a new collaborator a quick overview of a project, but didn't want to send them a zip file full of junk.

This tool was built to solve that exact problem.

context-creator is a simple, powerful command-line utility that walks through your project directory, grabs all the relevant source code, and combines it all into a single, clean text file. It's smart enough to ignore the things you don't need, using a .contextignore file that works just like the .gitignore you already know and love.

The goal is simple: less time spent on tedious prep work, more time focused on what matters.

Key Features

  • Zero-Config Start: Run it in any project, and it just works.
  • Intelligent Ignoring: Automatically creates and uses a .contextignore file with sensible defaults to skip dependency folders, build artifacts, and local configs.
  • Clear, Structured Output: The generated file starts with a directory tree, followed by the contents of each file, clearly demarcated.
  • Fast and Focused: A single, lightweight utility with no dependencies, designed to do one job perfectly.

Getting Started

1. Installation

The tool is hosted on PyPI. All you need is Python installed, then run:

pip install context-creator

2. First Run

Navigate your terminal into any of your project directories and simply run the command:

context

The first time you run it, you'll see this output:

Created default .contextignore file.
Generated context.txt.

Two things have happened:

  1. A context.txt file has been created in your project root. This is your project's complete context, ready to be used.
  2. A .contextignore file has also been created. This comes pre-filled with common patterns to ignore things like node_modules, .git, and Python virtual environments.

Usage

While the default is designed to be all you need, you can easily customize its behavior.

  • Specify a directory:

    context /path/to/another/project
    
  • Set a custom output file name:

    context -o project_overview.md
    

Customizing with .contextignore

The real power comes from tailoring the context to your exact needs. Open the .contextignore file in your project. It's just a plain text file where each line is a pattern to ignore.

For example, if you want to also ignore all markdown files, just add this line:

*.md

The tool will now skip any file with a .md extension during its next run.


This project is open-source and released under the MIT License.

Project details


Download files

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

Source Distribution

context_creator-1.0.0.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

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

context_creator-1.0.0-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: context_creator-1.0.0.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for context_creator-1.0.0.tar.gz
Algorithm Hash digest
SHA256 6ccdd81482cf3d51313910af3fd0594d4d3da138aa4abfc39cb7f46e6a451ed5
MD5 4d846009963e5710cacf5a37533d1f5a
BLAKE2b-256 acacee0d895e950ed91f3c64c46ee6b5f7f8f46c5850069137866ffffdfd0c6e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for context_creator-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 483dc7896647e8dd16f50eca18ac7c768aef02e095cde90d78c90185b87144bc
MD5 1a1d8d7212c06f9e48d4814337019879
BLAKE2b-256 3f72b4ca5d3df970bf983f3ab92e0df1fa359f614e12b4169ee341c1b2b124c5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page