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.0.tar.gz (54.5 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.0-py3-none-any.whl (11.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: trigr-1.2.0.tar.gz
  • Upload date:
  • Size: 54.5 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.0.tar.gz
Algorithm Hash digest
SHA256 0106f7e6f229dbf76b44345a73b13411bbc6007769b542045dba9513832b9a63
MD5 b8dcabf65dc03fe458e07ae6d8487bb2
BLAKE2b-256 f5904a690f33eea31ade162e49f4c2e9804b21474ba9ba53eab04cc466876630

See more details on using hashes here.

File details

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

File metadata

  • Download URL: trigr-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 11.1 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6e333da08f22c18bc85608e88d8b298cba8f24ebbc1c51e00f0f20e3882d5180
MD5 a8828b3ee0bb3e4ecb574b8bb226c831
BLAKE2b-256 761eadf32e2daf22d80b603edfb597eb8be046e6abf4f2f2a810f71c4c82de06

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