Skip to main content
   ___             _                    ___ 
  / __\  ___    __| |  ___    /\/\     /   \
 / /    / _ \  / _` | / _ \  /    \   / /\ /
/ /___ | (_) || (_| ||  __/ / /\/\ \ / /_// 
\____/  \___/  \__,_| \___| \/    \//___,' 

Ver. 0.0.3

CodeMD

🚀 Transform code files and repositories into markdown-formatted strings ready for LLM prompting and automatically copy to your clipboard. Perfect for seamless code-to-prompt workflow with ChatGPT, Claude, and other LLMs.

Tests License

📝 Overview

Tired of copying code files one by one? CodeMD instantly collects all relevant code in Markdown format and copies it to your clipboard - ready for ChatGPT, Claude, or any LLM.

Whether you need to process a single script or an entire codebase, CodeMD automatically:

  • Formats your code into LLM-friendly markdown
  • Preserves file structure and syntax highlighting
  • Estimates token usage for GPT models
  • Copies everything to your clipboard

Perfect for developers who want to:

  • Get AI assistance with code review
  • Ask LLMs about specific implementations
  • Document and explain codebases
  • Debug complex issues with AI help

No more manual copying and pasting - just run CodeMD and start chatting with your favorite LLM!

✨ Features

  • 🔍 Flexible Processing:
    • Single file processing
    • Recursive directory scanning
  • 🎯 Configurable Options:
    • Configurable file extensions
    • File and pattern exclusion support
    • Custom .gitignore support
  • 📊 Smart Output:
    • Markdown-formatted code blocks
    • Optional directory structure visualization
    • Token count estimation (with tiktoken)
    • Configurable output display
  • 📋 Convenience:
    • Simple command-line interface
    • Direct copy-to-clipboard support
    • Multiple output options

🎉 Recent Updates (0.0.3)

  • ⭐ NEW: Single file processing support
  • ⭐ NEW: Configurable output display (use --print to show output)
  • ⭐ NEW: Repository structure visualization (auto-disabled for single files, or use --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

Single File Processing:

# Process a single file (no output by default)
codemd /path/to/script.py

# Process and display output
codemd /path/to/script.py --print

# Save to file
codemd /path/to/script.py -o output.md

Directory Processing:

# Basic directory scanning (no output by default)
codemd /path/to/your/code

# Show output in terminal
codemd /path/to/your/code --print

# Custom extensions and output file
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.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

📄 License

Distributed under the Apache 2.0 License. See LICENSE for more information.


Made with ❤️ by Peilin

Metadata

Release files for codemd 0.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for codemd 0.0.3
File Size Uploaded Provenance
codemd-0.0.3.tar.gz 15.8 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for codemd 0.0.3
File Interpreter ABI Platform
codemd-0.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 29.3 kB

Release files / codemd-0.0.3.tar.gz

Download URL codemd-0.0.3.tar.gz
Size 15.8 kB
Tags Source
SHA-256 checksum
How to use checksums
6b07afa939cb5562e692809a2e8a5139cda1c8a4f058015faf3eb03d392b4d09
BLAKE2b-256 checksum
How to use checksums
4a485d86d0882b4bb06ee01a344b7f85cfc9289bd0d67c9d9f7be25b1712c43b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.1 CPython/3.12.7

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 20, 2024.

Transparency log

Release files / codemd-0.0.3-py3-none-any.whl

Download URL codemd-0.0.3-py3-none-any.whl
Size 13.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2c2cfe0942d6234f3303838851c9aad3c9029dda2e967f301970fcf564f2c038
BLAKE2b-256 checksum
How to use checksums
15a8acb6b3020c489fbc6cb15e2c7e7631ed24a2dd2635f56a6deff16d974d35
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.1 CPython/3.12.7

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 20, 2024.

Transparency log

Security for codemd 0.0.3

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for codemd-0.0.3.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 20, 2024.

Transparency log

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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page