| Crates.io | trigr |
| lib.rs | trigr |
| version | 0.3.0 |
| created_at | 2025-12-29 01:01:42.432445+00 |
| updated_at | 2025-12-29 01:01:42.432445+00 |
| description | Event-driven automation framework for webhooks, filesystems, cron, and SQS |
| homepage | https://github.com/mmichie/trigr |
| repository | https://github.com/mmichie/trigr |
| max_upload_size | |
| id | 2009687 |
| size | 363,226 |
A lightweight, event-driven automation framework that monitors multiple event sources and executes shell commands in response. Written in Rust for performance and reliability.
Trigr is an all-in-one automation tool that can:
When any of these events occur, RustyHook executes your configured shell commands.
Download pre-built binaries from GitHub Releases:
# Linux (x86_64)
curl -LO https://github.com/mmichie/trigr/releases/latest/download/trigr-x86_64-unknown-linux-gnu.tar.gz
tar xzf trigr-x86_64-unknown-linux-gnu.tar.gz
# macOS (Apple Silicon)
curl -LO https://github.com/mmichie/trigr/releases/latest/download/trigr-aarch64-apple-darwin.tar.gz
tar xzf trigr-aarch64-apple-darwin.tar.gz
cargo install trigr
git clone https://github.com/mmichie/trigr.git
cd trigr
cargo build --release
./target/release/trigr -c your-config.yml
Create a configuration file:
# config.yml
handlers:
- type: Webhook
name: deploy-webhook
options:
type: http
port: 8080
path: "/deploy"
auth_token: "secret-token" # Optional: require X-Auth-Token header
rate_limit: 10 # Optional: max 10 requests/second
health_path: "/health" # Optional: health check endpoint
shell: "cd /app && git pull && ./deploy.sh"
timeout: 300 # Command timeout in seconds
working_dir: "/app" # Working directory for command
- type: Cron
name: daily-backup
options:
type: cron
cron_expression: "0 2 * * *" # 2 AM daily
shell: "pg_dump mydb > /backups/mydb-$(date +%Y%m%d).sql"
retry:
max_retries: 3
initial_delay_ms: 1000
max_delay_ms: 30000
- type: Filesystem
name: compile-assets
options:
type: filesystem
path: "./src/styles"
include: ["*.scss", "*.sass"] # Only watch these patterns
exclude: ["_*.scss"] # Ignore partials
debounce_ms: 500 # Wait for changes to settle
shell: "sass src/styles/main.scss public/css/main.css"
- type: SQS
name: process-queue
options:
type: sqs
queue_url: "https://sqs.us-east-1.amazonaws.com/123456789/my-queue"
poll_interval: 10
shell: "python process_message.py"
Run Trigr:
trigr -c config.yml
| Option | Type | Default | Description |
|---|---|---|---|
type |
string | required | Event type: Filesystem, Webhook, Cron, SQS |
name |
string | required | Handler name (must be unique) |
shell |
string | required | Command to execute |
timeout |
integer | 300 | Command timeout in seconds |
working_dir |
string | current | Working directory for command |
shell_program |
string | $SHELL or "sh" | Shell to use (sh, bash, zsh, etc.) |
forward_to |
list | [] | Handler names to forward events to |
retry.max_retries |
integer | 0 | Max retry attempts |
retry.initial_delay_ms |
integer | 1000 | Initial retry delay |
retry.max_delay_ms |
integer | 30000 | Maximum retry delay |
| Option | Type | Default | Description |
|---|---|---|---|
port |
integer | required | HTTP port to listen on |
path |
string | required | URL path to handle |
auth_token |
string | none | Required X-Auth-Token header value |
rate_limit |
integer | none | Max requests per second |
health_path |
string | none | Health check path (bypasses auth and rate limit) |
hmac_secret |
string | none | Shared secret for HMAC signature verification |
hmac_header |
string | X-Hub-Signature-256 | Header containing the HMAC signature |
| Option | Type | Default | Description |
|---|---|---|---|
path |
string | required | Directory to watch |
include |
list | [] | Glob patterns to include |
exclude |
list | [] | Glob patterns to exclude |
debounce_ms |
integer | 100 | Debounce delay in milliseconds |
| Option | Type | Default | Description |
|---|---|---|---|
cron_expression |
string | required | Cron expression (5 or 6 fields) |
| Option | Type | Default | Description |
|---|---|---|---|
queue_url |
string | required | Full SQS queue URL |
poll_interval |
integer | required | Seconds between polls |
Most automation tools focus on a single event type. You might use:
cron for scheduled taskswatchman or nodemon for file watchingThis leads to fragmented automation infrastructure with different tools, configurations, and monitoring approaches.
Trigr unifies these event sources into a single, lightweight binary with:
| Tool | Event Types | Deployment | Best For |
|---|---|---|---|
| Trigr | Files, Webhooks, Cron, SQS | Single binary | Unified local automation |
| Argo Events | 20+ sources | Kubernetes required | K8s environments |
| Ansible Event-Driven | Multiple | Enterprise platform | Large infrastructure |
| Watchman | Files only | Daemon + client | File watching |
| nodemon | Files only | Node.js required | Node development |
| cron | Time only | Built into OS | Scheduled tasks |
MIT