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.1.0.tar.gz (27.9 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.1.0-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: trigr-1.1.0.tar.gz
  • Upload date:
  • Size: 27.9 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.1.0.tar.gz
Algorithm Hash digest
SHA256 9f24c4a73716f4b36c2c6591b822d0eafe38af3fc009e89b87461edb0fa576d1
MD5 d743146f350fe4716dbe5a15160a7cca
BLAKE2b-256 9553a385ece951aeeb10843e07ce99c476ff4bf7251bf430f0bf41e01eab1ebd

See more details on using hashes here.

File details

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

File metadata

  • Download URL: trigr-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e90eea9d4f9182f6552d743d4a9480031b5f85ee40526eaa7518c51540321bae
MD5 7843b6cc9571278e31517f134d71c925
BLAKE2b-256 00c41fc371661e474394822c1d0ed287617376345a55296070d813b4c25db11c

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