Codex autorunner CLI per DESIGN-V1
Project description
codex-autorunner
An opinionated autorunner that uses the Codex app-server as the primary execution backend with OpenCode support to work on large tasks via a simple loop. On each loop we feed the Codex instance the last one's final output along with core documents.
In the current model, the primary work surface is tickets:
.codex-autorunner/tickets/TICKET-###.md
Optionally, you can maintain lightweight workspace docs (auto-created on write; missing is OK):
.codex-autorunner/workspace/active_context.md.codex-autorunner/workspace/decisions.md.codex-autorunner/workspace/spec.md
Sneak Peak
Run multiple agents on many repositories, with git worktree support
See the progress of your long running tasks with a high level overview
Dive deep into specific agent execution with a rich but readable log
Tickets and workspace docs are markdown files. Edit them directly or use the web UI’s file chat to iterate with the agent.
Use codex CLI directly for multi-shot problem solving or /review
Mobile-first experience, code on the go with Whisper support (BYOK)
What it does
- Initializes a repo with Codex-friendly docs and config.
- Runs Codex app-server in a loop against the repo, streaming logs via OpenCode runtime.
- Tracks state, logs, and config under
.codex-autorunner/. - Exposes a power-user HTTP API and web UI for tickets, workspace docs, file chat, logs, runner control, and a Codex TUI terminal.
- Optionally runs a Telegram bot for interactive, user-in-the-loop Codex sessions.
CLI commands are available as codex-autorunner or the shorter car.
Install
PyPI (pipx):
pipx install codex-autorunner
GitHub (pipx, dev):
pipx install git+https://github.com/Git-on-my-level/codex-autorunner.git
From source (editable):
git clone https://github.com/Git-on-my-level/codex-autorunner.git
cd codex-autorunner
pip install -e .
Optional extras
- Telegram bot support:
pip install codex-autorunner[telegram] - Voice transcription support:
pip install codex-autorunner[voice] - Dev tools (lint/test):
pip install codex-autorunner[dev] - Local dev alternative:
pip install -e .[extra]
Dev setup
make setupcreates.venv, installs.[dev], runspnpm install, and setscore.hooksPathto.githooks.
Opinionated setup (macOS headless hub at ~/car-workspace)
- One-shot setup (user scope):
scripts/install-local-mac-hub.sh. It pipx-installs this repo, creates/initializes~/car-workspaceas a hub, writes a launchd agent plist, and loads it. Defaults: host127.0.0.1, port4173, labelcom.codex.autorunner. Override via env (WORKSPACE,HOST,PORT,LABEL,PLIST_PATH,PACKAGE_SRC). For remote access, prefer a VPN like Tailscale and keep the hub bound to loopback; if you bind to a non-loopback host, the script configuresserver.auth_token_env+ a token in.codex-autorunner/.env. - Create/update the launchd agent plist and (re)load it:
scripts/launchd-hub.sh(ormake launchd-hub). - Linux users: see
docs/ops/systemd.mdfor systemd hub/Telegram setup. - Manual path if you prefer:
pipx install .car init --mode hub --path ~/car-workspace- Copy
docs/ops/launchd-hub-example.plistto~/Library/LaunchAgents/com.codex.autorunner.plist, replace/Users/youwith your home, adjust host/port if desired, thenlaunchctl load -w ~/Library/LaunchAgents/com.codex.autorunner.plist.
- The hub serves the UI/API from
http://<host>:<port>and writes logs to~/car-workspace/.codex-autorunner/codex-autorunner-hub.log. Each repo under~/car-workspaceshould be a git repo with its own.codex-autorunner/(runcar initin each).
Refresh a launchd hub to the current branch
When you change code in this repo and want the launchd-managed hub to run it:
- Recommended: run the safe refresher, which installs into a new venv, flips
~/.local/pipx/venvs/codex-autorunner.current, restarts launchd, health-checks, and auto-rolls back on failure:
make refresh-launchd
Important: avoid in-place pip/pipx installs against the live venv. During uninstall/reinstall, packaged static assets disappear and the UI can break while the server keeps running. Use the safe refresher or stop the service before manual installs.
- Manual path (offline only; no rollback): stop launchd first, then reinstall into the launchd venv (pipx default paths shown; adjust if your label/paths differ):
$HOME/.local/pipx/venvs/codex-autorunner/bin/python -m pip install --force-reinstall /path/to/your/codex-autorunner
- Restart the agent so it picks up the new bits (default label is
com.codex.autorunner; default plist~/Library/LaunchAgents/com.codex.autorunner.plist):
launchctl unload ~/Library/LaunchAgents/com.codex.autorunner.plist 2>/dev/null || true
launchctl load -w ~/Library/LaunchAgents/com.codex.autorunner.plist
launchctl kickstart -k gui/$(id -u)/com.codex.autorunner
- Tail the hub log to confirm it booted:
tail -n 50 ~/car-workspace/.codex-autorunner/codex-autorunner-hub.log.
Health checks (recommended)
GET /healthreturns 200 (verifies static assets are present).GET /static/app.jsreturns 200.- Optional:
GET /returns HTML (not a JSON error). If you set a base path, prefix all checks with it.
Quick start
- Install (editable):
pip install -e . - Initialize (hub + repo):
codex-autorunner init --git-init(orcar init --git-initif you prefer short). This creates the hub config at.codex-autorunner/config.yml, plus state/log files and starter content under.codex-autorunner/(tickets and optional workspace docs). - Run once:
codex-autorunner once/car once - Continuous loop:
codex-autorunner run/car run - If stuck:
codex-autorunner killthencodex-autorunner resume(or thecarequivalents) - Check status/logs:
codex-autorunner status,codex-autorunner log --tail 200(orcar ...)
Configuration
- Root defaults live in
codex-autorunner.yml(committed). - Local overrides live in
codex-autorunner.override.yml(gitignored). Use it for machine-specific tweaks; keep secrets in env vars. - Hub config lives at
.codex-autorunner/config.yml(generated). It includesrepo_defaultsfor all repos. - Repo overrides are optional; add
.codex-autorunner/repo.override.ymlto override hub defaults for a specific repo.
Interfaces
CAR supports two interfaces with the same core engine. The web UI is the power user control plane for multi-repo visibility and system control. The Telegram bot is optimized for interactive back-and-forth, mirroring the Codex TUI experience inside Telegram with user-in-the-loop approvals.
Web UI (control plane)
- Ensure the hub is initialized (
codex-autorunner init) so.codex-autorunner/config.ymlexists. - Start the API/UI backend:
codex-autorunner serve(orcar serve) — defaults to127.0.0.1:4173; override viaserver.host/server.portin.codex-autorunner/config.yml. - Open
http://127.0.0.1:4173for the hub UI; repo UIs live under/repos/<repo_id>/. FastAPI endpoints are under/api/*(repo) and/hub/*(hub).- The Terminal tab launches the configured Codex binary inside a PTY via websocket; it uses
codex.terminal_args(defaults empty, so it runscodexbare unless you override). xterm.js assets are vendored understatic/vendor. - Repo IDs are URL-safe slugs; if a repo directory or requested ID contains spaces,
#, or other unsafe chars, the hub stores the original name asdisplay_nameand generates a saferepo_idfor URLs. - If you need to serve under a proxy prefix (e.g.,
/car), setserver.base_pathin.codex-autorunner/config.ymlor pass--base-pathtocar serve/hub serve; all HTTP/WS endpoints will be reachable under that prefix. Proxy must forward that prefix (e.g., Caddyhandle /car/* { reverse_proxy ... }with a 404 fallback for everything else). - Chat composer shortcuts: desktop uses Cmd+Enter (or Ctrl+Enter) to send and Shift+Enter for newline; mobile uses Enter to send and Shift+Enter for newline.
- The Terminal tab launches the configured Codex binary inside a PTY via websocket; it uses
Telegram bot (interactive sessions)
- The interactive Telegram bot is separate from
notifications.telegram(which is one-way notifications). - Each operator should create their own Telegram bot token. Multi-user use requires explicit allowlists.
- Quickstart:
- Set env vars:
CAR_TELEGRAM_BOT_TOKEN(and optionallyCAR_TELEGRAM_CHAT_ID). - In config, set
telegram_bot.enabled: trueand fillallowed_user_ids+allowed_chat_ids. - Run
car telegram start --path <repo_or_hub>. - Use
/bind(hub mode) and/newor/resumein Telegram.
- Set env vars:
- How it works (high level):
- The bot polls the Telegram Bot API, allowlists chat/user IDs, and routes each topic to a workspace + Codex thread.
- Messages and media are forwarded to the Codex app-server, streaming responses back to Telegram.
- Approvals can be requested inline, giving a hands-on, TUI-like workflow without leaving Telegram.
- Details:
docs/telegram/architecture.md,docs/ops/telegram-bot-runbook.md, anddocs/telegram/security.md.
Security and remote access
- The UI/API are effectively privileged access and can execute code on your machine (terminal + runner).
- Keep the server bound to
127.0.0.1and use Tailscale (or another VPN) for remote access. - If you must expose it, set
server.auth_token_envand also put it behind an auth-enforcing reverse proxy (basic auth/SSO). - Do not expose it publicly without protections. See
docs/web/security.mdfor details.
Auth token (optional)
If you set server.auth_token_env, the API requires Authorization: Bearer <token> on every request.
- Set the config:
server.auth_token_env: CAR_SERVER_TOKEN. - Export the token before starting the server:
export CAR_SERVER_TOKEN="...". - Browser UI: visit
http://host:port/?token=...once. The UI stores it insessionStorageand removes it from the URL; WebSocket connections send the token viaSec-WebSocket-Protocol: car-token-b64.<base64url(token)>. - CLI: requests automatically attach the token from
server.auth_token_env; if the env var is missing, CLI commands will error.
Git hooks
- Install dev tools:
pip install -e .[dev] - Point Git to the repo hooks:
git config core.hooksPath .githooks - The
pre-commithook runsscripts/check.sh(Black formatting check + pytest). Run it manually with./scripts/check.shbefore committing or in CI.
Commands (CLI)
init— seed config/state/docs.run/once— run the loop (continuous or single iteration).resume— clear stale lock/state and restart;--oncefor a single run.kill— SIGTERM the running loop and mark state error.status— show current state.sessions— list terminal sessions (server-backed when available).stop-session— stop a terminal session by repo (--repo) or id (--session).log— view logs (tail or specific run).edit— openactive_context|decisions|specin$EDITOR.serve— start the HTTP API (FastAPI) on host/port from config (defaults 127.0.0.1:4173).
Star history
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file codex_autorunner-1.0.0.tar.gz.
File metadata
- Download URL: codex_autorunner-1.0.0.tar.gz
- Upload date:
- Size: 960.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f238ad50f8f54773877f1bdb0c2088c0b1f7231a50af6eeb2e437a9b48c689b4
|
|
| MD5 |
9dff186d22d41422d1191491a1169da9
|
|
| BLAKE2b-256 |
0fd21c6c7d5d31a4bb3f7578a42cab241af97c0cae6248597a289c6b38fcf2c6
|
Provenance
The following attestation bundles were made for codex_autorunner-1.0.0.tar.gz:
Publisher:
release.yml on Git-on-my-level/codex-autorunner
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
codex_autorunner-1.0.0.tar.gz -
Subject digest:
f238ad50f8f54773877f1bdb0c2088c0b1f7231a50af6eeb2e437a9b48c689b4 - Sigstore transparency entry: 864105953
- Sigstore integration time:
-
Permalink:
Git-on-my-level/codex-autorunner@61720d2ef11ca40631ddd9cae4d38f688d9a2532 -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/Git-on-my-level
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@61720d2ef11ca40631ddd9cae4d38f688d9a2532 -
Trigger Event:
push
-
Statement type:
File details
Details for the file codex_autorunner-1.0.0-py3-none-any.whl.
File metadata
- Download URL: codex_autorunner-1.0.0-py3-none-any.whl
- Upload date:
- Size: 971.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
66248cffac88d00d71facbae61dd60cb414ca8e7ecc23e75c351be5389e67f29
|
|
| MD5 |
54f863e2b08fa0847263352c7a2094b3
|
|
| BLAKE2b-256 |
4802bd4e379dd0019b815ecf6a18f595bf28cfd764da4cb8123dffda683b0114
|
Provenance
The following attestation bundles were made for codex_autorunner-1.0.0-py3-none-any.whl:
Publisher:
release.yml on Git-on-my-level/codex-autorunner
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
codex_autorunner-1.0.0-py3-none-any.whl -
Subject digest:
66248cffac88d00d71facbae61dd60cb414ca8e7ecc23e75c351be5389e67f29 - Sigstore transparency entry: 864105959
- Sigstore integration time:
-
Permalink:
Git-on-my-level/codex-autorunner@61720d2ef11ca40631ddd9cae4d38f688d9a2532 -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/Git-on-my-level
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@61720d2ef11ca40631ddd9cae4d38f688d9a2532 -
Trigger Event:
push
-
Statement type: