Skip to main content

A powerful cross-platform tool for creating AI-ready project snapshots

Project description

🚀 CodePrint

PyPI version npm version License: MIT Platform

A blazing-fast, cross-platform CLI tool that creates comprehensive AI-ready snapshots of your codebase. Perfect for use with ChatGPT, Claude, Gemini, and other AI assistants.

CodePrint Demo

✨ Features

  • 🚀 Lightning Fast: Parallel processing for rapid scanning
  • 🎯 Smart Detection: Automatically detects project type and applies appropriate filters
  • 📋 Multiple Formats: Outputs in TXT or MCP (Markdown Context Pack) format
  • 📎 Clipboard Ready: Option to copy output directly to clipboard
  • 🔍 Gitignore Support: Respects .gitignore patterns
  • 🎨 Beautiful CLI: Colorful ASCII art and progress indicators
  • 🌍 Cross-Platform: Works on Windows, macOS, Linux, Git Bash, and more
  • 🧠 AI-Optimized: Perfect for prompt engineering with any AI assistant

📦 Installation

Quick Install (Recommended)

Using the universal installer:

Linux/macOS:

curl -sSL https://raw.githubusercontent.com/Tanayk07/codeprint/main/install.sh | bash

Windows (PowerShell):

iwr -useb https://raw.githubusercontent.com/Tanayk07/codeprint/main/install.ps1 | iex

Package Managers

pip (Python)

pip install codeprintio

npm (Node.js)

npm install -g codeprintio

Homebrew (macOS)

brew tap Tanayk07/codeprint
brew install codeprintio

Chocolatey (Windows)

choco install codeprintio

WinGet (Windows)

winget install codeprintio

Snap (Linux)

sudo sudo snap install codeprintio

APT (Debian/Ubuntu)

sudo add-apt-repository ppa:Tanayk07/codeprint
sudo apt update
sudo sudo apt install codeprintio

🚀 Quick Start

Basic Usage

Scan current directory and save to file:

codeprint

Scan with specific format:

codeprint -f mcp  # Generate MCP format
codeprint -f txt  # Generate TXT format (default)

Copy to clipboard automatically:

codeprint -c

Advanced Usage

# Scan specific directory
codeprint -p /path/to/project

# Custom output file
codeprint -o my_snapshot.txt

# Include hidden files
codeprint --include-hidden

# Set custom limits
codeprint --max-files 1000 --max-file-size 2048 --max-lines 2000

# Disable automatic project detection
codeprint --no-auto-detect

# Disable gitignore patterns
codeprint --no-gitignore

# Verbose output
codeprint -v

🎯 Project Type Detection

CodePrint automatically detects your project type and applies appropriate ignore patterns:

Project Type Detection Files Auto-Ignored
Python requirements.txt, setup.py, pyproject.toml __pycache__, *.pyc, venv/, .egg-info/
JavaScript package.json node_modules/, dist/, *.min.js
TypeScript tsconfig.json node_modules/, dist/, *.d.ts
Java pom.xml, build.gradle target/, *.class, .gradle/
Android AndroidManifest.xml, gradle.properties build/, *.apk, *.aab
iOS Podfile, *.xcodeproj Pods/, *.ipa, DerivedData/
React package.json + React files node_modules/, build/, .next/
.NET *.csproj, *.sln bin/, obj/, packages/
Go go.mod vendor/, *.exe
Rust Cargo.toml target/, Cargo.lock
Flutter pubspec.yaml build/, .dart_tool/

📋 Output Formats

TXT Format

Simple text format with file contents and directory structure. Perfect for quick sharing.

MCP Format (Markdown Context Pack)

Structured markdown format with metadata, syntax highlighting, and better organization. Ideal for AI assistants.

⚙️ Configuration

Command-Line Flags

Flag Description Default
-f, --format Output format (txt/mcp) txt
-o, --output Output file name auto-generated
-c, --clipboard Copy to clipboard false
-p, --path Path to scan current directory
--max-file-size Max file size (KB) 1024
--max-files Max number of files 500
--max-lines Max lines per file 1000
--include-hidden Include hidden files false
--no-gitignore Ignore .gitignore patterns false
--no-auto-detect Disable project type detection false
--no-progress Disable progress output false
--no-parallel Disable parallel processing false
-v, --verbose Verbose output false

Environment Variables

export GEMINI_DEFAULT_FORMAT=mcp
export GEMINI_CLIPBOARD=true
export GEMINI_MAX_FILES=1000

🔧 Development

Building from Source

# Clone the repository
git clone https://github.com/Tanayk07/codeprint.git
cd codeprint

# Install dependencies
pip install -r requirements.txt

# Run locally
python src/codeprint.py

# Run tests
pytest tests/

# Build distributions
python setup.py sdist bdist_wheel

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

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

📈 Performance

CodePrint is optimized for speed:

  • Parallel Processing: Utilizes multiple threads for file processing
  • Smart Filtering: Skips binary and large files automatically
  • Efficient Memory Usage: Streams large files instead of loading entirely
  • Fast Pattern Matching: Uses optimized fnmatch for ignore patterns

Benchmark results (on a typical React project):

  • Files scanned: 500
  • Time taken: ~2 seconds
  • Memory usage: < 50MB

🛡️ Security

  • Never includes sensitive files (keys, certificates, .env files)
  • Respects .gitignore patterns by default
  • No network requests or data collection
  • Open source and auditable

📝 License

This project is licensed under the MIT License - see the LICENSE file for details.

🙏 Acknowledgments

  • Inspired by the need for better AI context management
  • ASCII art generated with pyfiglet
  • Colored output powered by colorama

🐛 Troubleshooting

Common Issues

Python not found:

  • Ensure Python 3.7+ is installed
  • Add Python to your PATH

Clipboard not working:

  • Install pyperclip: pip install pyperclip
  • On Linux, install xclip or xsel

Colors not showing:

  • Install colorama: pip install colorama
  • On Windows, enable ANSI colors in terminal

📧 Contact

🌟 Star History

Star History Chart


Made with ❤️ for the AI community

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

codeprintio-1.0.5.tar.gz (27.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

codeprintio-1.0.5-py3-none-any.whl (20.7 kB view details)

Uploaded Python 3

File details

Details for the file codeprintio-1.0.5.tar.gz.

File metadata

  • Download URL: codeprintio-1.0.5.tar.gz
  • Upload date:
  • Size: 27.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.2

File hashes

Hashes for codeprintio-1.0.5.tar.gz
Algorithm Hash digest
SHA256 ee4f26a0e4ac6b02d633acc87505ef75d776ea65e8ef48fd0d48d9b067714a19
MD5 216150bc67d12e9502772d849e9ddd44
BLAKE2b-256 0c7b791d90a9b14a08266099e7dd09b310d379b8b31042e70a6487bac9d8809a

See more details on using hashes here.

File details

Details for the file codeprintio-1.0.5-py3-none-any.whl.

File metadata

  • Download URL: codeprintio-1.0.5-py3-none-any.whl
  • Upload date:
  • Size: 20.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.2

File hashes

Hashes for codeprintio-1.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 d511bc2f9a6d4d4e91f6bf7ce05c3fd815b8f31c27405948c73a5e23e65fdada
MD5 90c6219a8b9b23f5035033a667e46fdd
BLAKE2b-256 064440a7c3a22562423a411aadd5d8f777d36683c476e2d0e7685b20d09cb9df

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page