Skip to main content

Forklift

Forklift is a local CLI/TUI for keeping long-lived forks current. It finds the fork's current upstream base, chooses the next upstream target, rebases your custom commits, runs your local checks, and writes a report with the exact files, commits, checks, and branch changes.

detect-upstream-base -> target discovery -> rebase-assistant -> local-test-runner

Install

uv tool install forklift-ai

or:

pipx install forklift-ai

The primary command is:

forklift

auto-rebase is kept as a compatibility alias.

Quick Start

Run these inside your forked repository:

forklift init
forklift doctor
forklift detect-base
forklift run

forklift init writes .auto-rebase.yaml and opens a guided setup form when the terminal is interactive. The form auto-loads local remotes, remote-tracking branches, tags, tag patterns, and likely test commands.

For later edits:

forklift config edit

What forklift run Does

1. refuse to start if the working tree has unrelated local changes
2. detect the fork's current upstream base
3. resolve the target upstream tag or branch
4. run baseline checks before rebasing
5. create a local backup branch
6. rebase your custom commits onto the target
7. run post-rebase checks
8. apply the successful rebase back to your original branch
9. show a run screen with the result and push decision
10. write artifacts and a final summary

If use_worktree: true is enabled, Forklift does the risky work in a temporary worktree first. When the post-rebase checks pass, it moves your original branch to the successful rebased HEAD and removes the temporary run branch.

The CLI prints the important result directly:

Forklift run complete
- status: healthy
- branch: test_branch
- base: v1
- target: v2
- custom commits replayed: 4
- changed files: 7
- local branch updated: yes
- backup branch: auto-rebase/backup-...

Checks
- baseline/tests: passed (0)
- post_rebase/tests: passed (0)

Next step
- remote branch updated: no
- push rebased branch: git push --force-with-lease origin test_branch

status=healthy
report=.auto-rebase/artifacts/.../summary.md

In an interactive terminal, forklift run opens a TUI that shows the local result and asks whether to push the rewritten branch. Forklift never pushes silently. A successful rebase rewrites local commit IDs, so remote updates require an explicit confirmation and use --force-with-lease.

For scripts or raw terminal output:

forklift run --plain

Configuration

The generated .auto-rebase.yaml is intentionally small enough to review:

project:
  name: forklift

auto_rebase:
  target_mode: latest_tag
  explicit_target: null
  max_iterations: 5

detect_upstream_base:
  upstream_remote: upstream
  upstream_branch: main
  tag_pattern: "v*"

local_test_runner:
  baseline_required: true
  checks:
    - name: tests
      run: "uv run --extra dev pytest -q"
      timeout_minutes: 20

forklift init overwrites an existing .auto-rebase.yaml with a clean generated file. Use forklift config edit when you want to update it later.

Artifacts

Every run writes a timestamped folder under .auto-rebase/artifacts/:

detection/      current base, base tag, custom commits, patch
target/         selected target ref and upstream diff
measurement/    baseline and post-rebase command logs
controller/     rebase logs, conflicts, repair packets, apply logs
summary.md      branch update, commits, conflicts, files, check results
replay.sh       manual reproduction script

The newest run is also linked at .auto-rebase/artifacts/latest/.

Safety

Forklift is local-first and conservative:

  • refuses dirty working trees by default
  • creates a backup branch before rebasing
  • never pushes without explicit confirmation
  • only updates the original branch after post-rebase checks pass
  • keeps failed/conflicted worktrees available for inspection
  • redacts common secret variables from logs and repair packets

Development

uv run --extra dev pytest
uv run --extra dev ruff check .
uv build --no-sources

Verify a built wheel through the tool-install path:

UV_TOOL_DIR=/tmp/forklift-tool \
UV_TOOL_BIN_DIR=/tmp/forklift-tool-bin \
uv tool install dist/forklift_ai-0.1.0-py3-none-any.whl

/tmp/forklift-tool-bin/forklift init

Metadata

Release files for forklift-ai 0.1.0

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

Source distribution (sdist)

Source distribution for forklift-ai 0.1.0
File Size Uploaded Provenance
forklift_ai-0.1.0.tar.gz 53.5 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for forklift-ai 0.1.0
File Interpreter ABI Platform
forklift_ai-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 93.3 kB

Release files / forklift_ai-0.1.0.tar.gz

Download URL forklift_ai-0.1.0.tar.gz
Size 53.5 kB
Tags Source
SHA-256 checksum
How to use checksums
1f09bffd664f13b7e8e3e81b32067c7ea3e69a7fa8175ebfe3fed2247621d7e4
BLAKE2b-256 checksum
How to use checksums
95367543cd68515e134858ee654c6a9155dafabb6c0741eed04ab34b583d5478
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.22 {"installer":{"name":"uv","version":"0.9.22","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / forklift_ai-0.1.0-py3-none-any.whl

Download URL forklift_ai-0.1.0-py3-none-any.whl
Size 39.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6391274f88ae421c0ce2f6d05b17e5a4d44ede2fac733e31237df53fff2ddbf2
BLAKE2b-256 checksum
How to use checksums
88eb477edc2548a47dfc48e205a6b80acc83593df710790752339682e78d9288
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.22 {"installer":{"name":"uv","version":"0.9.22","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for forklift-ai 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

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