Skip to main content

Local-first orchestrator for headless coding agents across multiple GitHub repos

Project description

ctrlrelay

License: Apache 2.0 Tests and lint Build Python GitHub Issues GitHub Pull Requests

Local-first orchestrator for headless coding agents across your GitHub repos. Watches for assigned issues, runs a dev pipeline in an isolated git worktree, opens a PR, and asks you on Telegram when it gets stuck.

Table of Contents

About

Headless coding agents are great interactively. Running them across half a dozen repos without staring at a terminal is a different problem: who schedules the runs, who watches for new work, who hands you the "I'm blocked, what do you want?" question, who tracks the PR until it merges.

ctrlrelay is a small daemon that does all of that on your laptop. It is local-first on purpose: no server, no queue, no multi-tenant anything. Your agent credentials, your GitHub credentials, your repos, your machine.

Today ctrlrelay ships with a Claude Code (claude -p) backend. The orchestrator layer — worktrees, state DB, scheduler, Telegram bridge — is agent-agnostic, and plug-in backends for other headless coding agents are on the roadmap (see Roadmap).

Features

  • Issue poller. Detects issues assigned to you across every configured repo, spawns a dev session in a dedicated git worktree, and opens a PR.
  • Telegram bridge. When a session hits a blocking question, the bridge relays it to you as a DM and resumes the session once you reply.
  • PR watcher. Tracks the opened PR to merge and closes the loop with a Telegram notification.
  • In-process scheduler (APScheduler). Runs periodic jobs inside the poller daemon. Ships with a secops job that reviews Dependabot alerts and PRs daily at 6am; cron expressions follow standard Vixie 5-field semantics (Sun=0, DOM-OR-DOW).
  • Checkpoint protocol. The agent writes a structured state file at the end of every session so the orchestrator knows whether it succeeded, failed, or is blocked on input. Agent backends implement this protocol to integrate.
  • Cross-platform supervision. launchd (macOS) and systemd (Linux) examples in docs/operations.md. One codebase, identical behavior.

How it works

             ┌───────────────┐
             │  GitHub API   │
             └───────┬───────┘
                     │ (poll: issues assigned to me)
             ┌───────▼───────┐         ┌──────────────┐
             │ poller daemon │◄────────┤   APScheduler│
             │  (launchd /   │         │ (secops cron)│
             │   systemd)    │         └──────────────┘
             └───┬───────┬───┘
      new issue  │       │  blocked session
                 │       │
      ┌──────────▼──┐  ┌─▼───────────────────┐
      │ dev pipeline│  │ Telegram bridge     │
      │ in worktree │  │ (socket ↔ bot API)  │
      │ agent CLI   │  └──────────┬──────────┘
      └──────┬──────┘             │
             │ PR opened          │ DM you
             ▼                    ▼
      ┌────────────┐         ┌─────────┐
      │ PR watcher │         │   You   │
      └────────────┘         └─────────┘

Under the hood it's Python + asyncio + sqlite for state. The agent is invoked as a subprocess (today: claude -p), and GitHub is accessed via the gh CLI. No web server, no queue, no database dependency — just a launchd/systemd-supervised daemon.

Getting started

Prerequisites

  • Python 3.12+
  • git 2.20+
  • The gh CLI, authenticated (gh auth login) — used for all GitHub API calls.
  • A headless coding agent backend. Today that means the claude CLI, authenticated (claude auth login). Future backends will document their own setup.
  • (Optional, for the secops pipeline) the codex CLI, authenticated. The secops pipeline invokes codex review as an independent reviewer for the agent's output; you can disable it by setting code_review.method: "none" in your config if you prefer to skip the review step.
  • (Optional) a Telegram bot token if you want the bridge — see Telegram bridge docs.

Installation

From PyPI (once published):

pip install ctrlrelay
# or: uv pip install ctrlrelay

From source (current path while in alpha):

git clone https://github.com/AInvirion/ctrlrelay.git
cd ctrlrelay
uv pip install -e .   # or: pip install -e .

Quick start

# Copy and edit the example config:
cp config/orchestrator.yaml.example config/orchestrator.yaml

# Validate it:
ctrlrelay config validate

# Run the dev pipeline against an issue you're assigned:
ctrlrelay run dev --issue 42 --repo your-org/your-repo

# Or start the poller to auto-process newly assigned issues + run the
# scheduled secops sweep daily at 6am:
ctrlrelay poller start      # daemonizes; returns the terminal
ctrlrelay poller status     # verify it's running

Run as a supervised daemon (launchd on macOS / systemd on Linux) — see Operations.

Documentation

Roadmap

  • Multi-agent backend support. The agent dispatcher is the seam we intend to widen so ctrlrelay can drive alternative headless coding agents (e.g. OpenAI Codex CLI, OpenCode, Hermes) alongside Claude Code. Each backend will implement the same checkpoint protocol and be selectable per repo via config.
  • Additional scheduled jobs. The in-process scheduler already has secops; follow-ups include a weekly activity summary and a stale- session reaper.
  • Dashboard mode. An optional, opt-in heartbeat push to a hosted dashboard for operators running the daemon across many machines.

Contributing

We welcome contributions from the community! Please read our Contributing Guidelines before submitting a pull request, and abide by our Code of Conduct.

First-time contributors will be prompted by the CLA Assistant bot to sign the Contributor Assignment Agreement in-PR — it's a one-time, one-comment step.

Security

If you discover a security vulnerability, please follow our Security Policy. Please do not file public GitHub issues for security reports — open a private advisory instead.

License

This project is licensed under the Apache License 2.0 — see the LICENSE file for details.

Copyright (c) 2026 AInvirion LLC. All Rights Reserved.

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

ctrlrelay-0.1.7.tar.gz (178.3 kB view details)

Uploaded Source

Built Distribution

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

ctrlrelay-0.1.7-py3-none-any.whl (90.6 kB view details)

Uploaded Python 3

File details

Details for the file ctrlrelay-0.1.7.tar.gz.

File metadata

  • Download URL: ctrlrelay-0.1.7.tar.gz
  • Upload date:
  • Size: 178.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ctrlrelay-0.1.7.tar.gz
Algorithm Hash digest
SHA256 203fb6177d8874a5d9cb8692cf4959a7e552d0713b216cf2ded593504aee6a0d
MD5 a3b1fc7cd798ad3c95c11cea1403695d
BLAKE2b-256 837138f3558406828a0e6fef5d224802f5685fa85d521cdcffacc1d73815f3ec

See more details on using hashes here.

Provenance

The following attestation bundles were made for ctrlrelay-0.1.7.tar.gz:

Publisher: publish.yml on AInvirion/ctrlrelay

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ctrlrelay-0.1.7-py3-none-any.whl.

File metadata

  • Download URL: ctrlrelay-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 90.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ctrlrelay-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 9c535af1955311234bd5a85173c4738f3ea31a1241573a1ac17fa682e018fc2b
MD5 8ca818482ba80063c6b0a7ccc42bf9f1
BLAKE2b-256 ed0114b3135861e988df2fdb47438c1dc43644d59bc7eac851f3bdeba2bb5b46

See more details on using hashes here.

Provenance

The following attestation bundles were made for ctrlrelay-0.1.7-py3-none-any.whl:

Publisher: publish.yml on AInvirion/ctrlrelay

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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