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.1.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.1.1-py3-none-any.whl (11.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: trigr-1.1.1.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.1.1.tar.gz
Algorithm Hash digest
SHA256 d435fb2e30d675a0282555b359933f68b78444a1555c25c4a1a1a8c1275ef4bf
MD5 95e5d5ec62ecd9c90c4e37c007744f0d
BLAKE2b-256 4ed102cff1ad9395c4986605ab7391700c82a8f8bcc2ae6c87add8bfd2f05313

See more details on using hashes here.

File details

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

File metadata

  • Download URL: trigr-1.1.1-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.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6d0f19b339e31587d58f7c0baced27d927e2c0e6a0156a34a617173567b1d427
MD5 1f0ba876e9ad586797eb7fdb5b3b0125
BLAKE2b-256 64ad4aea339157f4ff2f520c0a73782772a4e03257e19fb560c746b6c3faab07

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