Skip to main content

Typer-based CLI for tmux-backed Codex orchestration sessions

Project description

中文 · Install Guide

tmux-orche

tmux-backed CLI agent orchestration for OpenClaw fire-and-forget workflows.

tmux-orche lets OpenClaw hand work to a supported CLI agent such as Codex or Claude Code, return immediately, and continue later through the same persistent tmux session. That keeps OpenClaw from burning tokens while the agent works in the background.

OpenClaw Workflow

  1. OpenClaw creates or reuses an agent session with orche session-new.
  2. OpenClaw sends the task with orche send.
  3. orche returns immediately.
  4. The agent keeps running in tmux.
  5. When notify arrives, OpenClaw or another agent inspects the same session with status, read, or history.
  6. The session stays available until it is explicitly closed.

Quick Start

Create or reuse a session:

orche session-new \
  --cwd /path/to/repo \
  --agent codex \
  --name repo-codex-main \
  --notify-to tmux-bridge \
  --notify-target repo-codex-reviewer

Send work and return immediately:

orche send --session repo-codex-main "analyze the failing tests and propose a fix"

Inspect the same session later:

orche status --session repo-codex-main
orche read --session repo-codex-main --lines 120
orche history --session repo-codex-main --limit 20

Close it when done:

orche close --session repo-codex-main

Installation

Full step-by-step 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 .

Commands

  • orche session-new --cwd /repo --agent codex --name repo-codex-main --notify-to tmux-bridge --notify-target repo-codex-reviewer Create or reuse a persistent Codex tmux session.
  • orche session-new --cwd /repo --agent claude --name repo-claude-main --notify-to discord --notify-target 123456789012345678 Create or reuse a persistent Claude Code tmux session.
  • orche codex --cwd /repo --model gpt-5.4 Run native Codex inside tmux with the default session name for that repo.
  • orche cc --session-name repo-claude-review --print --help Run native Claude Code inside tmux with passthrough CLI args and an optional session name override.
  • orche send --session repo-codex-main "review the recent auth changes" Send a task into an existing session and return immediately.
  • orche status --session repo-codex-main Check whether the session and Codex process are still running.
  • orche read --session repo-codex-main --lines 80 Read recent terminal output from the live session.
  • orche type --session repo-codex-main --text "yes" Type text into the live Codex session without pressing Enter.
  • orche keys --session repo-codex-main --key Enter Send one or more key presses to the live Codex session.
  • orche history --session repo-codex-main --limit 20 Show recent local control actions for that session.
  • orche sessions list Show stored sessions from local metadata.
  • orche sessions clearall Close and remove all stored sessions.
  • orche close --session repo-codex-main Close the session when the work is finished.
  • orche config list Show current runtime configuration.

Interactive Input

Use type and keys when Codex is waiting on an interactive prompt inside the tmux session.

Read the latest output first:

orche read --session repo-codex-main --lines 40

Type text without submitting it:

orche type --session repo-codex-main --text "yes"

Then send Enter:

orche keys --session repo-codex-main --key Enter

This is useful for prompts such as trust confirmations, shell confirmations, or any other step where Codex is paused waiting for input.

You can also send multiple keys in one command:

orche keys --session repo-codex-main --key Down --key Down --key Enter

Config

Manage runtime settings:

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

Set notify targets when creating the session:

orche session-new \
  --cwd /repo \
  --agent codex \
  --name repo-codex-main \
  --notify-to discord \
  --notify-target 123456789012345678

Notify uses a single bound channel per session. To change it, close the session and create a new one with the desired --notify-to and --notify-target.

Config file:

~/.config/orche/config.json

State directory:

~/.local/share/orche/

Troubleshooting

Cancel a stuck turn

If Codex is stuck, running in the wrong direction, or needs to be stopped without losing the session:

orche cancel --session repo-codex-main

This interrupts the current Codex turn but keeps the session alive, allowing you to read output and send a corrected task.

Compare with close:

  • cancel: Interrupt current turn, keep session (for stuck or still-running tasks)
  • close: End entire session (for completed or abandoned tasks)

Prerequisites

  • tmux
  • tmux-bridge
  • 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.6.tar.gz (56.7 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.6-py3-none-any.whl (42.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: tmux_orche-0.4.6.tar.gz
  • Upload date:
  • Size: 56.7 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.6.tar.gz
Algorithm Hash digest
SHA256 fa916bb93fe034f2c5857a296674c787a52e95de05e7dd581b8ed374c9c3d4d8
MD5 c1f300bf66153b9610b6ab40ffb90e92
BLAKE2b-256 cc4e82bd908bfec3da802c0837a6d677c7829bb46e56876cf1e8361f579410f9

See more details on using hashes here.

Provenance

The following attestation bundles were made for tmux_orche-0.4.6.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.6-py3-none-any.whl.

File metadata

  • Download URL: tmux_orche-0.4.6-py3-none-any.whl
  • Upload date:
  • Size: 42.9 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.6-py3-none-any.whl
Algorithm Hash digest
SHA256 2d2c9b5ff4064505621ae7c0295b64c6ede212d9e7543f8c478abffc9b99c765
MD5 0b08bef08fa3a621ac57d1954e0fdf6f
BLAKE2b-256 cc19b5e9eb576dcb1db61f383c5b485208c6b467fb51e26025d1c8bcf2ac803b

See more details on using hashes here.

Provenance

The following attestation bundles were made for tmux_orche-0.4.6-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