CodeMD v0.0.2b
CodeMD v0.0.2b 🚀
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.
✨ Key Features
📝 Core Functionality
- Process single files or entire repositories into markdown format optimized for LLM prompting
- Smart scanning with recursive directory support and single file processing
- Cross-platform clipboard integration (Windows, macOS, Linux)
- Configurable output display with file saving options
🎯 Customization Options
- Single File Processing: Direct processing of individual files
codemd /path/to/script.py --print
- Extension Support: Extended language support including Rust, TypeScript, Go, and more
codemd /path/to/code -e rs,ts,go,kt
- Pattern Exclusion: Skip files matching specific patterns
codemd /path/to/code --exclude-patterns test_,debug_
- Extension Exclusion: Omit specific file extensions
codemd /path/to/code --exclude-extensions test.py,spec.js
📊 Token Estimation
- Built-in token counting via
tiktoken
- Support for both GPT-4 and GPT-3.5 encodings
- Token count reporting without output display
- Automatic fallback between encoders
🚀 Quick Start
# Install from PyPI
pip install codemd
# Process a single file
codemd /path/to/script.py
codemd /path/to/script.py --print # show output
# Process a directory
codemd /path/to/code
codemd /path/to/code --print # show output
# Save to file with custom extensions
codemd /path/to/code -e py,java,ts -o output.md
# Exclude test files and get verbose output
codemd /path/to/code --exclude-patterns test_ -v
💡 New in This Release
- ✨ NEW: Single file processing support
- Auto-disabled structure output for single files
- Streamlined output for individual files
- ✨ NEW: Configurable output display
- Output disabled by default for cleaner operation
- Use
--print
to display markdown output - Token counts and stats always shown
- ✨ NEW: Expanded language support
- Added Rust, Go, TypeScript, and more
- Comprehensive web development extensions
- Support for configuration and data files
- ✨ IMPROVED: Repository structure handling
- Auto-disabled for single files
- Optional for directories (
--no-structure
)
- ✨ MAINTAINED: Automatic .gitignore integration
- Uses project's .gitignore by default
- Custom gitignore files via
--gitignore
- Disable with
--ignore-gitignore
🔧 Requirements
- Python 3.8+
- pathspec: Required for gitignore pattern matching
- Optional:
tiktoken
for token estimation - Optional:
xclip
orxsel
for Linux clipboard support
📝 Notes
- Token counting requires
tiktoken
:pip install tiktoken
- Linux users need
xclip
orxsel
for clipboard support - Multiple gitignore files can be specified and are processed in order
- Output is not displayed by default; use
--print
to show markdown - Structure output is automatically disabled for single files
🐛 Bug Fixes
- N/A (Feature Release)
🔄 Breaking Changes
- Default behavior changed to not print output (use
--print
to show output) - Directory argument renamed to 'path' to reflect single file support
For detailed usage and examples, please visit our GitHub Repository.