Skip to content

OneClawLab/notifier

Repository files navigation

notifier

A Linux CLI tool and daemon for scheduling and executing shell commands via file-based task queues and CRON timers.

How it works

  • Drop a task file into tasks/pending/ → daemon picks it up, runs the command, moves it to tasks/done/.
  • Add a timer file with a CRON expression → daemon fires the command on schedule.
  • Both instant tasks and timers are plain KEY=VALUE text files, making them easy to create programmatically.

Install

From npm

npm install -g @theclawlab/notifier

From source

npm run build && npm link

Quick start

# Start the daemon
notifier start

# Add an instant task
notifier task add --author me --task-id hello --command "echo hello world"

# Add a daily timer (runs at 9 AM every weekday)
notifier timer add --author me --task-id morning --timer "0 9 * * 1-5" --command "echo good morning"

# Add a second-level timer (runs every 10 seconds)
notifier timer add --author me --task-id heartbeat --timer "*/10 * * * * *" --command "echo tick"

# Check daemon status
notifier status

# List pending tasks
notifier task list

# List timers
notifier timer list

CRON format

Both 5-field (minute-level) and 6-field (second-level) expressions are supported:

Format Fields Example Meaning
5-field min hour day month weekday 0 9 * * 1-5 9 AM on weekdays
6-field sec min hour day month weekday */10 * * * * * every 10 seconds

Data directory

Default: ~/.local/share/notifier/ — override with NOTIFIER_HOME.

$NOTIFIER_HOME/
├── tasks/pending/   # queued instant tasks
├── tasks/done/      # completed tasks
├── tasks/error/     # malformed task files
├── timers/          # CRON timer definitions
├── logs/            # daemon logs (auto-rotated at 10k lines)
└── notifier.pid     # daemon lock file

Documentation

  • USAGE.md — full CLI reference and file format details

About

a linux command act as a daemon to schedule event or timer based tasks

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors