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.2.tar.gz (54.8 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.2-py3-none-any.whl (11.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: trigr-1.1.2.tar.gz
  • Upload date:
  • Size: 54.8 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.2.tar.gz
Algorithm Hash digest
SHA256 db9d69a8ef64b7a1357c3c2f8749516efb76aa70e6e68d2a6c9f103584a65330
MD5 ac38607b273f8bcd5be38c77e3bff801
BLAKE2b-256 1887358f5199e63a1f20d7f4ad1a0c4fdc4d909d496eef97333f1b225fb4d1d4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: trigr-1.1.2-py3-none-any.whl
  • Upload date:
  • Size: 11.3 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8b5b3e1f95bb0446dd9118c2a18ef7d868eedb31e2182fd4e4c15566f060f955
MD5 0c57bee27e6405e98c95676b61ba583c
BLAKE2b-256 e874394cb6a7982f5e42d6ed3d7e2063c5a56c4bf152c493177d1e2b2ee927e0

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