PATH backup, restore, and repair tool
Project description
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%/$FOOthat 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)
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pathkeeper-0.1.4.tar.gz.
File metadata
- Download URL: pathkeeper-0.1.4.tar.gz
- Upload date:
- Size: 241.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
810d50267dd2c3100600fd7637fc2ac48eaab96bb9c7f278efa32b079e15f367
|
|
| MD5 |
1afc0838a7e97596a397a4d41fddfcc3
|
|
| BLAKE2b-256 |
06d5969d67dcfc60e5c6f426d9dec9cdbed21f5ef575eb1a0caea557640f67aa
|
Provenance
The following attestation bundles were made for pathkeeper-0.1.4.tar.gz:
Publisher:
publish_to_pypi.yml on matthewdeanmartin/pathkeeper
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pathkeeper-0.1.4.tar.gz -
Subject digest:
810d50267dd2c3100600fd7637fc2ac48eaab96bb9c7f278efa32b079e15f367 - Sigstore transparency entry: 1574881270
- Sigstore integration time:
-
Permalink:
matthewdeanmartin/pathkeeper@58a01d5522f4104a6e87b5586a9f34e739f4de23 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/matthewdeanmartin
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish_to_pypi.yml@58a01d5522f4104a6e87b5586a9f34e739f4de23 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file pathkeeper-0.1.4-py3-none-any.whl.
File metadata
- Download URL: pathkeeper-0.1.4-py3-none-any.whl
- Upload date:
- Size: 83.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
39f11e63a0262f887a8ce67594e8c0107762422c94a69cd5c3724dc7ee00beb8
|
|
| MD5 |
76979bbc1293049bff0d4138868e72bf
|
|
| BLAKE2b-256 |
6d3f7e2a159612fd9828ca80157d40869e551c1fb848a1e5273ea06875765371
|
Provenance
The following attestation bundles were made for pathkeeper-0.1.4-py3-none-any.whl:
Publisher:
publish_to_pypi.yml on matthewdeanmartin/pathkeeper
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pathkeeper-0.1.4-py3-none-any.whl -
Subject digest:
39f11e63a0262f887a8ce67594e8c0107762422c94a69cd5c3724dc7ee00beb8 - Sigstore transparency entry: 1574881378
- Sigstore integration time:
-
Permalink:
matthewdeanmartin/pathkeeper@58a01d5522f4104a6e87b5586a9f34e739f4de23 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/matthewdeanmartin
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish_to_pypi.yml@58a01d5522f4104a6e87b5586a9f34e739f4de23 -
Trigger Event:
workflow_dispatch
-
Statement type: