Skip to content

KurtWeston/cron-explain

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cron-explain

Parse cron expressions into human-readable descriptions and calculate next execution times

Features

  • 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

How to Use

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

Installation

# Clone the repository
git clone https://github.com/KurtWeston/cron-explain.git
cd cron-explain

# Install dependencies
go build

Usage

./main

Built With

  • go

Dependencies

  • github.com/spf13/cobra
  • github.com/fatih/color

Contributing

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

License

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

About

Parse cron expressions into human-readable descriptions and calculate next execution times

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages