Skip to content

kennethnym/twindex

Repository files navigation

twindex

Pair-programming orchestrator for two Codex instances (driver + navigator). It starts by selecting a pair-programming ritual and generating a PRD, then runs the driver/navigator loop.

Install

bun install

Run

bun run index.ts --task "Describe the task"

If your Codex setup needs an API key explicitly:

OPENAI_API_KEY=... bun run index.ts --task "Describe the task"

Optional flags:

  • --model (or --driver-model / --navigator-model)
  • --apply-patches (apply diff blocks from the driver, default: true)
  • --no-apply-patches (disable applying driver patches)
  • --run-approved-commands (execute commands approved by the navigator, default: true)
  • --no-run-approved-commands (disable running approved commands)
  • --list-models
  • --prd-path (write PRD to a file, default: prd.md)
  • --no-prd-file (skip writing the PRD file)
  • --no-intake (skip the interactive intake chat)
  • --output-dir (change working directory before running; creates it if missing)
  • --danger-full-access (use Codex CLI danger-full-access sandbox mode)
  • --rounds (set a fixed number of rounds; otherwise runs until both say OK_TO_STOP)
  • --swap-interval (0 disables swapping)

Notes

  • Set CODEX_MODEL to override the default model.
  • The script prints a full transcript of driver/navigator turns.
  • --apply-patches uses git apply when a .git folder exists, otherwise it falls back to patch.
  • --list-models tries codex models and falls back to codex --help.
  • Requires the Codex CLI installed locally (the SDK shells out to it).
  • The navigator approves commands by replying with APPROVE_COMMANDS and a bash block.
  • Commands use short names: the driver writes # cmd: <name> as the first line of each bash block, and the navigator approves by listing names in a text block under APPROVE_COMMANDS.
  • Intake mode lets you chat before the pair starts; type /start to summarize and confirm.
  • Intake multiline input: enter /ml, then type lines, end with /end (or use a trailing \ to continue).
  • Driver and navigator outputs stream live during the pair rounds.
  • Eval helper: node tools/eval.js path/to/transcript.txt (rules in eval.yaml).
  • Sample run transcripts live in test-run-transcripts/.

About

twindex runs 2 codex instances and let them pair program together

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors