A Ruby gem for printing TODO items to ESC/POS thermal printers. Print manual todos or sync with Apple Reminders to get physical copies of your tasks.
- π¨οΈ Direct thermal printer support - Works with ESC/POS compatible receipt printers
- π Manual todo creation - Create and print todos from the command line
- π Apple Reminders integration - Automatically print todos due today from your Reminders app
- π Auto-printer detection - Finds connected USB serial printers automatically
- β‘ Interactive mode - User-friendly prompts for creating todos
- π― macOS Quick Actions - Print todos directly from the Services menu
- β° Automation ready - Set up cron jobs for daily todo printing
- macOS (for Apple Reminders integration)
- Ruby >= 2.7.0
- ESC/POS compatible thermal printer (USB)
- SQLite3 (for Reminders access)
Clone the repository and install from source:
git clone https://github.com/lape/todo_printer.git
cd todo_printer
bundle install
rake installThis will install the todo_printer command globally on your system.
Todo printer supports configuration via ~/.config/todo_printer/config.yml:
# Default printer device
printer_device: /dev/cu.usbserial-12345
# Print settings
print_settings:
wrap_width: 32
auto_cut: true
# Reminders settings
reminders:
include_notes: true
priority_symbols:
high: "π΄"
medium: "π‘"
low: "π’"Copy config.yml.example to get started:
mkdir -p ~/.config/todo_printer
cp config.yml.example ~/.config/todo_printer/config.yml# List available printers
todo_printer --list-printers
# Print a single todo
todo_printer -t "Buy milk" -d "2% organic" --priority "High"
# Interactive mode (prompts for details)
todo_printer
# Print all Apple Reminders due today
todo_printer --reminders
# Use a specific printer
todo_printer -p /dev/cu.usbserial-12345 -t "Todo item"todo_printer -t "Team meeting" -d "Discuss Q4 goals" --priority "High"Output:
================================
TODO ITEM
================================
Title: Team meeting
Priority: High
--------------------------------
Discuss Q4 goals
--------------------------------
Created: 2025-06-23 14:30
================================
todo_printer --reminders- Open the
shortcut.applescriptfile in Script Editor - Export as an Application or Quick Action
- Add to System Preferences > Keyboard > Shortcuts > Services
- Now you can print todos from any app's Services menu
Due to macOS security restrictions, the best approach for automation is to use a standalone script that can be directly added to Full Disk Access:
-
Install the standalone script:
sudo cp print_reminders_standalone.rb /usr/local/bin/print_reminders_todo sudo chmod +x /usr/local/bin/print_reminders_todo
-
Grant Full Disk Access:
- Open System Settings β Privacy & Security β Full Disk Access
- Click the lock to make changes
- Click the "+" button
- Press Cmd+Shift+G and enter
/usr/local/bin/print_reminders_todo - Click "Open" to add the script
- Ensure the checkbox is enabled
-
Set up cron job:
# Edit your crontab crontab -e # Add this line to print todos every morning at 8 AM 0 8 * * * /usr/local/bin/print_reminders_todo >> /tmp/todo_printer.log 2>&1
-
Verify it's working:
# Test manually /usr/local/bin/print_reminders_todo # Check logs after cron runs tail -f /tmp/todo_printer.log
The standalone script (print_reminders_standalone.rb) is a self-contained version that doesn't require Ruby gems or bundler, making it ideal for system-level automation.
If you prefer using the installed gem, you'll need to grant Full Disk Access to both /usr/sbin/cron and your Ruby installation. However, this is more complex and less reliable than the standalone script approach.
Todo printer works with ESC/POS compatible thermal printers including:
- Generic POS-80 series printers
- Epson TM series (TM-T88, TM-T20, etc.)
- Star Micronics printers with ESC/POS mode
- Most 58mm and 80mm USB thermal receipt printers
The gem automatically detects printers at:
- Named printer:
POS80_Series_POS80_Printer_USB - USB serial devices:
/dev/cu.usbserial*and/dev/tty.usbserial*
# Clone the repository
git clone https://github.com/lape/todo_printer.git
cd todo_printer
# Install dependencies
bundle installbundle exec rake testThis project uses RuboCop for code linting:
# Check code style
bundle exec rubocop
# Auto-fix issues
bundle exec rubocop -atodo_printer/
βββ bin/ # Executable files
β βββ todo_printer # Main CLI executable
βββ lib/ # Library code
β βββ todo_printer.rb # Main module file
β βββ todo_printer/ # Module components
β βββ version.rb # Version constant
β βββ printer.rb # Core printer functionality
β βββ apple_reminders.rb # Reminders integration
β βββ config.rb # Configuration management
β βββ cli.rb # Command-line interface
βββ spec/ # Test files
βββ todo_printer.gemspec # Gem specification
βββ Gemfile # Development dependencies
βββ Rakefile # Build tasks
### Core Components
1. **TodoPrinter::Printer** - Core printer functionality:
- ESC/POS command generation
- Direct device communication
- Auto-detection of USB printers
- Text formatting and wrapping
2. **TodoPrinter::AppleReminders** - Apple Reminders integration:
- Direct SQLite database access
- Filters todos due today
- Priority and list support
3. **TodoPrinter::CLI** - Command-line interface:
- Argument parsing
- Interactive mode
- Configuration management
4. **TodoPrinter::Config** - Configuration handling:
- YAML configuration files
- User preferences
- Default settings
## Contributing
1. Fork the repository
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
3. Commit your changes (`git commit -m 'Add some amazing feature'`)
4. Push to the branch (`git push origin feature/amazing-feature`)
5. Open a Pull Request
### Development Guidelines
- Write tests for new features
- Follow Ruby style conventions (enforced by RuboCop)
- Update documentation as needed
- Add entries to CHANGELOG.md
## Troubleshooting
### Printer not found
If your printer isn't detected automatically:
1. List available printers:
```bash
todo_printer --list-printers
-
Check USB connections:
ls /dev/cu.* | grep -E "(usbserial|POS)"
-
Specify printer manually:
todo_printer -p /dev/cu.usbserial-12345 -t "Test"
Grant Terminal/iTerm access to Reminders:
- System Preferences β Security & Privacy β Privacy
- Select "Reminders"
- Check your terminal application
- Ensure printer supports ESC/POS commands
- Check printer is powered on and connected
- Try printing a test page first
- Verify character encoding (UTF-8)
This project is available under the MIT License. See the LICENSE file for details.
- ESC/POS command reference documentation
- Apple Core Data timestamp handling techniques
- Ruby ESC/POS printing community