Skip to main content

Event system for AI CLI agents

Project description

trigr

Make any AI coding agent autonomous.

AI coding agents like Claude Code are reactive. They only do something when prompted.

OpenClaw changes that by running agents in the background, but it's a full platform you have to self-host, with known security risks around exposed instances and malicious plugins.

trigr bridges this gap through a simple trigger system. It lets the agent wait for events to autonomously run tasks when something happens. Once it's done, it goes back to sleep until the next event.

Quickstart

  1. The agent starts trigr as a background command.
uvx trigr watch
# trigr server runs on port 9374 (default)
  1. An external event is emitted.
uvx trigr emit "New GitHub issue opened: #1337 - Please triage."
  1. The agent wakes up and runs the task.

Install

uv tool install trigr

Triggers

We currently support 3 types of triggers: messages, CRON jobs, and pollers.

Messages (External Triggers)

You can send messages from another terminal, script, or the agent itself.

trigr emit "New GitHub issue opened: #1337 - Please triage."

You can delay messages too, if you want the agent to wait before acting.

trigr emit "Check if the deployment ran successfully and fix if needed." --delay 20m

CRON Jobs (Scheduled Triggers)

CRON jobs run at a specific time schedule.

trigr add daily-news --cron "0 9 * * *" --message "Retrieve the top 5 trending hacker news stories."

You can also prompt the agent to run a command and use its output as the message.

trigr add daily-news --cron "0 9 * * *" --command "python daily_news.py"

Instead of using the CLI, you can also define cron jobs in trigr.toml.

[crons.daily-report]
cron = "0 9 * * *"
command = "echo 'time for the daily report'"

Pollers (Interval Triggers)

Pollers run at regular intervals, like every 5 minutes to check your email.

trigr add email-response --interval 300 --command "./check_email.sh"

If a command prints nothing, no message is created. Pollers silently skip cycles when nothing is new.

[pollers.check-inbox]
interval = 60
command = "./check_mail.sh"

Commands

Command What it does
trigr watch [--timeout 300] Block until message, print it, exit
trigr emit "msg" [--delay 10s] Send a message
trigr add <name> --interval N -m "msg" Add a poller with a static message
trigr add <name> --cron "..." -c "cmd" Add a cron job with a command
trigr status Show server state
trigr init Create trigr.toml (auto-created on first use)
trigr serve [-f] Start server manually

Agent Compatibility

Agent How trigr watch runs Chat while waiting?
Claude Code Background task Yes
Codex CLI Blocking call No
Gemini CLI Blocking call No

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

trigr-1.2.1.tar.gz (55.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

trigr-1.2.1-py3-none-any.whl (11.8 kB view details)

Uploaded Python 3

File details

Details for the file trigr-1.2.1.tar.gz.

File metadata

  • Download URL: trigr-1.2.1.tar.gz
  • Upload date:
  • Size: 55.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for trigr-1.2.1.tar.gz
Algorithm Hash digest
SHA256 06f364b69b644cf2127b6eb4652517e7b7c80f4faa606853dc795561eaddb9e0
MD5 21014293680dd6094c70458cd281441f
BLAKE2b-256 8bde75b6c9eda9383765b0d3532e4e9547be3b28b86f5cabc8e852426975a173

See more details on using hashes here.

File details

Details for the file trigr-1.2.1-py3-none-any.whl.

File metadata

  • Download URL: trigr-1.2.1-py3-none-any.whl
  • Upload date:
  • Size: 11.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for trigr-1.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9377694ea9e402ebec1f8cb05000870cad46b7cd0c32dd60b94e87453b1327cf
MD5 e7a70caeecdfbcb117cb4cec4161f9e6
BLAKE2b-256 3385d3f6efaeb98e7daa5c5278ec9408f28ad9350937c2bc44f046c8260f5355

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page