CircuitPython Deploy (cpd)
A fast, reliable command-line tool for deploying CircuitPython projects from your development environment to CircuitPython boards.
✨ Features
- 🔍 Automatic board detection - Finds CircuitPython boards automatically
- 📁 Smart file filtering - Supports
.cpdignorefiles with gitignore-style patterns - 💾 Backup functionality - Safely backup existing board contents before deployment
- 📊 Progress tracking - Visual progress bars for file operations
- 🚀 High performance - Deploy dozens of files in milliseconds
- 🔧 Cross-platform - Works on Windows, macOS, and Linux
- 🎯 Dry-run mode - Preview deployments without making changes
- 💬 Helpful error messages - Clear guidance when things go wrong
🚀 Quick Start
# List detected CircuitPython boards
# Deploy current directory to auto-detected board
# Deploy with backup
# Preview deployment (dry-run)
# Deploy to specific board
📦 Installation
Pre-built Binaries
Download the latest release for your platform from the releases page.
From Source
# Install Rust if you haven't already
|
# Clone and build
# The binary will be at target/release/cpd
Cargo
Package Managers
Coming soon: Homebrew, Chocolatey, and AUR packages.
📖 Usage
Basic Deployment
Deploy your current directory to an automatically detected CircuitPython board:
Board Management
# List all detected CircuitPython boards
# Deploy to a specific board
Backup and Safety
# Create backup before deployment
# Preview what would be deployed (safe)
# Verbose output for debugging
# Force deployment without confirmation
File Filtering
Create a .cpdignore file in your project root to exclude files:
# Ignore development files
*.test.py
test_*
docs/
.vscode/
__pycache__/
# Ignore backup directories
backups/*
*.bak
# Ignore temporary files
*.tmp
*.log
🏗️ Project Structure
A typical CircuitPython project structure that works well with cpd:
my-circuitpython-project/
├── code.py # Main entry point
├── boot.py # Boot configuration
├── settings.toml # Configuration settings
├── lib/ # Libraries
│ ├── sensors.py
│ └── display_utils.py
├── assets/ # Images, sounds, etc.
│ └── icon.bmp
├── .cpdignore # Files to exclude
└── README.md # Project documentation
🔧 Advanced Usage
Multiple Boards
When multiple CircuitPython boards are connected:
# List boards and select interactively
# Or specify the board directly
Integration with Development Workflow
# Quick deploy during development
&&
# Deploy with backup for important updates
# Check what would be deployed
Configuration
No configuration file needed! cpd works out of the box with sensible defaults:
- Automatically excludes
.git/,__pycache__/,node_modules/, etc. - Respects
.cpdignoreand.gitignorepatterns - Preserves file timestamps
- Shows progress for operations taking more than a second
🐛 Troubleshooting
Board Not Detected
If your CircuitPython board isn't detected:
- Check USB connection - Ensure the board is properly connected
- Verify CircuitPython - Make sure CircuitPython is installed (not MicroPython)
- Check mount point - The board should appear as a removable drive
- Try reset - Press the RESET button on your board
- Manual specification - Use
--board <path>to specify manually
Common Issues
Permission Denied
# Linux/macOS: You might need to be in the dialout group
# Then log out and back in
No Files Deployed
# Check what files would be included
# Common causes:
# - All files excluded by .cpdignore
# - Empty project directory
# - All files already up to date
Slow Performance
# For very large projects, consider:
# - Adding more patterns to .cpdignore
# - Using --yes to skip confirmation
# - Excluding documentation/test directories
🤝 Contributing
Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
Development Setup
# Run tests
# Run integration tests
# Build release
# Validate GitHub workflows
GitHub Actions
This project uses GitHub Actions for:
- Continuous Integration: Automatically builds and tests on push to main
- Release Automation: Creates releases with cross-platform binaries when tags are pushed
- Dependency Updates: Weekly security audits and dependency updates
- Code Quality: Formatting, linting, and security checks
To trigger a release:
📋 Requirements
- Rust 1.75+ (for building from source)
- CircuitPython board with CircuitPython firmware installed
- USB connection or network access to the board
Supported Boards
cpd works with any CircuitPython-compatible board including:
- Adafruit Feather series (RP2040, ESP32-S2, ESP32-S3, etc.)
- Raspberry Pi Pico with CircuitPython
- Adafruit Metro series
- Adafruit ItsyBitsy series
- Adafruit QT Py series
- And many more!
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
🙏 Acknowledgments
- Adafruit for CircuitPython
- CircuitPython Community for the amazing ecosystem
- All the Rust crate authors whose work made this tool possible
🔗 Related Projects
- CircuitPython - The Python implementation for microcontrollers
- Adafruit CircuitPython Bundle - Library collection
- circup - CircuitPython library updater
Made with ❤️ for the CircuitPython community