Skip to main content

Python toolkit for orchestrating Parallel Codex agents across isolated worktrees.

Project description

parallel-codex

Python helpers for orchestrating Parallel Codex agents working in isolated Git worktrees. The toolkit offers a typed core module and a small CLI for planning agent worktrees that the TypeScript layer can execute.

Install

uv tool install parallel-codex
# or: pip install parallel-codex

You’ll get two CLIs:

  • pcodex – minimal, cross‑platform helper that manages git worktrees + tmux and can run codex .
  • parallel-codex – lower-level planner/list/prune for worktree metadata

Prerequisites:

  • git and tmux on PATH. On Windows without tmux, pcodex auto-falls back to wsl.exe -- tmux ....
  • The codex command should be available if you use --run-codex.

Commands

  • uv sync – install dependencies defined in pyproject.toml
  • uv build – build a wheel and sdist using Hatchling
  • uv run pytest – execute the test suite
  • uv run ruff check . – lint the codebase
  • uv run mypy src/ – run type checking with MyPy

Release Checklist

  1. Update the version field in pyproject.toml.
  2. Commit and push the changes.
  3. Tag the commit with py-vX.Y.Z (or vX.Y.Z) and push the tag to trigger the GitHub Actions publish workflow.
  4. Confirm the new release appears on PyPI.

CLI Usage (quickstart)

pcodex up reviewer main --run-codex --attach
pcodex switch reviewer
pcodex list
pcodex prune reviewer --kill-session --remove-dir

CLI Usage (development, no install)

Run the CLIs without installing the package:

uv run src/main.py plan reviewer main --base-dir ./.agents
# or the single-file helper:
uv run src/parallel_codex/pcodex.py up reviewer main --run-codex --attach

The published CLIs expose sub-commands:

  • parallel-codex plan <agent> <branch> – calculate (and optionally materialise) a worktree plan.
  • parallel-codex list – list discovered plans inside a base directory.
  • parallel-codex prune <agent> – remove stored metadata, with --prune-dir to delete the folder entirely.
  • pcodex up <agent> <branch> – ensure git worktree, ensure tmux session, optionally run codex ., and attach.
  • pcodex switch <agent> – switch/attach to the tmux session.
  • pcodex list – list worktrees and tmux session state.
  • pcodex prune <agent> [--kill-session] [--remove-dir] – kill session and/or remove directory.

Each sub-command accepts --base-dir to target a custom location (defaults to ./.agents).

Library Usage

Import the helpers in automation scripts:

from pathlib import Path
from parallel_codex import plan_worktree

plan = plan_worktree(Path("./agents"), "summariser", "feature/summary")
print(plan.path)

Or rely on the CLI for quick experiments:

uv run parallel-codex summariser feature/summary --base-dir ./agents

The CLI prints a single line summary describing the worktree location, agent name, and branch target.

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

parallel_codex-0.1.2.tar.gz (9.5 kB view details)

Uploaded Source

Built Distribution

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

parallel_codex-0.1.2-py3-none-any.whl (11.8 kB view details)

Uploaded Python 3

File details

Details for the file parallel_codex-0.1.2.tar.gz.

File metadata

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

File hashes

Hashes for parallel_codex-0.1.2.tar.gz
Algorithm Hash digest
SHA256 c5e3c410cfa2275692ba310de7e63ea35da27db0202ef424b2ed21afe65ea0ea
MD5 0b42a8774b59590d7c36476501e7b690
BLAKE2b-256 58806690ce2110353a1fad4e8f728d14fad785026ca707a0b418d92f8cde86ab

See more details on using hashes here.

Provenance

The following attestation bundles were made for parallel_codex-0.1.2.tar.gz:

Publisher: deploy-python.yml on parallel-codex/parallel-codex

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

File details

Details for the file parallel_codex-0.1.2-py3-none-any.whl.

File metadata

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

File hashes

Hashes for parallel_codex-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 690b5dbb44af17be4ccd3214a451b34bc2b899692bf95aa2743be392a428bff2
MD5 c861ade9e059660ee15ba61c0188dd2b
BLAKE2b-256 db374b691a8c3d59a5f61793a4c2a735f183c4fb5fc00c133922d17215bacee7

See more details on using hashes here.

Provenance

The following attestation bundles were made for parallel_codex-0.1.2-py3-none-any.whl:

Publisher: deploy-python.yml on parallel-codex/parallel-codex

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