3.8k★by stormixus
ocft – OpenClaw Skill
ocft is an OpenClaw Skills integration for coding workflows. P2P file transfer between AI agents via message channels. Supports chunked transfer, IPFS fallback for large files, and trusted peer management.
Skill Snapshot
| name | ocft |
| description | P2P file transfer between AI agents via message channels. Supports chunked transfer, IPFS fallback for large files, and trusted peer management. OpenClaw Skills integration. |
| owner | stormixus |
| repository | stormixus/ocft |
| language | Markdown |
| license | MIT |
| topics | |
| security | L1 |
| install | openclaw add @stormixus/ocft |
| last updated | Feb 7, 2026 |
Maintainer

name: ocft description: P2P file transfer between AI agents via message channels. Supports chunked transfer, IPFS fallback for large files, and trusted peer management. homepage: https://github.com/stormixus/ocft
OCFT - OpenClaw File Transfer Protocol
P2P file transfer between AI agents via message channels.
When to Use
Use this skill when:
- Transferring files between AI agents over chat channels
- Setting up peer-to-peer file sharing with trusted agents
- Sending files through Telegram, Discord, Slack, or any text-based channel
- Need chunked transfer with integrity verification
- Transferring large files using IPFS fallback
Installation
npm install -g ocft
Quick Start
# Initialize your node (generates unique ID and secret)
ocft init
# View your status
ocft status
# Export your connection info to share with peers
ocft export
# Add a trusted peer
ocft add-peer <nodeId> <secret> --name "Friend"
# Or import from URI
ocft import ocft://eyJub2RlSWQ...
CLI Commands
Core Commands
| Command | Description |
|---|---|
ocft init | Initialize node with unique ID and secret |
ocft status | Show node status and configuration |
ocft show-secret | Display full secret (careful!) |
ocft export | Export connection info as URI |
ocft import <uri> | Import peer from ocft:// URI |
ocft verify <secret> | Verify if a secret matches yours |
Peer Management
| Command | Description |
|---|---|
ocft add-peer <id> <secret> | Add a trusted peer |
ocft remove-peer <id> | Remove a trusted peer |
ocft list-peers | List all trusted peers |
ocft extend-peer <nodeId> <hours> | Extend a peer's trust expiry |
ocft set-ttl <hours> | Set default secret TTL (0 = no expiry) |
Configuration
| Command | Description |
|---|---|
ocft set-download <dir> | Set download directory |
ocft set-max-size <size> | Set max file size (e.g., 100MB, 1GB) |
IPFS Fallback (for large files)
| Command | Description |
|---|---|
ocft ipfs-enable | Enable IPFS fallback for large files |
ocft ipfs-disable | Disable IPFS fallback |
ocft set-ipfs-provider <provider> | Set provider: pinata, filebase, kubo |
ocft set-ipfs-key <key> | Set IPFS API key |
ocft set-kubo-url <url> | Set Kubo node API URL |
ocft set-ipfs-threshold <size> | Size threshold for IPFS (e.g., 50MB) |
ocft set-ipfs-gateway <url> | Set custom public IPFS gateway |
Features
- 🔗 Message-based: Transfer files through existing chat channels
- 📦 Chunked transfer: Split large files into small pieces (48KB chunks)
- ✅ Integrity verification: SHA-256 hash for chunks and files
- 🤝 Request/Accept: Explicit acceptance or auto-accept policy
- 🔒 Security: Trusted peer whitelist with secrets
- ⏰ Secret TTL: Set expiry time for trust relationships
- 🔄 Resume: Resume interrupted transfers from last chunk
- 🌐 IPFS Fallback: Use IPFS for files exceeding chunk threshold
Protocol
OCFT messages use a 🔗OCFT: prefix with Base64-encoded JSON, allowing file transfers over any text-based channel.
Limitations
- Chunk size: 48KB (safe for Base64 in messages)
- Default max file size: 100MB (configurable via
set-max-size) - Designed for text-based channels
- IPFS fallback requires provider setup (Pinata, Filebase, or local Kubo)
Links
OCFT - OpenClaw File Transfer Protocol
P2P file transfer between AI agents via message channels.
Features
- 🔗 Message-based: Transfer files through existing chat channels
- 📦 Chunked transfer: Split large files into small pieces
- ✅ Integrity verification: SHA-256 hash for chunks and files
- 🤝 Request/Accept: Explicit acceptance or auto-accept policy
- 🔒 Security: Trusted peer whitelist with secrets
- ⏰ Secret TTL: Set expiry time for trust relationships
- 🔄 Resume: Resume interrupted transfers from last chunk
Installation
npm install -g ocft
Quick Start
# Initialize your node (generates unique ID and secret)
ocft init
# View your status
ocft status
# Export your connection info to share with peers
ocft export
# Add a trusted peer (with optional TTL)
ocft add-peer <nodeId> <secret> --name "Friend" --ttl 24
# Or import from URI
ocft import ocft://eyJub2RlSWQ... --ttl 48
CLI Commands
| Command | Description |
|---|---|
ocft init | Initialize node with unique ID and secret |
ocft status | Show node status and configuration |
ocft show-secret | Display full secret (careful!) |
ocft export | Export connection info as URI |
ocft import <uri> | Import peer from ocft:// URI |
ocft add-peer <id> <secret> | Add a trusted peer |
ocft remove-peer <id> | Remove a trusted peer |
ocft list-peers | List all trusted peers |
ocft set-download <dir> | Set download directory |
ocft set-ttl <hours> | Set default secret TTL for offers |
ocft extend-peer <id> <hours> | Extend a peer's trust expiry |
ocft verify <secret> | Verify if a secret matches yours |
Protocol Flow
[Sender] [Receiver]
│ │
│── OFFER ─────────────────>│ (file metadata + secret + TTL)
│<───────────── ACCEPT ─────│ (auto-accept if secret valid & not expired)
│── CHUNK[0] ──────────────>│
│<───────────── ACK[0] ─────│
│── CHUNK[1] ──────────────>│
│<───────────── ACK[1] ─────│
│... │
│── COMPLETE ──────────────>│
│<───────────── ACK ────────│
Resume Interrupted Transfers
If a transfer is interrupted, it can be resumed from the last acknowledged chunk:
// Resume a failed transfer
await bot.resumeTransfer(transferId);
// Get list of resumable transfers
const resumable = bot.getResumableTransfers();
The receiver sends resumeFrom in the ACCEPT message, and the sender starts from that chunk index.
Secret TTL (Time-To-Live)
Set expiry time for trust relationships:
# Add peer with 24-hour trust
ocft add-peer abc123 secret123 --ttl 24
# Set default TTL for all outgoing offers
ocft set-ttl 48
# Extend an existing peer's trust
ocft extend-peer abc123 24
Expired secrets are automatically rejected.
Secret-Based Auto-Accept
When the sender knows the receiver's secret, files are automatically accepted without manual approval:
- Bot A shares their secret with Bot B
- Bot B adds Bot A as trusted peer with the secret
- When Bot B sends a file to Bot A, it includes A's secret
- Bot A verifies the secret (and TTL) and auto-accepts
This enables trusted agent networks to share files seamlessly.
Programmatic Usage
import { TransferManager } from 'ocft';
const bot = new TransferManager({
botId: 'my-bot',
secret: 'my-secret',
secretTTL: 24 * 60 * 60 * 1000, // 24 hours in ms
downloadDir: './downloads',
trustedPeers: [
{ id: 'friend-bot', secret: 'friends-secret', expiresAt: Date.now() + 86400000 }
]
}, async (to, message) => {
await sendMessage(to, message);
});
// Event handlers
bot.on('offer-received', (transfer) => console.log(`Incoming: ${transfer.filename}`));
bot.on('transfer-completed', (transfer) => console.log(`Saved: ${transfer.localPath}`));
// Send a file
await bot.sendFile('friend-bot', '/path/to/file.txt');
// Resume interrupted transfer
await bot.resumeTransfer(transferId);
// Get resumable transfers
const resumable = bot.getResumableTransfers();
Message Format
OCFT messages use a 🔗OCFT: prefix with Base64-encoded JSON:
🔗OCFT:eyJ2ZXJzaW9uIjoiMS4wIiwidHlwZSI6Im9mZmVyIi4uLn0=
This allows file transfers over any text-based channel (Telegram, Discord, Slack, etc).
Configuration
Config is stored at ~/.ocft/config.json:
{
"nodeId": "ocft_abc123_xyz789",
"secret": "your-secret-key",
"secretTTL": 24,
"trustedPeers": [
{ "id": "peer-id", "secret": "peer-secret", "expiresAt": "2026-02-03T00:00:00Z" }
],
"downloadDir": "~/Downloads/ocft"
}
Limitations
- Chunk size: 48KB (safe for Base64 in messages)
- Default max file size: 100MB
- Designed for text-based channels
License
MIT
Permissions & Security
Security level L1: Low-risk skills with minimal permissions. Review inputs and outputs before running in production.
Requirements
- OpenClaw CLI installed and configured.
- Language: Markdown
- License: MIT
- Topics:
Configuration
| Command | Description | |---------|-------------| | `ocft set-download <dir>` | Set download directory | | `ocft set-max-size <size>` | Set max file size (e.g., `100MB`, `1GB`) |
FAQ
How do I install ocft?
Run openclaw add @stormixus/ocft in your terminal. This installs ocft into your OpenClaw Skills catalog.
Does this skill run locally or in the cloud?
OpenClaw Skills execute locally by default. Review the SKILL.md and permissions before running any skill.
Where can I verify the source code?
The source repository is available at https://github.com/openclaw/skills/tree/main/skills/stormixus/ocft. Review commits and README documentation before installing.
