Skip to main content

cacli

coding agent CLI

Recovering Changes From Transcripts

cacli apply-transcript <transcript.jsonl> can recover reconstructable file edits from Claude Code or Codex JSON/JSONL transcripts.

Examples:

# Produce a reviewable patch without touching the working tree
cacli apply-transcript session.jsonl --mode generate-patch

# Apply the auto-applicable prefix directly to the current tree
cacli apply-transcript session.jsonl --mode auto-apply

# Approve each recoverable edit interactively
cacli apply-transcript session.jsonl --mode interactive

Behavior:

  • The command scans the full transcript before doing anything else.
  • It reconstructs Write, Edit, MultiEdit, and apply_patch style changes.
  • It flags mutating shell commands that cannot be reconstructed, such as sed -i.
  • Automatic replay stops at the first unreconstructable mutating shell command or edit that no longer applies cleanly.
  • generate-patch writes a patch for the auto-applicable prefix without modifying the working tree.

Run an agent

A run selects a CLI harness, an inference provider, and an unqualified model ID:

cacli run "Review this diff" --harness claude --provider claude-api --model claude-opus-4-8
cacli run "Review this diff" --harness pi --provider workers-ai --model @cf/zai-org/glm-5.3
cacli run "Review this diff" --harness codex --provider azure --model gpt-5.3-codex

The CLI reads non-secret provider parameters from AWS_REGION, CLOUDFLARE_ACCOUNT_ID, or AZURE_OPENAI_ENDPOINT and checks required credential names or login files before execution. build_launch() returns the command, non-secret environment, environment variables to unset, and credential wire metadata without reading secret values. See the provider design.

Workflows (cacli flow)

Flows are sandboxed Python scripts that orchestrate coding-agent subprocesses across harnesses and inference providers. The orchestration script has no direct filesystem, network, environment, or subprocess access; its side effects go through the injected workflow API, while the agents it launches run with their normal permissions.

Create review_flow.py:

META = {"name": "cross-review", "description": "cross-vendor review"}

async def main():
    phase("Review")
    reviews = await parallel([
        lambda: agent("Find correctness bugs in the current diff", harness="codex"),
        lambda: agent("Find security issues in the current diff", harness="claude"),
    ])
    log(f"Received {len([r for r in reviews if r])} reviews")
    return {"reviews": reviews}

Then run it with a dollar cap:

cacli flow run review_flow.py --budget 5.00

Useful commands:

cacli flow run flow.py [--args JSON] [--budget 10.00] [--resume RUN_ID]
cacli flow runs
cacli flow show RUN_ID
cacli flow docs | less
cacli flow install-skill

cacli flow docs prints the complete DSL reference. Claude users can install the same reference as an agent skill with cacli flow install-skill.

Headline features:

  • Harness selection for Claude, Codex, Devin, Cursor, OpenCode, and Pi, with explicit inference providers
  • Structured output validated against JSON Schema
  • Journal-based resume that replays unchanged calls
  • Dollar budgets with resumable budget-exceeded runs
  • Sandboxed orchestration scripts with a focused async Python DSL

Development

uv sync                     # installs pinned dev tools (ruff, ty, pytest, prek)
uv run prek install         # once: run the hooks on every commit
uv run prek run --all-files # lint, format, typecheck, and test the whole repo

Hooks come from .pre-commit-config.yaml and need prek; stock pre-commit cannot run it. Tool versions are pinned in pyproject.toml's dev group.

Metadata

Release files for cacli 0.2.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cacli 0.2.4
File Size Uploaded
cacli-0.2.4.tar.gz 84.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for cacli 0.2.4
File Interpreter ABI Platform
cacli-0.2.4-py3-none-any.whl Python 3 none any Details

Total release size: 158.4 kB

Release files / cacli-0.2.4.tar.gz

Download URL cacli-0.2.4.tar.gz
Size 84.0 kB
Tags Source
SHA-256 checksum
How to use checksums
cdc959ccfa5d33d4508a6ee56cc0b9de67fc31a8d4de22518863f9c1d5432efb
BLAKE2b-256 checksum
How to use checksums
71e06f1038cec905ffe9a2b7a7b7bf5b2676dee3e863eb332d31f1eb60624bb2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.15

Release files / cacli-0.2.4-py3-none-any.whl

Download URL cacli-0.2.4-py3-none-any.whl
Size 74.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
abe2209a04a0deb56cda299d1ef1e103a13ded51f46137fc95c23674d6e0f245
BLAKE2b-256 checksum
How to use checksums
3884afdbf848c773b8cc8b50e4025f84ad0616788d14db9e0fcad54cc3c3c607
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.15

Release history Release notifications | RSS feed

This release

0.2.4 This release

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page