Skip to main content

pipe-pai

pipe-pai is a simple command-line tool that allows you to interact with OpenAI models through Unix pipes. Use it like this: ... | pai - hence the name "pipe-pie".

Installation

Install via pipx (recommended):

pipx install pipe-pai-tool

Or with pip:

pip install pipe-pai-tool

Or locally:

git clone git@github.com:krzysztofarendt/pai.git
cd pai
pipx install .

Ensure your OpenAI API key is set in the environment:

export OPENAI_API_KEY="your_api_key_here"

Optionally, set a default model using the PAI_MODEL environment variable:

export PAI_MODEL="gpt-4"

Usage

Pipe a prompt to pai and receive the model's response on stdout:

echo "Write a haiku about the sea" | pai

Alternatively, specify a different model or API key:

echo "Tell me a joke" | pai --model gpt-4 --api-key $OPENAI_API_KEY

Chat mode

By default, pai runs in the pipe mode with no chat history. You can enter an interactive multi-turn chat by:

pai --chat
> Write a poem about the moon

--------------------
<AI response displayed here>

To exit chat mode, send an empty prompt press ctrl+c or type q, exit, or quit.

Metadata

Release files for pipe-pai-tool 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pipe-pai-tool 0.1.3
File Size Uploaded
pipe_pai_tool-0.1.3.tar.gz 3.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pipe-pai-tool 0.1.3
File Interpreter ABI Platform
pipe_pai_tool-0.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 8.4 kB

Release files / pipe_pai_tool-0.1.3.tar.gz

Download URL pipe_pai_tool-0.1.3.tar.gz
Size 3.9 kB
Tags Source
SHA-256 checksum
How to use checksums
73fb8cb861e68f32e2b9055d0e3d4bee911f3de99e75e5b5b98b0eba50aeece8
BLAKE2b-256 checksum
How to use checksums
60ddc9627d8cfd45508621cc541dd478e2ea6946c51242f2a955c94715a2484f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.7.13

Release files / pipe_pai_tool-0.1.3-py3-none-any.whl

Download URL pipe_pai_tool-0.1.3-py3-none-any.whl
Size 4.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3445b64c9c7a952589c56218683c264ee6c3bf3cc5d8a3a2dfb469cef1956253
BLAKE2b-256 checksum
How to use checksums
85c7f966c4ad7c3bef2195f626aed97d94a4ea05bc490edd1e75cd0ab9063cfa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.7.13

Release history Release notifications | RSS feed

This release

0.1.3 This release

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

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