Skip to content

CodeMD v0.0.2

Compare
Choose a tag to compare
@dotpyu dotpyu released this 11 Nov 19:31
· 6 commits to main since this release
d6990ce

CodeMD v0.0.2 πŸš€

Transform your code repositories into LLM-friendly markdown prompts with advanced filtering and token estimation.

✨ Key Features

πŸ“ Core Functionality

  • Convert code repositories into markdown format optimized for LLM prompting
  • Smart directory scanning with recursive support
  • Cross-platform clipboard integration (Windows, macOS, Linux)
  • Flexible output options (stdout or file)

🎯 Customization Options

  • Extension Filtering: Specify which file types to include
    codemd /path/to/code -e py,java,sql
  • 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
  • Cost estimation for API usage
  • Automatic fallback between encoders

πŸš€ Quick Start

# Install from PyPI
pip install codemd

# Basic usage (prints to stdout)
codemd /path/to/code

# Save to file with custom extensions
codemd /path/to/code -e py,java -o output.md

# Exclude test files and get verbose output
codemd /path/to/code --exclude-patterns test_ -v

πŸ’‘ New in This Release

  • ✨ NEW: Repository structure output (to disable, use --no-structure)
  • ✨ NEW: Automatic .gitignore integration
    • Uses project's .gitignore by default
    • Specify custom gitignore files with --gitignore
    • Disable with --ignore-gitignore
  • Cross-platform clipboard support
  • Token estimation with cost analysis
  • Flexible output options (stdout or file)
  • Markdown generation optimized for LLMs

πŸ”§ Requirements

  • Python 3.8+
  • pathspec: Required for gitignore pattern matching (New)
  • Optional: tiktoken for token estimation
  • Optional: xclip or xsel for Linux clipboard support

πŸ“ Notes

  • Token counting requires tiktoken: pip install tiktoken
  • Linux users need xclip or xsel for clipboard support
  • Multiple gitignore files can be specified and are processed in order

πŸ› Bug Fixes

  • N/A (Initial Release)

For detailed usage and examples, please visit our GitHub Repository.