Metadata-Version: 2.4
Name: carlab-pi
Version: 0.5.10
Summary: PI terminal coding harness for the CARLab Qwen model.
Requires-Python: >=3.7
Description-Content-Type: text/markdown

# PI

Installable terminal coding harness for the CARLab local Qwen model.

## Install

From another machine:

```bash
scp william@128.175.213.232:/media/william/mist2/william/Github/CARLabAssistant/packages/pi-client/dist/carlab_pi-0.5.10-py3-none-any.whl .
python3 -m pip install --user ./carlab_pi-0.5.10-py3-none-any.whl
```

From a wheel or source directory:

```bash
python3 -m pip install carlab_pi-0.5.10-py3-none-any.whl
```

or:

```bash
python3 -m pip install .
```

## Configure

Create an API key in Open WebUI, then save it locally:

```bash
pi setup --api-key <your-open-webui-api-key>
```

The default endpoint is:

```text
http://128.175.213.232:8080/api/v1
```

## Use

```bash
pi
pi --version
pi status
pi ask "Write a Python function that reads a CSV."
pi chat --file app.py
pi resume
pi resume 20260611-103000-a1b2c3d4
```

Inside interactive mode:

```text
/pwd
/cd PATH
/ls [PATH]
!pytest -q
/file PATH
/exit
```

Use the up/down arrow keys to navigate previously sent prompts. Prompt history
is stored persistently at `~/.pi/history`.

PI also handles common requests without slash commands:

```text
list the files in the current directory
read the server config file
fix the typo in readme
search the web for the latest release notes
```

When you ask PI to edit a file, it fuzzy-matches the file, asks the model for a
unified diff, applies it, and saves the file automatically.

PI can also search the web when the harness decides the request needs current,
niche, or uncertain information. Stable questions are answered without web
search.

Internal searches, file reads, and tool calls stay quiet by default. PI uses
their results as context and prints the final answer, not raw search pages or
raw file contents. Large files are summarized into temporary code memory before
they are sent to the model, so broad review/explanation requests stay inside
the context window.

Configuration is stored at:

```text
~/.pi/config.json
```

Older `~/.config/pi/config.json` files are migrated automatically, so API keys
survive package updates.

Interactive chat sessions are stored locally under:

```text
~/.pi/<session_id>/
```

Each session directory contains `metadata.json` and `transcript.jsonl`. Use
`pi resume` to choose from saved sessions by title and last prompt time, or
`pi resume <session_id>` to resume a known session directly. When a session is
resumed, PI prints the most recent five saved interactions before showing the
prompt.
