A command-line tool to interact with Large Language Models (LLMs) via stdin or files.
Input handling mimics POSIX cat in how it reads from files and stdin, but it collects all input before sending it to the LLM for processing, unlike cat which outputs immediately.
Before using paip, you need to configure your LLM API key and settings.
Run the following command to create a default configuration file:
paip --init-configThis will create a config.toml file in the appropriate configuration directory for your system (e.g., ~/.config/paip/config.toml).
Edit this file to:
- Specify the
provider(e.g.,gemini). - Add your LLM provider's API
keyorkey_cmdunder the corresponding provider section (e.g., undergemini:). Only one of these can be set. - Configure other settings like the
timeout(in milliseconds), model (e.g.,gemini-2.5-flash), temperature, top_p, top_k, max_output_tokens, and thinking_budget under the provider section.
Currently, only the gemini provider is supported.
Usage: paip [OPTIONS] [FILES]...
Arguments:
[FILES]... Files to process. Reads from stdin if no files are provided. Use '-' to read from stdin within a list of files.
Options:
-p, --prompt <PROMPT> Use a predefined prompt from the configuration file.
-m, --message <MESSAGE> Additional message to include after input.
--init-config Create a default configuration file if it doesn't exist.
-v, --verbose Enable verbose output for debugging.
-h, --help Print help
-V, --version Print version
Process text from stdin:
echo 'Summarize this text.' | paipProcess text from a file:
paip file.txtProcess text from multiple files:
paip file1.txt file2.txtProcess text from stdin and a file using a specific prompt:
echo 'Additional context.' | paip -p sum file.txt -Explain most recent git commit:
git show | paipFind issues in last 3 git commits:
git log -3 -p | paip -m 'Any issues?'Write a conventional commit message for staged changes and pipe it to git commit while allowing editing:
git diff --cached | paip -p commit | git commit -e -F -Translate text to Italian:
echo "Hello world" | paip -p itReview code:
git diff --cached | paip -p reviewGPL-2.0-only