{"id":30385313,"url":"https://github.com/funkatron/speedy-delivery","last_synced_at":"2026-05-07T10:35:55.727Z","repository":{"id":304583600,"uuid":"1019216103","full_name":"funkatron/speedy-delivery","owner":"funkatron","description":"A macOS utility to auto-open new images and PDFs in Preview. And likely other files in other things","archived":false,"fork":false,"pushed_at":"2025-07-14T01:50:25.000Z","size":25,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-16T12:34:16.552Z","etag":null,"topics":["automation","bash","cli","fswatch","images","macos","pdf","utility"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/funkatron.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-14T01:37:53.000Z","updated_at":"2025-07-14T01:50:28.000Z","dependencies_parsed_at":"2025-07-14T04:33:06.930Z","dependency_job_id":"10a0e0c1-748b-4992-9e86-aad470ddae3d","html_url":"https://github.com/funkatron/speedy-delivery","commit_stats":null,"previous_names":["funkatron/speedy-delivery"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/funkatron/speedy-delivery","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/funkatron%2Fspeedy-delivery","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/funkatron%2Fspeedy-delivery/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/funkatron%2Fspeedy-delivery/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/funkatron%2Fspeedy-delivery/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/funkatron","download_url":"https://codeload.github.com/funkatron/speedy-delivery/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/funkatron%2Fspeedy-delivery/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271415496,"owners_count":24755639,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-21T02:00:08.990Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["automation","bash","cli","fswatch","images","macos","pdf","utility"],"created_at":"2025-08-21T02:13:47.437Z","updated_at":"2026-05-07T10:35:55.681Z","avatar_url":"https://github.com/funkatron.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Speedy Delivery\n\n[![MIT License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)\n[![macOS](https://img.shields.io/badge/platform-macOS-blue.svg)]()\n\nA macOS utility that watches folders for new image and PDF files and automatically opens them in Preview.\n\n## Why Speedy Delivery?\n\n- **Learning project**: Built to understand file system monitoring and macOS automation\n- **Practical utility**: Automatically opens new images and PDFs in Preview\n- **Smart design**: Prevents duplicate openings with intelligent throttling\n- **Well-documented**: Comprehensive testing, documentation, and development tools\n\n## Features\n\n- **Real-time monitoring**: Watches specified directories for new files\n- **Smart throttling**: Prevents duplicate file openings with configurable cache TTL\n- **Audio feedback**: Plays a system sound when files are opened\n- **Comprehensive logging**: All events are logged for debugging\n- **Multiple file types**: Supports images (JPG, PNG, WebP, GIF, HEIC) and PDFs\n\n## Requirements\n\n- macOS (uses `fswatch` and `afplay`)\n- `fswatch` command-line tool\n\n## Installation\n\n### Install fswatch\n\nFirst, install the required `fswatch` tool:\n\n```bash\n# Using Homebrew (recommended)\nbrew install fswatch\n\n# Or using MacPorts\nsudo port install fswatch\n```\n\n### Install Speedy Delivery\n\n1. Clone this repository:\n```bash\ngit clone https://github.com/funkatron/speedy-delivery.git\ncd speedy-delivery\n```\n\n2. Install using the Makefile (recommended):\n```bash\nmake install\n```\n\nOr install manually:\n```bash\n# Make the script executable\nchmod +x speedy-delivery\n\n# Add to your PATH\nsudo ln -s \"$(pwd)/speedy-delivery\" /usr/local/bin/speedy-delivery\n```\n\nOr use the installation script:\n```bash\n./install.sh\n```\n\n## Getting Started\n\n1. **Install dependencies**:\n   ```bash\n   brew install fswatch\n   ```\n\n2. **Clone and install**:\n   ```bash\n   git clone https://github.com/funkatron/speedy-delivery.git\n   cd speedy-delivery\n   make install\n   ```\n\n3. **Start watching**:\n   ```bash\n   speedy-delivery ~/Downloads\n   ```\n\n4. **Test it**: Drop an image or PDF into `~/Downloads` and watch it open automatically!\n\n## Development\n\nThe project includes a comprehensive Makefile for common tasks:\n\n```bash\nmake help          # Show all available commands\nmake test-clean    # Run comprehensive tests\nmake smoke-test    # Demonstrate functionality\nmake lint          # Check script syntax\nmake install       # Install to system\nmake uninstall     # Remove from system\n```\n\n## Usage\n\n### Basic Usage\n\nWatch the default directory (`~/Desktop/watch_images`):\n```bash\n./speedy-delivery\n```\n\n### Watch Specific Directories\n\nWatch one or more directories:\n```bash\n./speedy-delivery ~/Downloads ~/Desktop/screenshots\n```\n\n### Help\n\nShow usage information:\n```bash\n./speedy-delivery --help\n```\n\n## Examples\n\n### Example 1: Watch Downloads Folder\n```bash\n# Start watching your Downloads folder\nspeedy-delivery ~/Downloads\n\n# Now when you download images or PDFs, they'll open automatically!\n# Try downloading a screenshot or PDF to see it in action\n```\n\n### Example 2: Watch Multiple Folders\n```bash\n# Watch both Downloads and a screenshots folder\nspeedy-delivery ~/Downloads ~/Desktop/screenshots\n\n# Files in either folder will be opened automatically\n```\n\n### Example 3: Development Workflow\n```bash\n# Watch a project's assets folder\nspeedy-delivery ~/my-project/assets\n\n# When you save images from your design tools, they open instantly\n# Great for reviewing design assets as you work\n```\n\n### Example 4: Testing the Tool\n```bash\n# Run the smoke test to see it work\nmake smoke-test\n\n# Or test in isolation\n./test/clean-test.sh\n```\n\n### Example 5: Debug Mode\n```bash\n# Start the tool and watch logs in real-time\nspeedy-delivery ~/Downloads \u0026\ntail -f ~/Library/Logs/speedy-delivery.log\n\n# Now drop files and watch the logs show what's happening\n```\n\n## Configuration\n\n### Cache TTL\n\nThe script ignores files that were opened within the last 10 seconds to prevent duplicate launches. You can modify this by changing the `CACHE_TTL` variable in the script.\n\n### Logging\n\nAll events are logged to `~/Library/Logs/speedy-delivery.log`. Check this file for debugging information.\n\n### Cache Directory\n\nFile timestamps are cached in `~/.cache/speedy-delivery/` to implement the throttling mechanism.\n\n## Best Practices\n\n### 1. **Use Specific Directories**\n```bash\n# Good: Watch specific folders\nspeedy-delivery ~/Downloads ~/Desktop/screenshots\n\n# Avoid: Watching entire home directory\nspeedy-delivery ~\n```\n\n### 2. **Run in Background for Long Sessions**\n```bash\n# Start in background\nspeedy-delivery ~/Downloads \u0026\nSPEEDY_PID=$!\n\n# Stop when done\nkill $SPEEDY_PID\n```\n\n### 3. **Monitor Logs During Development**\n```bash\n# Watch logs while testing\ntail -f ~/Library/Logs/speedy-delivery.log\n```\n\n### 4. **Test Before Production Use**\n```bash\n# Always test in a safe directory first\nmkdir ~/test-watch\nspeedy-delivery ~/test-watch\n# Drop test files here first\n```\n\n### 5. **Use the Makefile for Development**\n```bash\n# Run comprehensive tests\nmake test-clean\n\n# See it in action\nmake smoke-test\n\n# Check syntax\nmake lint\n```\n\n## Supported File Types\n\n- **Images**: `.jpg`, `.jpeg`, `.png`, `.webp`, `.gif`, `.heic`\n- **Documents**: `.pdf`\n\n## How It Works\n\nSpeedy Delivery uses a simple but effective approach:\n\n1. **File Watching**: Uses `fswatch` to monitor directories for new files\n2. **Smart Filtering**: Only processes supported image and PDF files\n3. **Duplicate Prevention**: Caches file timestamps to avoid opening the same file twice\n4. **User Feedback**: Plays a sound and opens files in Preview\n5. **Logging**: Records all activity for troubleshooting\n\n## What I Learned Building This\n\n### File System Monitoring\n- **fswatch**: A powerful tool for cross-platform file system events\n- **Event filtering**: How to filter events to only process relevant files\n- **Process management**: Running background processes and cleanup\n\n### macOS Integration\n- **afplay**: Playing system sounds programmatically\n- **open command**: Launching applications from the command line\n- **Preview.app**: macOS's default image/PDF viewer\n\n### Bash Scripting Best Practices\n- **Error handling**: Using `set -e` and proper exit codes\n- **Variable quoting**: Always quote variables to handle spaces\n- **Process management**: Background processes and signal handling\n- **Logging**: Structured logging with timestamps\n- **Caching**: Simple file-based caching for throttling\n\n### Testing and Documentation\n- **Isolated testing**: Using `/tmp` directories for clean tests\n- **Comprehensive documentation**: README, CONTRIBUTING, CHANGELOG\n- **Development tools**: Makefile for common tasks\n- **Cursor rules**: AI-assisted development guidelines\n\n## Troubleshooting\n\n### Common Issues\n\n1. **\"fswatch: command not found\"**\n   - Install fswatch using Homebrew: `brew install fswatch`\n\n2. **Files not opening**\n   - Check the log file: `cat ~/Library/Logs/speedy-delivery.log`\n   - Ensure the file types are supported\n   - Verify file permissions\n\n3. **Too many files opening**\n   - Increase the `CACHE_TTL` value in the script\n   - Check if multiple instances are running\n\n### Debug Mode\n\nTo see what's happening in real-time, you can run:\n```bash\ntail -f ~/Library/Logs/speedy-delivery.log\n```\n\n## Contributing\n\nPlease see [CONTRIBUTING.md](CONTRIBUTING.md) for detailed guidelines.\n\nQuick start:\n1. Fork the repository\n2. Create a feature branch: `git checkout -b feature-name`\n3. Make your changes\n4. Test thoroughly: `make test-clean`\n5. Commit your changes: `git commit -am 'feat: add feature description'`\n6. Push to the branch: `git push origin feature-name`\n7. Submit a pull request\n\n## Quick Demo\n\nSee Speedy Delivery in action:\n```bash\n# Clone and test\ngit clone https://github.com/funkatron/speedy-delivery.git\ncd speedy-delivery\nmake smoke-test\n```\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Acknowledgments\n\n- Uses `fswatch` for efficient file system monitoring\n- Inspired by the need for quick image preview workflows\n- Built with comprehensive testing and documentation standards","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffunkatron%2Fspeedy-delivery","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffunkatron%2Fspeedy-delivery","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffunkatron%2Fspeedy-delivery/lists"}