Skip to main content

CLI-first, model-agnostic, plugin-based AI dev workflow automation

Project description

Pipewright

CLI-first, plugin-based AI dev workflow automation. Chain AI agents into multi-step pipelines where each step is focused, checkpointed, and cost-optimized.

Install

pip install pipewright

Or from source:

git clone https://github.com/brangi/pipewright.git
cd pipewright
pip install -e ".[dev]"

Requires Python 3.11+ and an Anthropic API key:

echo "ANTHROPIC_API_KEY=sk-..." > .env

Usage

Generate tests for a source file:

pipewright run test-gen ./src/auth.py

Solve a GitHub issue end-to-end (analyze, plan, implement, open PR):

pipewright run issue-solve 42

Review code changes:

pipewright run code-review HEAD~1..HEAD
pipewright run code-review "#2"

Debug an issue systematically:

pipewright run debug "TypeError in auth.py line 42"

Refactor code:

pipewright run refactor ./src/auth.py

Generate documentation:

pipewright run docs-gen ./src/

List all available workflows:

pipewright list

Auto-approve checkpoints for CI/scripted use:

pipewright run test-gen ./src/auth.py -y

Supported Languages

Pipewright works with any programming language. The AI agents read, analyze, and generate code using standard dev tools. These languages have dedicated examples and test framework detection:

Language Extensions Default Test Framework Example
Python .py pytest example/python/utils.py
JavaScript .js Jest example/js/utils.js
TypeScript .ts, .tsx Vitest example/ts/utils.ts
Java .java JUnit 5 example/java/Utils.java
Rust .rs cargo test example/rust/src/lib.rs
Go .go go test example/go/utils.go
Ruby .rb RSpec example/ruby/utils.rb

Generate tests for any language:

pipewright run test-gen ./src/utils.js       # JavaScript -> Jest
pipewright run test-gen ./src/lib.rs         # Rust -> cargo test
pipewright run test-gen ./cmd/server.go      # Go -> go test

Create a Plugin

Scaffold a new plugin:

pipewright init my-plugin

Or manually -- create plugins/my_plugin/workflow.py:

from pipewright.workflow import Workflow, Step

class MyPluginWorkflow(Workflow):
    name = "my-plugin"
    description = "Does something useful"
    steps = [
        Step(name="analyze", prompt="Analyze {target}.\n\n{context}",
             tools=["Read", "Glob"], model="haiku"),
        Step(name="execute", prompt="Execute on {target}.\n\n{context}",
             tools=["Read", "Write"], model="sonnet", checkpoint=True),
    ]

Run pipewright list to verify it appears.

Architecture

CLI (Click)
  |
  v
Plugin Loader ---- plugins/*/workflow.py
  |
  v
Engine (async orchestrator)
  |
  +---> Step 1: Agent (Claude SDK) ---> context
  +---> Step 2: Agent (Claude SDK) ---> context
  +---> Step 3: Agent (Claude SDK) ---> context (checkpoint)
  |
  v
Result (with memory persistence via MCP)

Each step runs a Claude agent with a focused prompt. Steps chain via context accumulation. Checkpoints pause for human review. Model tiering (haiku for cheap steps, sonnet for complex) keeps costs low.

Project Structure

src/pipewright/
  cli.py            CLI entry point (Click)
  engine.py         Async orchestrator
  workflow.py       Step, Chain, Workflow dataclasses
  config.py         JSON config (~/.pipewright/config.json)
  plugins/loader.py Plugin discovery
  memory/           Persistent memory (JSON + MCP server)
  observability/    Terminal display and SDK hooks

plugins/
  test_gen/         Generate test suites
  issue_solve/      Solve GitHub issues end-to-end
  code_review/      Review code changes
  refactor/         Refactor code
  docs_gen/         Generate documentation
  debug/            Systematic debugging

Configuration

pipewright config set model sonnet
pipewright config set max_budget_usd 1.00
pipewright config get model

Settings stored in ~/.pipewright/config.json. API keys come from environment variables or .env (never stored in config).

Contributing

See CONTRIBUTING.md for development setup, coding guidelines, and how to add plugins. For the full plugin authoring reference, see docs/PLUGIN_GUIDE.md.

Roadmap

See ROADMAP.md for planned features and milestones.

License

MIT -- see LICENSE.

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

pipewright-0.2.1.tar.gz (29.5 kB view details)

Uploaded Source

Built Distribution

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

pipewright-0.2.1-py3-none-any.whl (18.6 kB view details)

Uploaded Python 3

File details

Details for the file pipewright-0.2.1.tar.gz.

File metadata

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

File hashes

Hashes for pipewright-0.2.1.tar.gz
Algorithm Hash digest
SHA256 1899148b5a09eb309ed3f7fe514ec18b7c9a56d552a8d61cbd2081dacd7e2c77
MD5 15da09075b05f18fbe46efc3a121e422
BLAKE2b-256 7372e543c2434573b8c6587e66cfc8218bb837ccbeff622b2c6ab1fa4f96da43

See more details on using hashes here.

Provenance

The following attestation bundles were made for pipewright-0.2.1.tar.gz:

Publisher: publish.yml on brangi/pipewright

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

File details

Details for the file pipewright-0.2.1-py3-none-any.whl.

File metadata

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

File hashes

Hashes for pipewright-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ec628a96574a83cef67226b00db622ef30f8b681da38b96251970fdf6a7f3a93
MD5 67b61a4a859839590c8e650e3cb41440
BLAKE2b-256 c83b0a362d85a080add3cbe548a28b3c7a34a34e7e5c6b304310f723887c8b9e

See more details on using hashes here.

Provenance

The following attestation bundles were made for pipewright-0.2.1-py3-none-any.whl:

Publisher: publish.yml on brangi/pipewright

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