The agent data layer. Perkoon moves files between agents and the physical world — agent to human, agent to agent, agent to pipeline. Small files get free cloud delivery — a durable link, fire-and-forget, no receiver needed. Larger files stream direct P2P over WebRTC, no size limit. Free. Encrypted. Unlimited. No accounts. CLI, MCP server, A2A protocol, browser automation — pick the interface that fits your runtime.
---
name: perkoon-transfer
version: 2.1.7
description: >
The agent data layer. Perkoon moves files between agents and the physical world —
agent to human, agent to agent, agent to pipeline. Small files get free
cloud delivery — a durable link, fire-and-forget, no receiver needed.
Larger files stream direct P2P over WebRTC, no size limit.
Free. Encrypted. Unlimited. No accounts.
CLI, MCP server, A2A protocol, browser automation — pick the interface
that fits your runtime.
homepage: https://perkoon.com
metadata:
openclaw:
emoji: "⚡"
requires:
bins:
- node
install:
- id: perkoon
kind: node
package: perkoon
bins:
- perkoon
label: Install Perkoon CLI
---
# Perkoon — The Agent Data Layer
File transfer for humans and the things replacing them.
Your agent has compute, memory, and context. What it lacks is a jump gate to the physical world. Perkoon is that gate — engineered for autonomous machines from day one. Small files relay via **free cloud delivery** (durable link, fire-and-forget); larger files stream direct P2P over WebRTC.
Not "AI-ready" the way a gas station is gourmet-ready. Actually built for machines — JSON event streams, structured exit codes, MCP native tools, an A2A protocol endpoint, and a state machine that doesn't need a browser, a mouse, or a soul.
**Four integration methods — pick the one that fits your runtime:**
| Method | Best for | Install size |
|--------|----------|-------------|
| **MCP Server** | Coding agents (Claude Code, Cursor, Windsurf, VS Code Copilot) | ~8 MB |
| **CLI** | Agents with shell access | ~8 MB |
| **A2A Protocol** | Agents with HTTP but no shell (ChatGPT, web agents) | Zero — just POST |
| **Browser Automation** | Full UI control via Playwright/Puppeteer | ~200 MB (Chromium) |
**Three supported flight paths:**
- **Agent → Human**: Your agent sends a file. The human opens a link in any browser. No install on their end.
- **Agent → Agent**: CLI to CLI, MCP to MCP, or A2A to A2A. Two machines, no humans in the loop.
- **Agent → Pipeline**: Stream received files to stdout, pipe into processing. No disk writes required.
Transfers are free, unlimited, and encrypted. Small files (within the free cloud allotment) upload to **free cloud delivery**: the CLI exits immediately with a durable share link (~48h) and nobody needs to stay online. Larger files stream direct P2P — both ends online is the only constraint. For sensitive files, always use `--password` — without it, anyone with the share link can download.
---
## METHOD 1: MCP Server (recommended for coding agents)
If your host supports MCP, this is the fastest path. Three native tools, zero shell commands.
Install: `npx -y @perkoon/mcp@0.3.0` (stdio transport, pinned version)
**Tools provided:**
- `send_file` — Send a file. Small files relay via free cloud delivery and return a durable link immediately (no receiver needed); larger files wait for a receiver. Optional `mode`: `auto` | `relay` | `p2p`.
- `receive_file` — Receive files from a session code. Saves to disk.
- `check_session` — Check if a session is active, expired, or not found.
Configuration for common hosts:
```json
{
"mcpServers": {
"perkoon": {
"command": "npx",
"args": ["-y", "@perkoon/mcp@0.3.0"]
}
}
}
```
- **Claude Code**: Add to `.mcp.json` in your project
- **Claude Desktop**: Add to `claude_desktop_config.json`
- **Cursor / VS Code / Windsurf**: Settings → MCP → Add Server → `npx -y @perkoon/mcp@0.3.0`
Once configured, just call the tools directly — no bash, no log polling, no background processes.
---
## METHOD 2: CLI (for agents with shell access)
**IMPORTANT**: Use `npx -y perkoon@0.5.7` (pinned version) to avoid dynamic fetching of unaudited code.
### SENDING a file
#### Step 1: Confirm the file path with the user, then start send
Before sending, confirm the file path and name with the user. Do not send files from sensitive directories without explicit user approval.
Replace `/path/to/file` with the actual file path:
```bash
rm -f /tmp/perkoon-send.log /tmp/perkoon-send.pid
npx -y perkoon@0.5.7 send /path/to/file --json --timeout 1800 > /tmp/perkoon-send.log 2>&1 &
echo $! > /tmp/perkoon-send.pid
# Wait for session code (up to 30s)
for i in $(seq 1 30); do
if grep -q session_created /tmp/perkoon-send.log 2>/dev/null; then
grep session_created /tmp/perkoon-send.log
break
fi
if grep -q '"event":"error"' /tmp/perkoon-send.log 2>/dev/null; then
echo "===SEND FAILED===" && cat /tmp/perkoon-send.log
break
fi
sleep 1
done
```
Output: `{"event":"session_created","session_code":"K7MX4QPR9W2N","share_url":"https://perkoon.com/K7MX4QPR9W2N"}`
Once `session_created` appears, share the URL with the user. Example: "Here's your file — open this link on any device to download it: https://perkoon.com/K7MX4QPR9W2N"
The receiver doesn't need to install anything. The link works in any browser.
For password-protected sends, add `--password SECRET` and share both the URL and password.
#### Step 2: Monitor until complete — then REPORT BACK
You MUST run this after sharing the link. Do NOT skip this step.
**Fast path:** if the log shows `{"event":"relay_complete",...}` the file went
via free cloud delivery — the process has already exited 0, the link is durable
(~48h), and no receiver needs to be online. Report success immediately; skip
the loop below. Force this mode with `--relay` (errors if unavailable) or
force P2P with `--p2p`.
```bash
for i in $(seq 1 360); do
if grep -qE 'relay_complete|transfer_complete' /tmp/perkoon-send.log 2>/dev/null; then
echo "===TRANSFER COMPLETE===" && grep -E 'relay_complete|transfer_complete' /tmp/perkoon-send.log
break
fi
if grep -q '"event":"error"' /tmp/perkoon-send.log 2>/dev/null; then
echo "===TRANSFER FAILED===" && grep error /tmp/perkoon-send.log
break
fi
if [ "$((i % 30))" -eq 0 ]; then
grep progress /tmp/perkoon-send.log 2>/dev/null | tail -1
fi
sleep 5
done
```
- **`===TRANSFER COMPLETE===`** → Tell the user: "File sent successfully!" Include speed and duration from the JSON.
- **`===TRANSFER FAILED===`** → Tell the user what went wrong.
- **You MUST tell the user the outcome. Never finish silently.**
### SENDING into a pre-created session (Agent → Agent)
When another agent creates a session via A2A and gives you a session code + sender key:
```bash
rm -f /tmp/perkoon-send.log /tmp/perkoon-send.pid
npx -y perkoon@0.5.7 send /path/to/file --session CODE --sender-key KEY --json --timeout 1800 > /tmp/perkoon-send.log 2>&1 &
echo $! > /tmp/perkoon-send.pid
```
Then monitor with the same Step 2 above. This joins an existing session as sender instead of creating a new one. The receiving agent runs `npx -y perkoon@0.5.7 receive CODE --json` on their end.
### RECEIVING a file
Replace `CODE` with the 12-character session code:
```bash
rm -f /tmp/perkoon-recv.log /tmp/perkoon-recv.pid
npx -y perkoon@0.5.7 receive CODE --json --overwrite --output /home/openclaw/.openclaw/workspace/received/ > /tmp/perkoon-recv.log 2>&1 &
echo $! > /tmp/perkoon-recv.pid
for i in $(seq 1 360); do
if grep -q transfer_complete /tmp/perkoon-recv.log 2>/dev/null; then
echo "===TRANSFER COMPLETE===" && grep transfer_complete /tmp/perkoon-recv.log
break
fi
if grep -q '"event":"error"' /tmp/perkoon-recv.log 2>/dev/null; then
echo "===TRANSFER FAILED===" && grep error /tmp/perkoon-recv.log
break
fi
sleep 5
done
```
For password-protected sessions, add `--password SECRET`.
- **`===TRANSFER COMPLETE===`** → Tell the user: "File received!" and the save path.
- **`===TRANSFER FAILED===`** → Tell the user what went wrong.
- **You MUST tell the user the outcome. Never finish silently.**
Files are saved to `/home/openclaw/.openclaw/workspace/received/`.
### Pipe to stdout
Stream a received file directly into another process — no disk write:
```bash
npx -y perkoon@0.5.7 receive CODE --output - > /path/to/destination
```
---
## METHOD 3: A2A Protocol (for agents with HTTP, no shell)
If you can make HTTP requests but can't run shell commands, use the A2A endpoint directly.
**Endpoint:** `POST https://perkoon.com/a2a`
**Protocol:** JSON-RPC 2.0
**Agent Card:** `https://perkoon.com/.well-known/agent.json`
### Discover capabilities
```json
{
"jsonrpc": "2.0",
"method": "message/send",
"id": "1",
"params": {
"message": {
"parts": [{ "type": "data", "data": { "skill": "describe" } }]
}
}
}
```
### Create a send session
```json
{
"jsonrpc": "2.0",
"method": "message/send",
"id": "1",
"params": {
"message": {
"parts": [{
"type": "data",
"data": {
"skill": "send-files",
"name": "quarterly-report"
}
}]
}
}
}
```
Returns `sender_url` (for browser upload) + CLI commands + `sender_key` for A2A sender joining.
If you have shell access, run the CLI command from the response. If not, share the `sender_url` with your user — they open it in any browser to upload.
### Join a session as receiver
```json
{
"jsonrpc": "2.0",
"method": "message/send",
"id": "1",
"params": {
"message": {
"parts": [{
"type": "data",
"data": {
"skill": "receive-files",
"session_code": "K7MX4QPR9W2N"
}
}]
}
}
}
```
### Check session status
```json
{
"jsonrpc": "2.0",
"method": "message/send",
"id": "1",
"params": {
"message": {
"parts": [{
"type": "data",
"data": {
"skill": "session-status",
"session_code": "K7MX4QPR9W2N"
}
}]
}
}
}
```
### Runtime hints
Include `clientCapabilities` in your DataPart to get optimized instructions:
```json
{
"type": "data",
"data": {
"skill": "send-files",
"clientCapabilities": { "shellAccess": true, "nodeJs": true }
}
}
```
Agents declaring shell access get CLI commands. Web-only agents get browser URLs.
---
## METHOD 4: Browser Automation (Playwright/Puppeteer)
For agents that need full browser UI control. Heavier than CLI but gives visual verification.
**Ready-to-run scripts** (requires `npm install playwright`):
```bash
curl https://perkoon.com/perkoon_send.mjs > send.mjs && node send.mjs /path/to/file.zip
curl https://perkoon.com/perkoon_receive.mjs > receive.mjs && node receive.mjs SESSION_CODE ./output
```
### Manual sender flow
1. Navigate to `https://perkoon.com/create`, accept TOS, click Start
2. Skip confirmation modals: `localStorage.setItem('perkoon_skip_confirm_direct-confirm', 'true')` and `localStorage.setItem('perkoon_skip_confirm_staged-confirm', 'true')`
3. Add files: `page.setInputFiles('[data-testid="file-input"]', filePath)`
4. Share session code with recipient
5. Wait for receiver: `page.waitForFunction(() => window.__perkoon?.participants?.length >= 2, null, { timeout: 300000 })`
6. Click `[data-testid="send-transfer"]`
7. Wait: `page.waitForFunction(() => window.__perkoon?.transfer?.status === 'complete', null, { timeout: 600000 })`
### Manual receiver flow
1. Register download handler: `page.on('download', d => downloads.push(d))`
2. Navigate to `https://perkoon.com/{SESSION_CODE}?agent=true`
3. Accept transfer: wait for `[data-testid="transfer-accept"]`, then click it. This is the RECEIVE-side accept in the "Incoming Transfer" dialog (it appears once the sender's offer arrives) — distinct from the sender's session-creation gate `[data-testid="tos-accept"]`. Reject is `[data-testid="transfer-reject"]`. `?agent=true` picks the sink but does NOT auto-accept.
4. Wait: `page.waitForFunction(() => window.__perkoon?.transfer?.status === 'complete', null, { timeout: 600000 })`
5. Save: `await download.saveAs('./received/' + basename(download.suggestedFilename()))`
---
## CLI reference
| Flag | Description |
|------|-------------|
| `--json` | Machine-readable JSON events (always use for automation) |
| `--relay` | Force free cloud delivery (fails if unavailable). Default is auto: relay when granted and the file fits, else P2P |
| `--p2p` / `--wait` | Force direct P2P streaming (process stays alive) |
| `--session <code>` | Join an existing session as sender (A2A agent-to-agent) |
| `--sender-key <key>` | Auth key for `--session` (provided by session creator) |
| `--password <pw>` | Password-protect the session (transfer is WebRTC/DTLS-encrypted regardless) |
| `--timeout <sec>` | Peer wait time in P2P mode (default: 300, use 1800 for sends) |
| `--output <dir>` | Save directory (default: ./received) |
| `--output -` | Stream to stdout (no disk write) |
| `--overwrite` | Replace existing files |
| `--quiet` | Suppress human-readable output |
## JSON event stream
Events appear in order on stdout when using `--json`. The sequence **differs by direction** — parse the set that matches the command you ran.
**`send`:**
| Event | Meaning | Key fields |
|-------|---------|------------|
| `file_ready` | File queued for send | `name`, `size` |
| `session_created` | Ready — share the link now | `session_code`, `share_url` |
| `mode` | Delivery mode chosen (relay path only) | `mode` |
| `relay_complete` | Cloud upload done — link durable, process exits 0 | `session_code`, `share_url`, `expires_at`, `duration_ms` |
| `waiting_for_receiver` | Session live, no peer yet (P2P path) | |
| `receiver_connected` | Peer joined | |
| `transfer_accepted` | Receiver accepted the transfer | |
| `webrtc_connected` | Direct P2P link established | |
| `progress` | Transfer in progress | `percent`, `speed`, `eta` |
| `transfer_complete` | Done | `duration_ms`, `speed` |
**`receive`:**
| Event | Meaning | Key fields |
|-------|---------|------------|
| `session_joined` | Joined the session | |
| `sender_found` | Sender located | |
| `webrtc_connected` | Direct P2P link established | |
| `receiving_file` | Incoming file | `name`, `size` |
| `progress` | Transfer in progress | `percent`, `speed`, `eta` |
| `transfer_complete` | Done | `files`, `duration_ms`, `speed` |
Either direction emits `error` (`message`, `exit_code`) on failure.
## Exit codes
| Code | Meaning |
|------|---------|
| 0 | Success |
| 1 | Bad arguments |
| 2 | File not found |
| 3 | Network/session error |
| 4 | Wrong password |
| 5 | Timeout — no peer joined (P2P mode only; relay sends never wait) |
## Rate limits
Session endpoints are rate-limited **per IP**, sliding 60-second window:
| Action | Limit |
|--------|-------|
| Create a session (send) | 10 / min |
| Join a session (receive) | 30 / min |
| Status checks | 20 / min |
Exceeding a limit returns HTTP `429` with a `Retry-After` value (seconds). On `/a2a`, every JSON-RPC POST counts against the **create** budget (10/min), regardless of skill.
**How this looks to you:** the CLI surfaces a 429 as a fast **`exit_code: 3`** (network/session error) *before* a `session_created` event. If a send fails fast with exit 3 after several rapid sessions, treat it as rate-limiting: back off ~30s and retry, don't hammer.
---
## Rules
1. ALWAYS use `--json` for parseable output
2. ALWAYS confirm the file path with the user before sending
3. Once `session_created` appears, share the URL with the user
4. ALWAYS use `--timeout 1800` for sends (30 min for the human to open the link)
5. ALWAYS use `--overwrite` for receives
6. ALWAYS monitor until `relay_complete` (cloud), `transfer_complete` (P2P), or `error` — then **tell the user the result**
7. NEVER kill the process mid-transfer (relay sends exit on their own — nothing to babysit after `relay_complete`)
8. The receiver does NOT need perkoon installed — the browser link works for everyone
9. Use pinned versions: `npx -y perkoon@0.5.7` — never use `@latest`
10. NEVER send files from sensitive directories (~/.ssh, ~/.gnupg, /etc) without explicit user approval
## Discovery endpoints
| URL | What it is |
|-----|-----------|
| `https://perkoon.com/.well-known/agent.json` | A2A agent card (machine-readable capabilities) |
| `https://perkoon.com/llms.txt` | Full agent integration guide |
| `https://perkoon.com/automate` | Human-readable automation docs |
| `https://www.npmjs.com/package/@perkoon/mcp` | MCP server package |
| `https://www.npmjs.com/package/perkoon` | CLI package |
don't have the plugin yet? install it then click "run inline in claude" again.
Perkoon is the jump gate between your agent's compute and the physical world. it moves files agent-to-human (via durable browser links, no receiver install needed), agent-to-agent (CLI, MCP, or HTTP post), and agent-to-pipeline (stdout streaming, no disk). small files relay free via cloud (durable ~48h link, fire-and-forget, immediate exit). large files stream P2P direct over WebRTC, encrypted, no size limit. use this skill whenever your agent needs to ship a file to a human, another agent, or a processing pipeline, or when it needs to receive a file from an external session code. no accounts. no auth headaches. four interfaces: MCP server (for Claude Code, Cursor, Windsurf), CLI (shell access), A2A protocol (HTTP only), or browser automation (Playwright/Puppeteer).
required:
optional:
--password string (password-protect the transfer; both relay and P2P encrypted regardless)--timeout integer (seconds to wait for peer in P2P mode; default 300s, use 1800s for sends to give humans time)--relay or --p2p flags (force delivery mode; relay fails if unavailable, P2P requires both ends online)--output path or - for stdout (receive only; default ./received)--overwrite flag (replace existing files on receive)--session mode)external connections:
environment / setup:
NODE_AVAILABLE (CLI and MCP methods): node 14+ installed locallyNPX_AVAILABLE (CLI and MCP methods): npx available (comes with node 14+)HTTP_CAPABLE (A2A method): outbound HTTP POST to https://perkoon.com/a2a allowedBROWSER_CAPABLE (browser automation method): Playwright or Puppeteer installed, browser binary availablestep 1: Install MCP server (once per host)
run: npx -y @perkoon/mcp@0.3.0
or configure your host to auto-start it:
.mcp.json in your projectclaude_desktop_config.jsonnpx -y @perkoon/mcp@0.3.0input: mcp host config (hostname, MCP settings file) output: perkoon MCP server ready; three native tools available (send_file, receive_file, check_session)
step 2: Call send_file tool directly
invoke: send_file with parameters:
file_path (string): absolute path to filemode (string, optional): "auto" (default), "relay" (force cloud), or "p2p" (force peer-to-peer)password (string, optional): set a passwordinput: file path, optional mode and password
output: JSON object with session_code, share_url, mode chosen, and transfer status
step 3: Share the URL and monitor
relay files (small): receive the share_url in step 2 output; share it with the human immediately. link is durable ~48h, process has already exited. done.
P2P files (large or mode="p2p"): share the session code with the receiving agent. both must stay online. tool will report transfer_complete when done.
input: share_url or session code from step 2 output output: human or receiving agent has the file (or link to download it)
step 4: Call receive_file tool (if you are the receiver)
invoke: receive_file with parameters:
session_code (string): the 12-character codepassword (string, optional): if sender set oneinput: session code, optional password
output: file saved to local disk; tool reports transfer_complete with file path
step 1: Send a file (start the sender process)
run:
rm -f /tmp/perkoon-send.log /tmp/perkoon-send.pid
npx -y perkoon@0.5.7 send /path/to/file \
--json --timeout 1800 > /tmp/perkoon-send.log 2>&1 &
echo $! > /tmp/perkoon-send.pid
input: file path output: process running in background, PID saved to /tmp/perkoon-send.pid, JSON events streaming to /tmp/perkoon-send.log
step 2: Detect session creation (poll log)
run:
for i in $(seq 1 30); do
if grep -q session_created /tmp/perkoon-send.log 2>/dev/null; then
SESSION_JSON=$(grep session_created /tmp/perkoon-send.log)
echo "$SESSION_JSON"
break
fi
if grep -q '"event":"error"' /tmp/perkoon-send.log 2>/dev/null; then
echo "SEND FAILED" && cat /tmp/perkoon-send.log && exit 1
fi
sleep 1
done
input: /tmp/perkoon-send.log file descriptor
output: JSON line containing session_code and share_url, or error event
step 3: Share the URL with receiver (agent or human)
extract and tell the user: "your file is ready at: https://perkoon.com/K7MX4QPR9W2N" (for relay sends) or "join this session: K7MX4QPR9W2N" (for P2P).
input: share_url or session_code from step 2 output: human or agent has the download link or session code
step 4: Monitor until transfer completes or fails
run:
for i in $(seq 1 360); do
if grep -qE 'relay_complete|transfer_complete' /tmp/perkoon-send.log 2>/dev/null; then
RESULT=$(grep -E 'relay_complete|transfer_complete' /tmp/perkoon-send.log | tail -1)
echo "TRANSFER COMPLETE: $RESULT"
break
fi
if grep -q '"event":"error"' /tmp/perkoon-send.log 2>/dev/null; then
ERROR=$(grep error /tmp/perkoon-send.log | tail -1)
echo "TRANSFER FAILED: $ERROR"
break
fi
if [ "$((i % 30))" -eq 0 ]; then
grep progress /tmp/perkoon-send.log 2>/dev/null | tail -1
fi
sleep 5
done
input: /tmp/perkoon-send.log file descriptor, process still running
output: relay_complete (link durable, done now) or transfer_complete (P2P transfer finished) or error event with reason
step 5: Report the result to the user
if relay_complete: "file sent successfully; your link is durable for ~48 hours." if transfer_complete: "file sent successfully; transfer took X ms at Y Mbps." if error: "transfer failed , reason: [message from error event]"
input: completion or error event from step 4 output: user is informed of success or failure
step 1: Receive session code and sender key from the receiving agent
the receiver creates a session via A2A receive-files skill and gives you back a session code (12 chars) and a sender key (auth token).
input: session_code string, sender_key string output: two credentials ready to use
step 2: Send file into that session
run:
rm -f /tmp/perkoon-send.log /tmp/perkoon-send.pid
npx -y perkoon@0.5.7 send /path/to/file \
--session <session_code> --sender-key <sender_key> \
--json --timeout 1800 > /tmp/perkoon-send.log 2>&1 &
echo $! > /tmp/perkoon-send.pid
input: file path, session_code, sender_key output: process runs, joins the existing session as sender, logs to /tmp/perkoon-send.log
step 3: Monitor until transfer completes
use the same polling loop as method 2 step 4 (watch for relay_complete or transfer_complete).
input: /tmp/perkoon-send.log output: completion or error event
step 1: Start receiver process
run:
rm -f /tmp/perkoon-recv.log /tmp/perkoon-recv.pid
npx -y perkoon@0.5.7 receive <session_code> \
--json --overwrite --output /home/openclaw/.openclaw/workspace/received/ \
> /tmp/perkoon-recv.log 2>&1 &
echo $! > /tmp/perkoon-recv.pid
input: session_code (12-char string from sender) output: receiver process running, bound to /tmp/perkoon-recv.log
step 2: Monitor until transfer completes or fails
run:
for i in $(seq 1 360); do
if grep -q transfer_complete /tmp/perkoon-recv.log 2>/dev/null; then
RESULT=$(grep transfer_complete /tmp/perkoon-recv.log | tail -1)
echo "TRANSFER COMPLETE: $RESULT"
break
fi
if grep -q '"event":"error"' /tmp/perkoon-recv.log 2>/dev/null; then
ERROR=$(grep error /tmp/perkoon-recv.log | tail -1)
echo "TRANSFER FAILED: $ERROR"
break
fi
sleep 5
done
input: /tmp/perkoon-recv.log, process running output: transfer_complete event with file paths, or error event
step 3: Report result to user
if transfer_complete: "file received successfully; saved to /home/openclaw/.openclaw/workspace/received/[filename]" if error: "receive failed , reason: [message]"
input: completion or error event output: user informed of success or failure, file ready or error diagnosed
step 1: Stream receiver to stdout
run:
npx -y perkoon@0.5.7 receive <session_code> \
--json --output - > /path/to/destination 2>/tmp/perkoon-recv.log
input: session_code, destination path output: file streamed to /path/to/destination; metadata and errors go to /tmp/perkoon-recv.log
step 2: Monitor the log
use same loop as method 2b step 2 to watch /tmp/perkoon-recv.log for transfer_complete or error.
input: /tmp/perkoon-recv.log output: completion or error, and destination file now contains the received data
all A2A requests are JSON-RPC 2.0 POST to https://perkoon.com/a2a.
step 1: Discover capabilities (optional)
send:
{
"jsonrpc": "2.0",
"method": "message/send",
"id": "1",
"params": {
"message": {
"parts": [{ "type": "data", "data": { "skill": "describe" } }]
}
}
}
input: HTTP POST with JSON-RPC frame output: JSON object listing available skills (send-files, receive-files, session-status)
step 2: Create a send session
send:
{
"jsonrpc": "2.0",
"method": "message/send",
"id": "1",
"params": {
"message": {
"parts": [{
"type": "data",
"data": {
"skill": "send-files",
"name": "quarterly-report",
"clientCapabilities": { "shellAccess": true, "nodeJs": true }
}
}]
}
}
}
(omit clientCapabilities if you don't have shell; you'll get a browser URL instead of a CLI command.)
input: JSON-RPC request with skill=send-files
output: JSON response with sender_url (for browser upload if no shell), CLI commands (if shell capable), and sender_key (for other agents to join as sender)
step 3a: Upload via browser (if no shell access)
extract sender_url from step 2 response. open it in a browser or share it with the human. they upload the file via the browser UI.
input: sender_url output: file uploaded via browser; sender_url's page reports upload completion
step 3b: Join as sender (if you have shell access)
the step 2 response includes a CLI command. run it:
npx -y perkoon@0.5.7 send /path/to/file --session <code> --sender-key <key> --json --timeout 1800
then monitor as in method 2 step 4.
input: sender_key and session_code from step 2, file path output: file sent; monitor log for relay_complete or transfer_complete
step 4: Receive files (as another agent)
send:
{
"jsonrpc": "2.0",
"method": "message/send",
"id": "2",
"params": {
"message": {
"parts": [{
"type": "data",
"data": {
"skill": "receive-files",
"session_code": "K7MX4QPR9W2N"
}
}]
}
}
}
input: JSON-RPC request with skill=receive-files, session_code (from the sending agent) output: JSON response confirming join; returns receiver_key (for your reference), status ready to receive
if you have shell access, the response also includes a CLI command:
npx -y perkoon@0.5.7 receive K7MX4QPR9W2N --json --overwrite --output ./received
run it and monitor for transfer_complete.
input: receiver_key (implicit), session_code, shell command (optional) output: file received; CLI output or JSON response confirms completion
step 5: Check session status (at any time)
send:
{
"jsonrpc": "2.0",
"method": "message/send",
"id": "3",
"params": {
"message": {
"parts": [{
"type": "data",
"data": {
"skill": "session-status",
"session_code": "K7MX4QPR9W2N"
}
}]
}
}
}
input: session_code output: JSON with status (active, expired, not_found), participants, transfer state, remaining time (~48h for relay, live until both peers disconnect for P2P)
step 1: Install playwright
run: npm install playwright
input: npm available, current working directory output: playwright binary and node bindings ready
step 2: Use ready-made scripts (fastest path)
run:
curl https://perkoon.com/perkoon_send.mjs > send.mjs
node send.mjs /path/to/file.zip
or:
curl https://perkoon.com/perkoon_receive.mjs > receive.mjs
node receive.mjs SESSION_CODE ./output
input: file path (send) or session code + output dir (receive) output: file transferred; process exits with 0 on success
skip steps 3-7 if scripts work for you.
step 3: Manual sender setup
run:
const { chromium } = require('playwright');
const browser =