# AI use cases for Pi Rust (bigfish1913/pi-rust)

Repo: [bigfish1913/pi-rust](https://github.com/bigfish1913/pi-rust) | Use cases: 4 | Page: https://dedupedai.com/use-cases/bigfish1913-pi-rust/

rpi is a Rust-native coding-agent runtime with a terminal CLI, built as nine composable crates for LLM providers, tools, sessions, and a plugin ABI.

This file holds every use case of this repo. Each one starts with a "## " heading and ends with its URL.

- Run a one-shot coding task from the terminal: https://dedupedai.com/use-cases/bigfish1913-pi-rust/run-terminal-coding-agent-one-shot/
- Feed agent events into a script as JSON: https://dedupedai.com/use-cases/bigfish1913-pi-rust/pipe-agent-events-into-a-script/
- Test an embedded agent offline with no API key: https://dedupedai.com/use-cases/bigfish1913-pi-rust/test-agent-tools-offline-in-rust/
- Build a plugin tool that loads into every rpi session: https://dedupedai.com/use-cases/bigfish1913-pi-rust/build-plugin-tool-for-every-session/

## How to run a one-shot coding task from the terminal with Pi Rust

Repo: [bigfish1913/pi-rust](https://github.com/bigfish1913/pi-rust) | Difficulty: Intermediate | Time: 30 minutes | Basis: From the README

Install the rpi CLI and send it a single task from the shell with a model API key.

**Who it is for:** A developer who wants a coding agent in the terminal to answer questions about a project or make a small change.

**The problem:** Setting up an agent usually means wiring up SDKs or web tools before any work gets done.

**The outcome:** A one-line command returns the agent's answer for the task in the terminal.

### Steps

1. Run `cargo install rpi-cli`
2. Run `rpi --version` to confirm the install
3. Run `export ANTHROPIC_API_KEY=...` or `export OPENAI_API_KEY=...` with your own key (inferred, check the README)
4. Run `rpi -p "summarize the README"` from the project directory

### Prompt to paste into your agent

```text
Install rpi-cli from the bigfish1913/pi-rust repository using cargo, then run `rpi -p "<task>"` in <project-directory> with the API key set. Expected output: a text answer to the task. Verify that `rpi --version` prints a version before running the task.
```

### Caveat

The README's interactive TUI and sessions need a configured provider, so the first run will not work without a key or a models.json file.

Risk, credentials: The agent needs a model API key in your shell environment, so keep the key out of shared scripts and logs.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/bigfish1913-pi-rust/run-terminal-coding-agent-one-shot/

## How to feed agent events into a script as JSON with Pi Rust

Repo: [bigfish1913/pi-rust](https://github.com/bigfish1913/pi-rust) | Difficulty: Intermediate | Time: 30 minutes | Basis: From the README

Use the JSON output mode to get a machine-readable event stream from a one-shot run.

**Who it is for:** A DevOps or automation engineer who wants to run the agent from a script and parse its output without scraping plain text.

**The problem:** Plain terminal output is hard to parse reliably in automation.

**The outcome:** A script receives the agent's events as a JSON stream it can process.

### Steps

1. Install the CLI with `cargo install rpi-cli`
2. Set a model key, for example `export OPENAI_API_KEY=...` (inferred, check the README)
3. Run `rpi --mode json -p "list the crates"` and capture stdout
4. Parse the captured stream in your script, one event per line if the output follows the README's description of an event stream

### Prompt to paste into your agent

```text
Using the bigfish1913/pi-rust CLI, run `rpi --mode json -p "<prompt>"` in <repo-path> and save the output to <output-file>. Expected output: a machine-readable event stream. Verify that the file is non-empty and that each line parses as JSON before using it downstream.
```

### Caveat

The README describes the JSON mode only as a machine-readable event stream, so check the event schema in the user guide before relying on specific field names.

Risk, credentials: The script needs a model API key in its environment, so store it in a secret manager rather than in the script.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/bigfish1913-pi-rust/pipe-agent-events-into-a-script/

## How to test an embedded agent offline with no API key with Pi Rust

Repo: [bigfish1913/pi-rust](https://github.com/bigfish1913/pi-rust) | Difficulty: Advanced | Time: 45 minutes | Basis: From the README

Run the minimal example against the deterministic faux provider to test agent behavior.

**Who it is for:** A Rust developer building an agent into their own app who needs repeatable tests that never touch the network.

**The problem:** Agent tests that call a live model are slow, flaky, and cost money to run.

**The outcome:** The agent loop runs end to end with fixed output and no credentials, so tests pass the same way on every run.

### Steps

1. Run `git clone https://github.com/bigfish1913/pi-rust.git`
2. Change into the folder with `cd pi-rust`
3. Run `cargo run -p minimal`
4. Read examples/minimal/src/main.rs and reuse its AgentBuilder setup in your own test

### Prompt to paste into your agent

```text
Clone bigfish1913/pi-rust, run `cargo run -p minimal`, and then write a Rust test in <target-crate> that builds an agent with the faux provider and asserts the reply. Expected output: the minimal example prints 2 messages after run and the assistant reply. Verify that the test passes with no network access and no API key set.
```

### Caveat

The faux provider covers the paths your test scripts, so live provider behavior still needs its own checks against the real HTTP providers behind the providers feature flag.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/bigfish1913-pi-rust/test-agent-tools-offline-in-rust/

## How to build a plugin tool that loads into every rpi session with Pi Rust

Repo: [bigfish1913/pi-rust](https://github.com/bigfish1913/pi-rust) | Difficulty: Advanced | Time: 90 minutes | Basis: From the README

Write a cdylib plugin with rpi-plugin-sdk so the global rpi binary loads your tool.

**Who it is for:** A developer who wants a custom tool or provider available in every rpi session without forking the CLI.

**The problem:** Adding a tool to a coding agent usually means changing its core code and maintaining a separate fork.

**The outcome:** A compiled plugin library that the global rpi loads alongside the built-in tools.

### Steps

1. Run `git clone https://github.com/bigfish1913/pi-rust.git`
2. Open examples/plugin-stub and read how it uses rpi-plugin-sdk
3. Run `cargo build -p plugin-stub` from the repository root to build the cdylib (inferred, check the README)
4. Place the built library where the rpi plugin loader expects it, following docs/agent/project-structure.md

### Prompt to paste into your agent

```text
In the bigfish1913/pi-rust repository, copy examples/plugin-stub into <new-plugin-folder>, implement one tool in it, and build it as a cdylib. Expected output: a compiled shared library that rpi can load. Verify that `rpi --version` still runs after the plugin is placed in the loader path.
```

### Caveat

The README does not give the plugin install path or build command, so confirm them in examples/plugin-stub and docs/agent/project-structure.md before copying files.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/bigfish1913-pi-rust/build-plugin-tool-for-every-session/
