Skip to content

sasha-computer/pif

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pif demo

pif

Run a command. If it fails, send the output to pi for help.

$ pif brew install --cask claudebar
==> Downloading https://github.com/tddworks/ClaudeBar/releases/download/v0.4.32/ClaudeBar-0.4.32.dmg
Error: SHA-256 mismatch

✗ Exit code: 1
Send to pi? [Y/n]

Install

# With uv (recommended)
uv tool install pif-cli

# Or curl
curl -fsSL https://raw.githubusercontent.com/sasha-computer/pif/main/install.sh | bash

Requires pi to be installed and on your PATH.

Usage

# Run a command — if it fails, send to pi
pif brew install --cask claudebar
pif make build
pif npm install

# Custom message
pif -m "why does this SHA keep mismatching" brew install --cask claudebar

# Skip confirmation
pif -y make build

Shell Integration

Shell integration adds a bare pif command that re-runs your last failed command and sends it to pi. No need to retype it.

Fish

# Copy the function
cp shell/pif.fish ~/.config/fish/functions/pif.fish

# Or with curl
curl -fsSL https://raw.githubusercontent.com/sasha-computer/pif/main/shell/pif.fish -o ~/.config/fish/functions/pif.fish

Then just:

$ brew install --cask claudebar   # fails
$ pif                             # re-runs, captures, sends to pi

Bash / Zsh

# Add to ~/.bashrc or ~/.zshrc
eval "$(curl -fsSL https://raw.githubusercontent.com/sasha-computer/pif/main/shell/pif.bash)"

How It Works

  1. Runs your command, streaming output to the terminal and capturing it
  2. If the command fails (non-zero exit), asks if you want to send to pi
  3. Writes the command + output to a temp file
  4. Launches pi @tempfile "This command failed. Help me fix it."
  5. Pi opens an interactive session with your error as context
  6. Temp file is cleaned up after pi exits

License

MIT

About

Run a command. If it fails, send the output to pi for help.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors