Metadata-Version: 2.4
Name: ralph-workflow
Version: 0.9.33
Summary: AI agent orchestrator and software factory: give it a spec and your own checks, and it runs plan, build, verify, fix as a configurable workflow graph across Git worktrees with the coding agent you already use.
Project-URL: Homepage, https://ralphworkflow.com
Project-URL: Documentation, https://ralphworkflow.com/docs
Project-URL: Repository, https://github.com/Ralph-Workflow/Ralph-Workflow
Project-URL: Issues, https://github.com/Ralph-Workflow/Ralph-Workflow/issues/new
Project-URL: Community, https://github.com/Ralph-Workflow/Ralph-Workflow/issues
Project-URL: Codeberg Mirror, https://codeberg.org/RalphWorkflow/Ralph-Workflow
Project-URL: Changelog, https://github.com/Ralph-Workflow/Ralph-Workflow/blob/main/ralph-workflow/CHANGELOG.md
Author: Mistlight
Maintainer: Mistlight
License: AGPL-3.0-or-later
License-File: LICENSE
Keywords: agent,ai,coding,coding-agents,git-worktrees,orchestration,software-factory
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)
Classifier: Natural Language :: English
Classifier: Operating System :: MacOS
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Software Development :: Build Tools
Classifier: Topic :: Software Development :: Code Generators
Requires-Python: >=3.12
Requires-Dist: ddgs>=9.14.0
Requires-Dist: gitpython>=3.1
Requires-Dist: httpx>=0.27
Requires-Dist: jinja2>=3.1
Requires-Dist: loguru>=0.7
Requires-Dist: mcp>=1.27.0
Requires-Dist: packaging>=23.0
Requires-Dist: psutil>=5.9
Requires-Dist: pydantic>=2.7
Requires-Dist: pygments>=2.18
Requires-Dist: questionary>=2.0
Requires-Dist: readability-lxml>=0.8.1
Requires-Dist: rich-click>=1.8
Requires-Dist: rich>=13.0
Requires-Dist: selectolax>=0.3.21
Requires-Dist: sentry-sdk>=2.0
Requires-Dist: tomli-w>=1.0
Requires-Dist: tqdm>=4.66
Requires-Dist: typer>=0.12
Requires-Dist: watchdog>=4.0
Provides-Extra: bundle
Requires-Dist: pyinstaller>=6.0; extra == 'bundle'
Provides-Extra: dev
Requires-Dist: bandit>=1.9.4; extra == 'dev'
Requires-Dist: hatch; extra == 'dev'
Requires-Dist: hypothesis>=6.100; extra == 'dev'
Requires-Dist: mypy; extra == 'dev'
Requires-Dist: pathspec>=1.0.4; extra == 'dev'
Requires-Dist: pydantic>=2.7; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
Requires-Dist: pytest-cov>=4.0; extra == 'dev'
Requires-Dist: pytest-xdist>=3.6; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: readability-lxml>=0.8.1; extra == 'dev'
Requires-Dist: ruff; extra == 'dev'
Requires-Dist: selectolax>=0.3.21; extra == 'dev'
Requires-Dist: types-psutil>=5.9; extra == 'dev'
Requires-Dist: vulture>=2.16; extra == 'dev'
Provides-Extra: docs
Requires-Dist: linkify-it-py>=2; extra == 'docs'
Requires-Dist: myst-parser; extra == 'docs'
Requires-Dist: sphinx-copybutton>=0.5; extra == 'docs'
Requires-Dist: sphinx-design>=0.5; extra == 'docs'
Requires-Dist: sphinx>=7; extra == 'docs'
Provides-Extra: web-search
Requires-Dist: brave-search-python-client>=0.4.27; extra == 'web-search'
Requires-Dist: exa-py>=2.12.0; extra == 'web-search'
Requires-Dist: tavily-python>=0.7.23; extra == 'web-search'
Description-Content-Type: text/markdown

# ralph-workflow — the AI agent orchestrator and software factory

**The operating system for autonomous coding.**

**Multiple coding agents. Separate worktrees. One mainline.**

Coding agents write code fast. The handoffs around them cap throughput:
babysitting sessions, resolving conflicts, re-running checks, waiting in
review queues.

