Parse cron expressions into human-readable descriptions and calculate next execution times
- Parse standard 5-field cron expressions (minute hour day month weekday)
- Support extended 6-field format with seconds field
- Support 7-field format with year field
- Validate cron syntax and provide helpful error messages with field position
- Convert cron to natural language in English (e.g., 'At 2:30 AM, only on Monday')
- Calculate and display next 5 execution times by default
- Support --next flag to customize number of execution times shown (1-100)
- Handle special characters: * (any), , (list), - (range), / (step), ? (no specific value)
- Support special strings: @yearly, @monthly, @weekly, @daily, @hourly, @reboot
- Colorized output with syntax highlighting for readability
- JSON output mode with --json flag for programmatic use
- Verbose mode with --verbose flag showing field-by-field breakdown
- Support reading from stdin for pipeline integration
- Exit codes: 0 for valid, 1 for invalid syntax, 2 for runtime errors
Use this project when you need to:
- Quickly solve problems related to cron-explain
- Integrate go functionality into your workflow
- Learn how go handles common patterns
# Clone the repository
git clone https://github.com/KurtWeston/cron-explain.git
cd cron-explain
# Install dependencies
go build./main- go
github.com/spf13/cobragithub.com/fatih/color
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.