# RustPad

A Rust scratchpad for Windows, in the spirit of LINQPad: type a few lines of Rust, press F5, see the result.

## Install or update

```
irm https://shakytext.com/rustpad/install.ps1 | iex
```

Per-user, no administrator prompt. Installs to `%LOCALAPPDATA%\Programs\RustPad`, adds a Start Menu shortcut and a
Settings > Apps entry, and offers to install Rust through rustup when it is missing. Run it again to update.

## What is in the zip

| File | What it is |
|---|---|
| `RustPad.exe` | the app |
| `rustpad-cli.exe` | run, test, check, format and export scripts from a terminal (`rustpad-cli run script.rs`) |
| `rustpad-mcp.exe` | MCP server for Claude Code (`--attach` works with the open window) |
| `uninstall.ps1` | used by Settings > Apps |

## Requirements

- Windows 10 or 11, 64-bit.
- Rust from rustup (https://rustup.rs). With Visual Studio's C++ build tools the MSVC toolchain works; without
  them use the GNU toolchain (`rustup default stable-x86_64-pc-windows-gnu`), which links on its own.
- The first run of a new set of crates compiles them (a minute or two); after that runs take about a second.

## Where things live

- Program: `%LOCALAPPDATA%\Programs\RustPad`
- Your scripts, open tabs, settings, history and encrypted API keys: `%USERPROFILE%\.rustpad` (kept on update and
  uninstall; set `RUSTPAD_HOME` to move it)

## Claude Code

```
claude mcp add rustpad -- "%LOCALAPPDATA%\Programs\RustPad\rustpad-mcp.exe" --attach
```

## Ask AI

The Ask AI window (Ctrl+Shift+A) chats with Claude or OpenAI about the open tab and can edit and run it. Save
`ANTHROPIC_API_KEY` or `OPENAI_API_KEY` in Settings > Secrets first; keys are encrypted for your Windows account and
sent only to the provider you pick.
