Skip to main content

Typer-based CLI for tmux-backed Codex orchestration sessions

Project description

中文 · Install Guide

tmux-orche

Persistent tmux-backed agent sessions for delegation, review, and takeover.

tmux-orche is for the gap between "run an agent once" and "manually babysit tmux panes all day".

It lets you:

  • open a named agent session once and keep reusing it
  • hand work off and return immediately
  • inspect progress later without losing terminal state
  • route replies explicitly to another session or to Discord
  • take over the live TTY at any point

If you already use Codex or Claude Code in tmux, orche gives that workflow stable names, explicit session state, and a clean handoff loop.

Why Use It

Most agent workflows break down in the same places:

  • the session disappears after one command
  • you lose the exact terminal state that produced the result
  • follow-up prompts start from scratch
  • multi-agent review flows turn into ad-hoc tmux scripting
  • notifications become implicit and hard to reason about

orche fixes that by making the session the primary unit of work.

You do not talk to "some pane". You talk to a named session with:

  • a working directory
  • an agent type
  • a persistent tmux pane
  • optional explicit notify routing
  • later inspection and takeover

What Makes It Different

Session-first, not pane-first

You work with repo-worker, repo-reviewer, or auth-fixer, not %17.

Handoff-first, not babysitting-first

The default flow is:

  1. open
  2. prompt
  3. leave
  4. status / read later

Explicit notify, no default route

Notifications only fire when you explicitly bind a route.

  • tmux:<session>
  • discord:<channel-id>

There is no implicit global default delivery path.

Works for both background delegation and live takeover

Use read and status for normal follow-up. Use attach when you want to directly take control of the terminal.

Core Workflow

# open a worker session once
orche open \
  --cwd /path/to/repo \
  --agent codex \
  --name repo-worker \
  --notify tmux:repo-reviewer

# send work
orche prompt repo-worker "analyze the failing tests and propose a fix"

# come back later
orche status repo-worker
orche read repo-worker --lines 120

# take over if needed
orche attach repo-worker

# close when finished
orche close repo-worker

That is the intended model: persistent session, explicit handoff, later inspection.

Best Fit Scenarios

tmux-orche is a good fit when you want:

  • one reviewer session coordinating multiple workers
  • a long-running implementation or research worker
  • stable session names across multiple prompts
  • terminal-native agents that sometimes ask for input
  • explicit tmux-based notify between sessions
  • a way to jump into the exact live terminal when automation is not enough

It is less useful when you only need one short-lived command and do not plan to come back to the session.

Quick Start

Open a managed session with explicit notify:

orche open \
  --cwd /path/to/repo \
  --agent codex \
  --name repo-worker \
  --notify tmux:repo-reviewer

Send work:

orche prompt repo-worker "implement the parser refactor"

Inspect later:

orche status repo-worker
orche read repo-worker --lines 120
orche list

Answer interactive prompts:

orche input repo-worker "yes"
orche key repo-worker Enter

Take over the TTY:

orche attach repo-worker

Managed vs Native Sessions

Managed session

Use managed mode for normal delegation:

orche open --cwd /repo --agent codex --name repo-worker --notify tmux:repo-reviewer

This is the default recommendation.

Native session

Use native mode when you need raw agent CLI args:

orche open --cwd /repo --agent claude -- --print --help

Rules:

  • raw agent args must come after --
  • native sessions do not use --notify
  • do not mix raw agent args with managed notify routing

Command Model

  • orche open Create or reuse a named session.
  • orche prompt Send a prompt into an existing session.
  • orche status Check whether the pane and agent are alive, and whether a turn is pending.
  • orche read Read recent terminal output.
  • orche attach Attach your terminal to the live tmux session.
  • orche input Type text without pressing Enter.
  • orche key Send special keys such as Enter, Escape, or C-c.
  • orche list List locally known sessions.
  • orche cancel Interrupt the current turn but keep the session alive.
  • orche close End the session and clean up state.
  • orche whoami Print the current session id.
  • orche config Read or update shared runtime config.

Multi-Agent Review Pattern

# reviewer
orche open --cwd /repo --agent codex --name repo-reviewer --notify discord:123456789012345678

# worker reports back to reviewer
orche open --cwd /repo --agent codex --name repo-worker --notify tmux:repo-reviewer

# send implementation work
orche prompt repo-worker "implement the parser refactor"

# later inspect reviewer
orche read repo-reviewer --lines 120

This gives you a durable reviewer/worker loop without ad-hoc tmux scripting.

Notify

Notify is explicit.

orche open --notify accepts:

  • tmux:<target-session>
  • discord:<channel-id>

Examples:

orche open --cwd /repo --agent codex --name repo-reviewer --notify discord:123456789012345678
orche open --cwd /repo --agent codex --name repo-worker --notify tmux:repo-reviewer

Notes:

  • use tmux:<session> for agent-to-agent routing
  • use discord:<channel-id> only when you want Discord delivery
  • changing notify target means opening a new session

Installation

Full install guide: https://github.com/parkgogogo/tmux-orche/raw/main/install.md

Install from PyPI:

pip install tmux-orche

Install with uv:

uv tool install tmux-orche

Install from source:

git clone https://github.com/parkgogogo/orche
cd orche
python3 -m venv .venv
source .venv/bin/activate
pip install -U pip
pip install .

Config

orche config list
orche config set discord.bot-token "$BOT_TOKEN"
orche config set discord.mention-user-id 123456789012345678
orche config set notify.enabled true

Config file:

~/.config/orche/config.json

State directory:

~/.local/share/orche/

Prerequisites

  • tmux
  • codex CLI and/or claude CLI
  • Python 3.9+

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

tmux_orche-0.4.7.tar.gz (59.5 kB view details)

Uploaded Source

Built Distribution

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

tmux_orche-0.4.7-py3-none-any.whl (44.5 kB view details)

Uploaded Python 3

File details

Details for the file tmux_orche-0.4.7.tar.gz.

File metadata

  • Download URL: tmux_orche-0.4.7.tar.gz
  • Upload date:
  • Size: 59.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for tmux_orche-0.4.7.tar.gz
Algorithm Hash digest
SHA256 17c9eccf9efd5a3c936a4296bed48ff20e95db8965c55a89525316e67f1a661c
MD5 bc7a061ccd8abf668d8895250ee19641
BLAKE2b-256 801f3e316064bb0d8c4858fd282d3e01f85485497f78c119c0760f1c9bd3d2e5

See more details on using hashes here.

Provenance

The following attestation bundles were made for tmux_orche-0.4.7.tar.gz:

Publisher: publish.yml on parkgogogo/tmux-orche

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

File details

Details for the file tmux_orche-0.4.7-py3-none-any.whl.

File metadata

  • Download URL: tmux_orche-0.4.7-py3-none-any.whl
  • Upload date:
  • Size: 44.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for tmux_orche-0.4.7-py3-none-any.whl
Algorithm Hash digest
SHA256 5cbf029bc7c7eb1136e9a398058a49e37639bb5d4d978d3192648b108018808f
MD5 be35e5930368ee06cdfc7e4eac6cbcf9
BLAKE2b-256 ff9c27b10e8ca7b1e97be69eaf68317bac960692b99a97d57e8966470e8ea385

See more details on using hashes here.

Provenance

The following attestation bundles were made for tmux_orche-0.4.7-py3-none-any.whl:

Publisher: publish.yml on parkgogogo/tmux-orche

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