Skip to main content

pathkeeper

pathkeeper is a typed Python CLI for backing up, inspecting, diagnosing, restoring, and repairing the PATH environment variable. When a bad installer, shell tweak, or system tool mangles PATH, pathkeeper gives you a reliable way to recover.

Installation

pipx install pathkeeper

Or any other global installation method.

Quick start

# Interactive menu
pathkeeper

# GUI
pathkeeper gui

Scenarios

Diagnose your PATH

# Checklist view — shows every check with PASS / FAIL / WARN
pathkeeper doctor

# Same, with plain-language explanation for each finding
pathkeeper doctor --explain

# Full entry listing with status markers
pathkeeper inspect

# Show only invalid (missing / not-a-directory) entries
pathkeeper inspect --only-invalid

# Show only duplicate entries
pathkeeper inspect --only-dupes

# JSON output (machine-readable)
pathkeeper doctor --json
pathkeeper inspect --json

Back up and restore

# Create a backup (skips if content is unchanged)
pathkeeper backup

# Always create a backup, even if nothing changed
pathkeeper backup --force

# Attach a note
pathkeeper backup --note "before installing toolchain"

# Preview what would be backed up
pathkeeper backup --dry-run

# List recent backups
pathkeeper backups list

# Inspect a specific backup
pathkeeper backups show          # pick interactively
pathkeeper backups show 2        # backup #2 from the list

# Compare a backup against the live PATH
pathkeeper diff-current          # latest backup vs current
pathkeeper diff-current 2        # backup #2 vs current
pathkeeper diff-current 2025-03-05   # timestamp prefix vs current

# Compare two backups against each other
pathkeeper diff 1 2

# Restore a backup
pathkeeper restore 2025-03-05T14-30-00 --dry-run  # preview
pathkeeper restore 2025-03-05T14-30-00             # apply
pathkeeper restore 2 --scope user                  # user PATH only

Clean up PATH

# Remove duplicates and invalid entries (preview first)
pathkeeper dedupe --dry-run
pathkeeper dedupe

# Remove duplicates only (keep invalid entries)
pathkeeper dedupe --no-remove-invalid

# Repair likely truncated entries (setx damage, etc.)
pathkeeper repair-truncated --dry-run
pathkeeper repair-truncated

# Windows: shorten PATH itself by moving tail segments into helper variables
pathkeeper split-long --dry-run
pathkeeper split-long --force
pathkeeper split-long --var-prefix DEV_PATHS

Discover and add tools

# Preview what would be added
pathkeeper populate --dry-run

# Interactive selection by category
pathkeeper populate

# Add everything found
pathkeeper populate --all

# Add only a specific category
pathkeeper populate --category python

# Show the tool catalog
pathkeeper populate --list-catalog

Inspect shadows and runtime additions

# Show executables that shadow each other across PATH directories
pathkeeper shadow

# Show PATH entries injected at runtime (not from registry / rc files)
pathkeeper runtime-entries

Find an executable

# Find an executable anywhere on the computer (fancy 'which')
pathkeeper locate python

# Find all occurrences
pathkeeper locate python --all

# Windows: search a specific drive
pathkeeper locate python --drive D:\

Edit PATH directly

# Interactive staged editor
pathkeeper edit

# Add / remove / move entries non-interactively
pathkeeper edit --add "/usr/local/newbin" --dry-run
pathkeeper edit --add "/usr/local/newbin" --force
pathkeeper edit --remove "/usr/local/oldbin"
pathkeeper edit --move "/usr/local/bin" --position 1

Automate backups

# Install a scheduled backup task (Task Scheduler / launchd / systemd)
pathkeeper schedule install
pathkeeper schedule install --trigger logon   # Windows per-user logon task
pathkeeper schedule status
pathkeeper schedule remove

# Or inject a backup command into your shell startup file
pathkeeper shell-startup
pathkeeper shell-startup --shell bash --dry-run
pathkeeper shell-startup --remove

Verify your installation

# Run pathkeeper's own health checks (useful when reporting bugs)
pathkeeper selfcheck

What it checks

pathkeeper doctor runs a checklist that includes:

  • Duplicate entries
  • Missing / invalid directories
  • Files in PATH (not directories)
  • Empty entries (stray separators)
  • Missing separators (glued paths like /usr/local/bin/usr/bin)
  • Unresolvable variables (%FOO% / $FOO that are not defined)
  • PATH length (Windows: setx 2047-char limit, registry 32767-char limit)
  • setx truncation sentinel (PATH exactly 1023 or 1024 chars — classic damage sign)

Metadata

Release files for pathkeeper 0.1.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 pathkeeper 0.1.4
File Size Uploaded
pathkeeper-0.1.4.tar.gz 241.3 kB Details

Built distribution (wheel)

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

Total release size: 324.8 kB

Release files / pathkeeper-0.1.4.tar.gz

Download URL pathkeeper-0.1.4.tar.gz
Size 241.3 kB
Tags Source
SHA-256 checksum
How to use checksums
810d50267dd2c3100600fd7637fc2ac48eaab96bb9c7f278efa32b079e15f367
BLAKE2b-256 checksum
How to use checksums
06d5969d67dcfc60e5c6f426d9dec9cdbed21f5ef575eb1a0caea557640f67aa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 19, 2026.

Transparency log

Release files / pathkeeper-0.1.4-py3-none-any.whl

Download URL pathkeeper-0.1.4-py3-none-any.whl
Size 83.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
39f11e63a0262f887a8ce67594e8c0107762422c94a69cd5c3724dc7ee00beb8
BLAKE2b-256 checksum
How to use checksums
6d3f7e2a159612fd9828ca80157d40869e551c1fb848a1e5273ea06875765371
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 19, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.4 This release

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

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