---
slug: "pi-share"
source_type: "readme"
source_url: "https://cdn.jsdelivr.net/gh/awesamarth/pi-share@main/README.md"
repo: "https://github.com/awesamarth/pi-share"
source_file: "README.md"
branch: "main"
---
# pi-share

Share sanitized [Pi coding agent](https://pi.dev) configuration with a Pi extension and a small Cloudflare backend.

## Install

```bash
pi install npm:pi-share
```

Then run `/reload` if Pi is already open.

## What it shares

By default `pi-share` exports shareable files from `~/.pi/agent`:

- `settings.json`
- `keybindings.json`
- `AGENTS.md`, `SYSTEM.md`, `APPEND_SYSTEM.md`
- `extensions/`
- `skills/`
- `prompts/`
- `themes/`

It excludes auth, sessions, trust decisions, backups, `.env`, and secret-looking files/content.

## Pi commands

```text
/share-export --name my-config
/share-export --name my-config --password abcdef
/share-preview <id> [--password abcdef]
/share-import <id> [--password abcdef]
/share-delete <id:deleteToken>
```

Plain export is unencrypted for easiest sharing. Password export encrypts locally with `scrypt` + `AES-256-GCM`; the backend only stores ciphertext.

Use a custom backend during development:

```text
/share-export --api http://localhost:8787
/share-import <id> --api http://localhost:8787
```

or set:

```bash
export PI_SHARE_API_URL=http://localhost:8787
```

## Cloudflare backend

Stack:

- Worker: API
- R2: profile blobs
- D1: share metadata

Endpoints:

```text
POST   /v1/shares
GET    /v1/shares/:id
DELETE /v1/shares/:id
```

### Setup

```bash
bun install
wrangler r2 bucket create pi-share
wrangler d1 create pi-share
```

Copy the example config and put the created D1 database id into `wrangler.toml`:

```bash
cp wrangler.example.toml wrangler.toml
```

Then:

```bash
bun run db:migrate
bun run worker:deploy
```

For local development:

```bash
bun run db:migrate:local
bun run worker:dev
```

## Development

```bash
bun install
bun test
bun run typecheck
```

Install locally into Pi from this repo:

```bash
pi install /absolute/path/to/pi-share
```

Then `/reload` if Pi is already open.
