CodeContextor 🚀
Note: This package replaces the deprecated codecontextor package.
Ever needed to explain your codebase to ChatGPT or Claude? CodeContextor creates a perfect snapshot of your project in seconds:
# That's it! Just run:
codecontextor --directory ./my_project
What You Get ✨
my_project/
├── src/
│ └── main.py # LLMs can request this file if needed!
└── config/
└── settings.yaml
# Key files are included below the tree...
Just paste this into your AI chat and start coding! The AI can see your project structure and request any file it needs.
Quick Start 🏃♂️
# Install
pip install codecontextor
# Run (will include all files)
codecontextor --directory ./my_project
# Or specify key files only
codecontextor --files main.py config.yaml
Why CodeContextor? 🎯
- Simple: One command to create perfect context for AI conversations
- Smart: Respects .gitignore, handles large files, includes safety checks
- Flexible: Include specific files or let the AI see everything
- Safe: Warns you about size and skips files >10MB
Features in Detail 🛠️
- 📁 Complete project tree generation
- 📄 Automatic or selective file inclusion
- 🔒 .gitignore pattern support
- ⚡ Large file protection
- 🎮 Custom file exclusions
- 📊 Size warnings and confirmations
Advanced Usage 🔧
Need more control? We've got you covered:
# Include files listed in a text file
codecontextor --files-list important_files.txt
# Custom exclude patterns
codecontextor --exclude-file exclude_patterns.txt
# Ignore .gitignore
codecontextor --no-gitignore
# Include essential context and supplementary info
codecontextor --prefix-file project_overview.txt --appendix-file api_docs.txt
# Add schemas and deployment guides
codecontextor --prefix-file schemas.txt --appendix-file deployment.txt
Command Line Options 🎛️
| Option | Description |
|---|---|
--directory |
Project directory (default: current) |
--files |
Specific files to include |
--files-list |
File containing list of files |
--smart-select |
Automatically select important files like entry points, configs, and docs |
--prefix-file |
Essential context to add at start (schemas, overview) |
--appendix-file |
Supplementary info to add at end (docs, guides) |
--output |
Output filename (default: project_context.txt) |
--estimate-tokens |
Calculate and show estimated token count in the output file |
--no-gitignore |
Disable .gitignore patterns |
--exclude-file |
Additional exclude patterns file |
Examples 📚
Include specific files (files-list.txt):
src/main.py
config/settings.yaml
README.md
Exclude patterns (exclude-patterns.txt):
*.pyc
__pycache__/
.env
*.log
Safety First 🛡️
CodeContextor looks out for you:
- Calculates total file size
- Shows warning for large directories
- Asks for confirmation
- Skips files >10MB
- Respects .gitignore by default
Installation Options 📦
# From PyPI (recommended)
pip install codecontextor
# From source
git clone https://github.com/ergut/codecontextor
pip install -r requirements.txt
Contributing 🤝
We love contributions! Check out README.test.md for:
- Running tests
- Test coverage details
- Adding new features
- Contributing guidelines
License 📜
MIT License - See LICENSE file
Support 💬
Author ✍️
Salih Ergüt
Version 📋
Current version: 1.0.3
See CHANGELOG.md for version history and updates.
Metadata
Release files for codecontextor 1.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| codecontextor-1.1.1.tar.gz | 11.4 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| codecontextor-1.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 20.8 kB
Release files / codecontextor-1.1.1.tar.gz
| Download URL | codecontextor-1.1.1.tar.gz |
|---|---|
| Size | 11.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ffd537be27352ef68256957c74da444d8dbb3f0b06f1999be15373538d6e9956
|
|
BLAKE2b-256 checksum How to use checksums |
8578a2769da26af89b128432e4481fb690f098b62cdd1516fee01334ca5eab18
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.11.10
|
Release files / codecontextor-1.1.1-py3-none-any.whl
| Download URL | codecontextor-1.1.1-py3-none-any.whl |
|---|---|
| Size | 9.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a302f9f8a95c173edc1d94854a9cb79daf6c1f5528f3b367d9e8c17ce483f1bf
|
|
BLAKE2b-256 checksum How to use checksums |
f562f1ad3aab7a23620737191403d20739897e5a306788df84496bc65ecfefae
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.11.10
|
Security for codecontextor 1.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.