Skip to main content

Plan-oriented engineering workflow for Pi (the CLI exterior / session host).

Project description

perk

A Pi-native, plan-oriented engineering workflow — a Python perk CLI (the session exterior) plus a TypeScript Pi extension (the session interior).

Start at docs/user-docs/.

Originally based on prior art erk, by the team at dagster

What perk is

perk implements a plan-oriented engineering workflow (explore read-only → save a plan → implement on a branch → submit → land → learn) to Pi, split across two planes:

  • the exterior — a Python perk CLI that scaffolds repos, positions worktrees, mints run ids, and launches primed pi sessions (everything that happens outside a session);
  • the interior — a TypeScript Pi extension that drives stage transitions and state inside a running session.

A language-neutral shared/ contract (the stage registry + cross-plane specs) is the single source both planes read, so the two stay in lockstep without a codegen step.

perk is built to bootstrap its own development: each phase leaves perk capable of driving the next, and perk's own repo is the first thing it scaffolds.

Quickstart

perk targets any git repo. From the repo you want to wire:

uv tool install perk        # (or run from source — see Develop)
perk init                   # scaffold/converge Pi wiring (idempotent; safe to re-run)
perk doctor                 # report health; perk doctor --fix repairs drift

perk init requires a git repo + git, gh, node ≥ 22, ast-grep, and pi on PATH. GitHub auth is verified but never required (it is reported, never fatal).

For the guided first run, follow Get started with perk.

Documentation

The operator-facing docs live under docs/user-docs/, organized as the four Divio quadrants:

  • Tutorials — learning-oriented lessons; start with Get started with perk.
  • How-to guides — goal-oriented recipes (resume a plan, address review feedback, switch to Linear, attach a skill, …).
  • Reference — the CLI surface, in-session commands & tools, the objective roadmap model, configuration, and providers & backends.
  • Explanation — how perk thinks; headless/remote maturity.

perk's internal research and planning record lives under docs/ and is for perk's own developers.

Layout

  • perk/ — the Python CLI (the session exterior).
  • extension/ — the TypeScript Pi extension (the session interior).
  • shared/ — cross-plane contracts (the stage registry + specs), bundled into both build artifacts.
  • docs/ — research inputs, design notes, and durable learnings.

Develop

Two pinned toolchains:

  • Pythonuv (3.13, pinned in .python-version), ruff (lint/format), ty (types).
  • TypeScript — npm (Node ≥ 22, .npmrc), Biome (lint/format), tsc (types).

With just:

just setup        # uv sync + npm install + git hooks + install-cli (the `perk` CLI on PATH)
just install-cli  # just the `perk` CLI on PATH (editable: tracks this clone)
just fmt          # ruff format + biome format
just lint         # ruff check + biome check
just typecheck    # ty + tsc
just test         # pytest + node:test (the regression gate)
just ci           # setup + lint + typecheck + test

After just setup (or just install-cli), call perk directly — no uv run. The install is editable, so a git pull reflects Python changes live; re-run just install-cli after a dependency change. It lands in uv's tool bin (~/.local/bin) — if perk isn't found, that dir is not on your PATH; run uv tool update-shell (then restart your shell). Remove it with uv tool uninstall perk.

Releasing perk → see docs/releasing.md (version SSOT, dual-plane runbook, the validate-release-versions tag gate).

just setup also runs just hooks (prek install), wiring a prek pre-commit hook that runs ruff check on staged Python (config in prek.toml; the ruff env is built by prek from the remote ruff-pre-commit repo, so it never depends on a system/.venv ruff). Re-run just hooks after a fresh clone.

Without just: uv run … for Python (uv run perk init, uv run pytest, uv run ruff check perk tests, uv run ty check) and npm run … for TypeScript (npm run lint, npm run typecheck).

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

perk-1.0.1.tar.gz (452.7 kB view details)

Uploaded Source

Built Distribution

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

perk-1.0.1-py3-none-any.whl (585.0 kB view details)

Uploaded Python 3

File details

Details for the file perk-1.0.1.tar.gz.

File metadata

  • Download URL: perk-1.0.1.tar.gz
  • Upload date:
  • Size: 452.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for perk-1.0.1.tar.gz
Algorithm Hash digest
SHA256 27b10f911cfb754129bc93002cee3e87c37e2b21be844b4abf9a639d8f21ef88
MD5 d526fddbd9762127354a537acf5b7a34
BLAKE2b-256 cbc4b647714acd0fe5e3ef654141e10c70b3ea9a00c4f01ae5c515cedb574b6f

See more details on using hashes here.

Provenance

The following attestation bundles were made for perk-1.0.1.tar.gz:

Publisher: release.yml on mattgiles/perk

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

File details

Details for the file perk-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: perk-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 585.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for perk-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 59084aed24509c3e4f034309b01aa2f0dbbb8037478ef08c31c2dde39fbb597f
MD5 87fe34fa1f96f67c005cdf64483f9876
BLAKE2b-256 bf7803289f6e9ec2ed0f3bff2b1e9f263a258912000ffa23d3c8e851a6c171bb

See more details on using hashes here.

Provenance

The following attestation bundles were made for perk-1.0.1-py3-none-any.whl:

Publisher: release.yml on mattgiles/perk

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