No project description provided
Project description
Copcon 🐎
Copcon (Copy Context) is a CLI tool designed to rapidly capture and summarize code context for use in large language model (LLM) based chatbots like Claude and ChatGPT.
Just point the copcon command at a directory, and all the LLM needs to know about your code is copied to your clipboard, ready to fire into ChatGPT with CTRL+V 🐎
Why Copcon?
- 🚀 Speed Up Your Workflow: No more manual explanations of your project structure.
- 🎯 Get More Accurate AI Responses: Provide complete context in seconds.
- 🧠 Enhance AI Understanding: Help AI understand your specific codebase instantly.
Features
- Generate a directory tree structure
- Capture file contents
- Customizable depth for directory traversal
- Ability to exclude hidden files and directories
- Option to ignore specific directories and files
- Copies the generated report to the clipboard
Quick Start
- Install:
pip install copcon - Run:
copcon /path/to/your/project - Paste the result into your AI chat
Usage
After installation, you can use the copcon command:
copcon /path/to/your/directory
Options:
--depth INTEGER: Depth of directory tree to display (-1 for unlimited)--exclude-hidden / --no-exclude-hidden: Exclude hidden files and directories (default: True)--ignore-dirs TEXT: Additional directories to ignore (can be used multiple times)--ignore-files TEXT: Additional files to ignore (can be used multiple times)
For help, use:
copcon --help
By default, Copcon ignores the following directories:
__pycache__, .venv, node_modules, .git, .idea, .vscode, build, dist, target
And the following files:
poetry.lock, package-lock.json, Cargo.lock, .DS_Store, yarn.lock
You can add more directories or files to ignore using the --ignore-dirs and --ignore-files options:
copcon /path/to/your/directory --ignore-dirs my_ignore_dir --ignore-files my_ignore_file.txt
Report Format
Copcon generates a report in the following format:
Directory Structure:
your_project_name
├── folder1
│ ├── file1.py
│ └── file2.py
├── folder2
│ └── file3.py
└── main.py
File Contents:
File: folder1/file1.py
----------------------------------------
[Content of file1.py]
----------------------------------------
File: folder1/file2.py
----------------------------------------
[Content of file2.py]
----------------------------------------
File: folder2/file3.py
----------------------------------------
[Content of file3.py]
----------------------------------------
File: main.py
----------------------------------------
[Content of main.py]
----------------------------------------
This format provides a clear overview of your project structure followed by the contents of each file, making it easy for AI models to understand your codebase.
Note
This tool is designed for macOS and Windows.
Development
To set up the development environment:
- Ensure you have Python 3.11+ and Poetry installed
- Clone the repository
- Run
poetry installto install dependencies
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This project is licensed under the MIT License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file copcon-0.2.2.tar.gz.
File metadata
- Download URL: copcon-0.2.2.tar.gz
- Upload date:
- Size: 4.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.11.8 Darwin/23.6.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eee6b141fd09ae211025cd8801a6523cbbad33878ba4647e9dd9afeddbff236e
|
|
| MD5 |
b344274b6c787c881951f472aded5ab8
|
|
| BLAKE2b-256 |
ef0077fb5cd23f88131e5783a5996416658e92e63fcf3a3a0a8a49ffba620883
|
File details
Details for the file copcon-0.2.2-py3-none-any.whl.
File metadata
- Download URL: copcon-0.2.2-py3-none-any.whl
- Upload date:
- Size: 4.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.11.8 Darwin/23.6.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dfd2400fc45af31ba76af884dd3dfef275135cfa442c5cf9192ffa06f0bcd254
|
|
| MD5 |
88dcc46238f552a75455a71548570a29
|
|
| BLAKE2b-256 |
53e7eafa848aebf45ef6536d4bd2a4134c1837eb604474f5d9e51adede7dfd9c
|