Ralph Workflow is a free, open-source AI agent orchestrator and software
factory for developers and teams who already have a coding agent: you
supply the specification and the checks you trust, and it runs plan, build,
verify, and fix as a configurable workflow graph across Git worktrees,
returning integrated, checked software on one mainline. At the core is the
simple Ralph loop: plan → build → verify → fix. Around it: agent review,
retries, fallback agent chains, durable handoffs, interruption recovery,
and Git integration.

The factory terms are literal: your specification and checks are the
input, phases are the stations, your checks are the quality gates, agent
chains are the interchangeable workers, worktrees are the parallel
lines, and integration is shipping to the mainline. See
[concepts](https://github.com/Ralph-Workflow/Ralph-Workflow/blob/main/ralph-workflow/docs/sphinx/concepts.md).

**Ralph Workflow manages the harness, not the models.** A harness of
harnesses: coding agents such as Claude Code, Codex, and Cursor are
harnesses around models, and Ralph Workflow is the workflow, review,
recovery, and Git layer around those agents. There is no vendor lock-in:
nine built-in agent backends ship with it, and agent chains can mix them
and fall back to the next when an attempt fails. Switching or combining
vendors is a configuration change, not a rewrite. Ralph Workflow needs no
API key of its own and sells no model access; it launches the agent CLI you
installed and authenticated, so whatever login or subscription that agent
supports is what runs. Each agent defines its own authentication (a login,
an API key, or either), and the agent's vendor determines model access,
rate limits, and cost.

Every default ships with the package (workflow, agent chains, tools,
artifact contracts, retries, recovery, Git sync), and `ralph --init` seeds
your setup, so there is no setup project before the first useful run:
productive on day 1, preconfigured, and yours to tweak. See the
[bundled defaults](https://github.com/Ralph-Workflow/Ralph-Workflow/blob/main/ralph-workflow/docs/sphinx/configuration.md#bundled-defaults).

It runs on your machine: local, free, AGPL-3.0-or-later, no account, no
hosted service, and no metering from Ralph Workflow. Your specifications,
configuration, and Git history stay yours. Run one agent by hand and you
are the scheduler, reviewer, and merger; run a plain loop and it repeats
one prompt; Ralph Workflow runs the graph for you and lands checked work
on one mainline. Move beyond pull requests: review and integration happen
inside the execution graph. You define the outcome and the checks;
Ralph Workflow runs the workflow; you judge the software.

It fits work with a clear finish line and checks you trust; it is not
(yet) for open-ended exploration or repositories with no reliable tests
or checks. If that is your repository, build the finish line first:
write down what "done" means and add a test or check you trust, then
come back.

## Install

**Requirements:** Python 3.12 or newer, Git, `pipx`, and one coding agent
CLI you have already installed and authenticated.

```bash
pipx install ralph-workflow
ralph --version
```

`pip install ralph-workflow` in a Python 3.12+ virtual environment also
works.

From a source checkout instead? See [CONTRIBUTING.md](https://github.com/Ralph-Workflow/Ralph-Workflow/blob/main/ralph-workflow/CONTRIBUTING.md#dev-build-vs-stable-build).

## First run

New to Ralph Workflow? [START_HERE.md](https://github.com/Ralph-Workflow/Ralph-Workflow/blob/main/START_HERE.md)
walks through a first serious run.

In the git repository you want Ralph Workflow to work on:

```bash
ralph --init          # user-global config, starter PROMPT.md, detected agents
ralph --list-agents   # the configured agents
ralph --diagnose      # pre-flight checks, every line should be green
```

Then edit `PROMPT.md`: state the outcome and the checks you expect, and
remove the `<!-- ralph:starter-prompt ... -->` marker at the top.
Ralph Workflow refuses to run while that sentinel remains. A small first
task looks like this:

```markdown
# Goal
Reject an empty email address in the signup validator with a clear error.

## Acceptance criteria
- An empty email is rejected before a user record is created.
- Valid signup behavior and public interfaces stay unchanged.
- Tests cover both the rejected input and a valid signup.

## Verification
- Run python -m pytest and fix any failures.
```

Start the run with `ralph`. A successful first run completes with the
changes committed in a worktree and either integrated onto the mainline or
reported with the evidence it produced. Then read the summary of what
changed and which checks passed.

## Built-in agent backends

Nine backends ship with Ralph Workflow. Authenticate the CLI yourself;
Ralph Workflow uses each agent's own login or key. For Cursor and AGY,
which run in a private per-run home, it copies your existing local login
files into that home so the agent can use them; see the
[agent CLI lifecycle](https://github.com/Ralph-Workflow/Ralph-Workflow/blob/main/ralph-workflow/docs/sphinx/agents.md).

| Backend | CLI | Authentication | Transport and caveats |
|---|---|---|---|
| **Claude Code** | `claude` | `claude login` or an Anthropic API key | Interactive PTY; the reference agent. |
| **Claude Code (headless)** | `claude` | Same as `claude` | Same binary without a PTY. |
| **Codex** | `codex` | `codex login` or an OpenAI API key | Unattended `codex exec`; no session resume. |
| **OpenCode** | `opencode` | Provider-specific keys | Headless subprocess; model selection uses `-m <provider>/<model>`. |
| **Nanocoder** | `nanocoder` | Local-only TUI, no remote auth | Local-only TUI; a provider is required for model aliases. |
| **AGY (Google Anti Gravity)** | `agy` | `agy login` with a Google account | PTY transport; `agy/<model>` is checked against the live `agy models` listing (no built-in list); if that listing fails, Ralph Workflow warns with the AGY error and uses the configured model as written. |
| **Pi** | `pi` | Provider configuration | Headless `pi --mode json <prompt>`. |
| **Cursor** | `agent` | `CURSOR_API_KEY` or a file-backed login | Headless `--print`; credentials come from file, not the Keychain, unless `AGENT_CLI_CREDENTIAL_STORE=memory` is set explicitly. If no valid Cursor auth file exists, Ralph Workflow copies your existing Cursor IDE login into Cursor's file-backed auth paths. |
| **Kimi Code** | `kimi` | an interactive `kimi` login wires the `managed:kimi-code` subscription provider | Headless; `-m` needs a fully configured model ID from `~/.kimi-code/config.toml`. |

Model strings differ per agent: see [agent compatibility](https://github.com/Ralph-Workflow/Ralph-Workflow/blob/main/ralph-workflow/docs/sphinx/agent-compatibility.md).

## Independent work, shared mainline

Each run works in its own Git worktree and syncs with the configured
mainline at startup, after commits, and at phase boundaries. Integration
rebases the feature onto the mainline, routes conflicts to a resolution
agent chain, falls back to an endpoint merge when resolution fails, and
fast-forwards the mainline to the landed tip once Git proves the
integration finished. Local integration is on by default with `main` as
the default target; remote sync publishes to the configured remote when
one exists and can be turned off for local-only operation; recovery state
is durable, so an interrupted run resumes where it stopped.

Two limits: branch protections and required checks still apply, and
Ralph Workflow does not bypass them. And the worktree holding `main` is
integration infrastructure: Ralph Workflow may snapshot its uncommitted
content to a recoverable ref and reset the worktree. Keep active edits in
feature worktrees. Details: [auto-integration](https://github.com/Ralph-Workflow/Ralph-Workflow/blob/main/ralph-workflow/docs/sphinx/configuration.md#auto-integration).

## Make it yours

| File | What it configures | Reference |
|---|---|---|
| `ralph-workflow.toml` | agent chains, retries, and Git sync | [Configuration reference](https://github.com/Ralph-Workflow/Ralph-Workflow/blob/main/ralph-workflow/docs/sphinx/configuration.md) |
| `pipeline.toml` | phases, routing, and loopbacks | [Pipeline configuration](https://github.com/Ralph-Workflow/Ralph-Workflow/blob/main/ralph-workflow/docs/sphinx/advanced-pipeline-configuration.md) |
| `mcp.toml` | MCP tool servers and web access | [MCP configuration](https://github.com/Ralph-Workflow/Ralph-Workflow/blob/main/ralph-workflow/docs/sphinx/advanced-mcp-configuration.md) |
| `artifacts.toml` | artifact contracts and output types | [Artifact configuration](https://github.com/Ralph-Workflow/Ralph-Workflow/blob/main/ralph-workflow/docs/sphinx/advanced-artifact-configuration.md) |

User-global (`~/.config/`) and project-local (`.agent/`) are separate
scopes: `ralph-workflow.toml` keeps one name in both, while `pipeline.toml`,
`mcp.toml`, and `artifacts.toml` are the project-local names for the
user-global `ralph-workflow-pipeline.toml`, `ralph-workflow-mcp.toml`, and
`ralph-workflow-artifacts.toml`.

## Skills

Ralph Workflow installs its skills through the built-in update mechanism:
artifact skills install into the project scope and are bound to the
pipeline's artifact types: each artifact type carries at most one skill.
Four universal skills
(`test-driven-development`, `systematic-debugging`,
`verification-before-completion`, `antislop`) install user-global and can be
turned off. See the
[configuration reference](https://github.com/Ralph-Workflow/Ralph-Workflow/blob/main/ralph-workflow/docs/sphinx/configuration.md#skills)
for update cadence and the trust statement.

## Protections

A two-stage commit review runs immediately before each commit as a damage gate
and edit phase. Stage 1 computes deterministic tripwires from tracked and
untracked pending state, with the `CommitReviewPolicy` defaults
(`max_deleted_files` 50, `max_deleted_fraction` 0.25, `binary_size_limit`
1_000_000 bytes, `proposal_retention` 10, `max_rejections` 2; see
[commit review configuration](https://github.com/Ralph-Workflow/Ralph-Workflow/blob/main/ralph-workflow/docs/sphinx/configuration.md#commit-review-configuration));
hard mass or protected-deletion damage rejects without invoking an agent. Stage 2
applies validated housekeeping edits only and never performs source-code review. A
normal rejection saves the pending proposal under
`refs/ralph/proposals/<run>/<iteration>`, resets every pending-commit file, and
returns to development; a rejection at the consecutive-rejection limit or after
the cycle timebox retains the saved proposal ref and routes to `failed_terminal`
without another reset. Only exact deletions in the planning-analysis-approved
plan may bypass mass-deletion accounting; protected deletions never bypass, and
developer or reviewer input cannot widen the list. Ralph Workflow's own engine writes are
auto-committed in isolation at the producer boundary: each commit covers
only the exact paths the writer just modified, paths that are already
dirty are skipped and stay in the agent or user commit flow, and an
auto-commit failure is logged but never blocks the run. See the
[auto-commit contract](https://github.com/Ralph-Workflow/Ralph-Workflow/blob/main/docs/agents/deterministic-auto-commit.md).

## Next steps

- **Evaluate it:** [START_HERE.md](https://github.com/Ralph-Workflow/Ralph-Workflow/blob/main/START_HERE.md) — a first serious run, end to end.
- **Use it:** the [operator manual](https://github.com/Ralph-Workflow/Ralph-Workflow/blob/main/ralph-workflow/docs/sphinx/index.rst) — getting started, configuration, and every reference.
- **Contribute:** [CONTRIBUTING.md](https://github.com/Ralph-Workflow/Ralph-Workflow/blob/main/ralph-workflow/CONTRIBUTING.md) — every pull request must agree to the [Contributor License Agreement](https://github.com/Ralph-Workflow/Ralph-Workflow/blob/main/CLA.md).

## License

AGPL-3.0-or-later: you may run, read, and modify it; if you offer a
modified version over a network, you publish your changes.
The Ralph loop pattern is credited to Geoffrey Huntley; Ralph Workflow is
an independent implementation built on that core. No agent vendor named
above endorses this project.

## Project home

- **Repository:** <https://github.com/Ralph-Workflow/Ralph-Workflow> — **PyPI:** <https://pypi.org/project/ralph-workflow/>
- **Issue tracker:** <https://github.com/Ralph-Workflow/Ralph-Workflow/issues/new>
- **License:** [LICENSE](https://github.com/Ralph-Workflow/Ralph-Workflow/blob/main/ralph-workflow/LICENSE) — **Code of conduct:** [CODE_OF_CONDUCT.md](https://github.com/Ralph-Workflow/Ralph-Workflow/blob/main/CODE_OF_CONDUCT.md)
