README
¶
cronnow
Let's Run Your Cron Job Now!
cronnow is an interactive command-line tool that brings your cron jobs to life on demand. With an intuitive fuzzy finder interface, you can effortlessly browse, select, and execute cron jobs directly from your crontab, making job testing and debugging a breeze.
Features
- Interactive Selection: Quickly find and select the desired cron job using a smart fuzzy finder.
- Batch Execution: Execute all cron jobs sequentially with the
-aflag. - Parallel Execution: Execute all cron jobs asynchronously in parallel with the
--all-asyncflag. - Flexible Cron Input: Automatically reads your current crontab or a user-specified file.
- Environment Variable Handling: Automatically sets and expands environment variables defined in your crontab.
- Safe Execution: Review the command before execution or skip confirmation with the
-yflag for non-interactive usage.
Installation
Homebrew (macOS/Linux):
brew install enoatu/tap/cronnow
Scoop (Windows):
scoop bucket add enoatu https://github.com/enoatu/scoop-bucket
scoop install cronnow
APT (Ubuntu/Debian):
# x86_64/amd64:
curl -L https://github.com/enoatu/cronnow/releases/latest/download/cronnow_amd64.deb -o cronnow.deb
sudo dpkg -i cronnow.deb
# ARM64:
curl -L https://github.com/enoatu/cronnow/releases/latest/download/cronnow_arm64.deb -o cronnow.deb
sudo dpkg -i cronnow.deb
# i386 (32-bit):
curl -L https://github.com/enoatu/cronnow/releases/latest/download/cronnow_386.deb -o cronnow.deb
sudo dpkg -i cronnow.deb
RPM (Rocky Linux/RHEL/Fedora/CentOS):
# x86_64:
curl -L https://github.com/enoatu/cronnow/releases/latest/download/cronnow-x86_64.rpm -o cronnow.rpm
sudo dnf install ./cronnow.rpm
# sudo yum install ./cronnow.rpm # For older systems
# ARM64:
curl -L https://github.com/enoatu/cronnow/releases/latest/download/cronnow-aarch64.rpm -o cronnow.rpm
sudo dnf install ./cronnow.rpm
# i386 (32-bit):
curl -L https://github.com/enoatu/cronnow/releases/latest/download/cronnow-i386.rpm -o cronnow.rpm
sudo dnf install ./cronnow.rpm
APK (Alpine Linux):
# x86_64:
curl -L https://github.com/enoatu/cronnow/releases/latest/download/cronnow-x86_64.apk -o cronnow.apk
sudo apk add --allow-untrusted ./cronnow.apk
# ARM64:
curl -L https://github.com/enoatu/cronnow/releases/latest/download/cronnow-aarch64.apk -o cronnow.apk
sudo apk add --allow-untrusted ./cronnow.apk
# i386 (32-bit):
curl -L https://github.com/enoatu/cronnow/releases/latest/download/cronnow-i386.apk -o cronnow.apk
sudo apk add --allow-untrusted ./cronnow.apk
Snap:
sudo snap install cronnow
Manual Download
Direct binary download:
# Linux x86_64
curl -L https://github.com/enoatu/cronnow/releases/latest/download/cronnow_Linux_x86_64.tar.gz | tar xz
sudo mv cronnow /usr/local/bin/
# macOS x86_64
curl -L https://github.com/enoatu/cronnow/releases/latest/download/cronnow_Darwin_x86_64.tar.gz | tar xz
sudo mv cronnow /usr/local/bin/
# macOS ARM64 (Apple Silicon)
curl -L https://github.com/enoatu/cronnow/releases/latest/download/cronnow_Darwin_arm64.tar.gz | tar xz
sudo mv cronnow /usr/local/bin/
From Source
Ensure you have Go installed:
go install github.com/enoatu/cronnow@latest
Or clone and build:
git clone https://github.com/enoatu/cronnow.git
cd cronnow
go build -o cronnow
mise (Development)
Using mise en place:
mise use -g go:github.com/enoatu/cronnow
Usage
Launch cronnow to interactively select and execute cron jobs:
cronnow
Options
-
-f, --file FILE
Specify a crontab file instead of using the output ofcrontab -l. -
-y, --yes
Automatically execute the selected cron job without prompting for confirmation. -
-a, --all
Execute all cron jobs sequentially without interactive selection. -
--all-async
Execute all cron jobs asynchronously in parallel. Cannot be used with-a/--all. -
-h, --help
Display the help message. -
-d, --debug
Enable debug mode to show OS detection and other debugging information.
Usage Examples
Run a job from a specific file without confirmation:
cronnow -f path/to/crontab -y
# or using long options
cronnow --file path/to/crontab --yes
Execute all cron jobs sequentially:
cronnow -a
# or using long option
cronnow --all
Execute all cron jobs asynchronously in parallel:
cronnow --all-async
Execute all jobs from a specific file:
cronnow -f path/to/crontab -a
# or using long options
cronnow --file path/to/crontab --all
Execute all jobs from a specific file asynchronously:
cronnow -f path/to/crontab --all-async
# or using long option for file
cronnow --file path/to/crontab --all-async
Debug mode to see OS detection:
cronnow -d
# or using long option
cronnow --debug
How It Works
-
Parsing the Crontab:
The tool reads your crontab, separating environment variable definitions from cron job entries. -
Fuzzy Finder Interface:
It then leverages a fuzzy finder to allow you to easily pick a job from the list. -
Command Preparation:
After selecting a job, cronnow expands any environment variables in the command line and prepares it for execution. -
Execution:
The command is executed in bash (or your shell of choice), giving you a familiar execution environment.
Contributing
Contributions, issues, and feature requests are very welcome! Check out the issues page if you have any questions or ideas.
License
This project is licensed under the MIT License.
Experience your cron jobs like never before—execute them on your terms, whenever you need them, with cronnow!
Feel free to modify and enhance this README to best suit your project's style and vision. Enjoy coding!
Documentation
¶
There is no documentation for this package.