Transform code repositories into markdown-formatted strings ready for LLM prompting
Project description
___ _ ___
/ __\ ___ __| | ___ /\/\ / \
/ / / _ \ / _` | / _ \ / \ / /\ /
/ /___ | (_) || (_| || __/ / /\/\ \ / /_//
\____/ \___/ \__,_| \___| \/ \//___,'
Ver. 0.0.2
CodeMD
🚀 Transform code repositories into markdown-formatted strings ready for LLM prompting
📝 Overview
CodeMD helps you convert your entire codebase into a format that's optimal for code-related prompts with Large Language Models (LLMs) like GPT-4, Claude, and others. It automatically processes your code files and outputs them in a clean, markdown-formatted structure that's perfect for LLM interactions.
✨ Features
- 🔍 Smart Directory Scanning: Recursively scans directories for code files
- 🎯 Flexible Configuration:
- Configurable file extensions
- File and pattern exclusion support
- Custom .gitignore support
- 📊 Intelligent Output:
- Markdown-formatted code blocks
- Preserved directory structure
- Repository structure visualization
- Token count estimation (with tiktoken)
- 📋 Convenience:
- Simple command-line interface
- Direct copy-to-clipboard support
- Multiple output options
🎉 Recent Updates
- ⭐ NEW: Repository structure visualization (disable with
--no-structure) - ⭐ NEW: Automatic .gitignore support
- Uses project's .gitignore by default
- Custom .gitignore files via
--gitignore - Disable with
--ignore-gitignore
🚀 Installation
pip install codemd
or install from source!
git clone https://github.com/dotpyu/codemd.git
cd codemd
pip install -e .
📖 Usage
Command Line Interface
Basic Usage:
codemd /path/to/your/code
Custom Extensions and Output:
codemd /path/to/your/code -e py,java,sql -o output.md
Pattern Exclusion:
codemd /path/to/your/code \
--exclude-patterns "test_,debug_" \
--exclude-extensions "test.py,spec.js"
.gitignore Configuration:
# Use custom gitignore files
codemd /path/to/your/code --gitignore .gitignore .custom-ignore
# Disable gitignore processing
codemd /path/to/your/code --ignore-gitignore
🤝 Contributing
Contributions are welcome! Feel free to open issues or submit pull requests.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
📄 License
Distributed under the Apache 2.0 License. See LICENSE for more information.
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 codemd-0.0.2.tar.gz.
File metadata
- Download URL: codemd-0.0.2.tar.gz
- Upload date:
- Size: 14.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
06e9db2055d98253c42fb8b2764f97029f219e4de9645cc5339b4721fc8c3a59
|
|
| MD5 |
b7d6ac3e09ed441f2264681cb5ddf59c
|
|
| BLAKE2b-256 |
85bc9563bc351f33bdb69d17a0a17cb53427dffed8eab432fea6248f34b93d6b
|
Provenance
The following attestation bundles were made for codemd-0.0.2.tar.gz:
Publisher:
publish.yml on dotpyu/codemd
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
codemd-0.0.2.tar.gz -
Subject digest:
06e9db2055d98253c42fb8b2764f97029f219e4de9645cc5339b4721fc8c3a59 - Sigstore transparency entry: 148228692
- Sigstore integration time:
-
Permalink:
dotpyu/codemd@d6990ce27a7142b21571e600f88a45e2f65857ce -
Branch / Tag:
refs/tags/v0.0.2 - Owner: https://github.com/dotpyu
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@d6990ce27a7142b21571e600f88a45e2f65857ce -
Trigger Event:
release
-
Statement type:
File details
Details for the file codemd-0.0.2-py3-none-any.whl.
File metadata
- Download URL: codemd-0.0.2-py3-none-any.whl
- Upload date:
- Size: 12.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
810dc55e53bbbd0bd15fbdbd6c5096c731bb5b148be2fe0a26a77078453dee71
|
|
| MD5 |
55787615929d1e07302d3b3e3aae2ec1
|
|
| BLAKE2b-256 |
af5c568d9bd85e0e32ee5ff7c1f0cb44173bfeba3095f582724ee4b252d53908
|
Provenance
The following attestation bundles were made for codemd-0.0.2-py3-none-any.whl:
Publisher:
publish.yml on dotpyu/codemd
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
codemd-0.0.2-py3-none-any.whl -
Subject digest:
810dc55e53bbbd0bd15fbdbd6c5096c731bb5b148be2fe0a26a77078453dee71 - Sigstore transparency entry: 148228695
- Sigstore integration time:
-
Permalink:
dotpyu/codemd@d6990ce27a7142b21571e600f88a45e2f65857ce -
Branch / Tag:
refs/tags/v0.0.2 - Owner: https://github.com/dotpyu
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@d6990ce27a7142b21571e600f88a45e2f65857ce -
Trigger Event:
release
-
Statement type: