Skip to main content

Build code context from absolute file paths

Project description

context-builder

A simple CLI tool to build a single text context file from absolute file paths.

This helps you quickly collect code from multiple files into one output file for analysis, sharing, or AI workflows.


Installation

Local development (recommended)

pip install -e .

Usage

1) Initialize input file

context-builder init

This creates:

context_files.txt

Add absolute paths (one per line), for example:

C:\Projects\MyApp\src\main.py
C:\Projects\MyApp\src\service.py

Lines starting with # are ignored.

2) Build context output

context-builder build

This creates:

context_output.txt

Output Format

Each file is written like:

================================
FILE: main.py
PATH: C:\Projects\MyApp\src\main.py
================================

[file content here]

Warnings appear at the top if files are missing or invalid.

Features

  • Absolute paths only
  • Duplicate path removal
  • UTF-8 safe reading (errors="replace")
  • File size safety limit
  • Clean output formatting
  • Simple CLI workflow

Project Structure

context_builder/
├── __init__.py
├── cli.py
├── config.py
└── core.py

Commands

context-builder init
context-builder build
context-builder --version

Version

Current version: 0.1.0

License

MIT

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_builder-0.1.0.tar.gz (3.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_builder-0.1.0-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file context_builder-0.1.0.tar.gz.

File metadata

  • Download URL: context_builder-0.1.0.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for context_builder-0.1.0.tar.gz
Algorithm Hash digest
SHA256 4200b23bdf71d4fd2eac0b9955a4628ae71c700139edea49bc4ffe628de82a43
MD5 6db4babdd1da2655d4d4a9c8c2820c3a
BLAKE2b-256 8affb60d19615320dce80a384256ecc8367c4f4149b2aeb7c6b4cbb3c943e898

See more details on using hashes here.

File details

Details for the file context_builder-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for context_builder-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3264bc8e1d5f7d3693051785c3cc04c4c8cc42f30ce9b5c11d85521b2f967124
MD5 883c21f3970a8d4587c7de7e0848066c
BLAKE2b-256 14c9df57b5f43d2a8acbbf46743a52a479e4a66c4560477b091917e15ce434d6

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