Get the FREE Ultimate OpenClaw Setup Guide →
s

OCFT - OpenClaw File Transfer

Scanned

@stormixus

npx machina-cli add skill @stormixus/ocft --openclaw
Files (1)
SKILL.md
3.5 KB

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

CommandDescription
ocft initInitialize node with unique ID and secret
ocft statusShow node status and configuration
ocft show-secretDisplay full secret (careful!)
ocft exportExport connection info as URI
ocft import <uri>Import peer from ocft:// URI
ocft verify <secret>Verify if a secret matches yours

Peer Management

CommandDescription
ocft add-peer <id> <secret>Add a trusted peer
ocft remove-peer <id>Remove a trusted peer
ocft list-peersList 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

CommandDescription
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)

CommandDescription
ocft ipfs-enableEnable IPFS fallback for large files
ocft ipfs-disableDisable 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

Source

git clone https://clawhub.ai/stormixus/ocftView on GitHub

Overview

OCFT enables peer-to-peer file transfers between AI agents using text-based channels. It supports chunked transfers with 48KB chunks, integrity verification using SHA-256, and a trusted-peer whitelist with per-peer secrets. Large files can be delegated to IPFS via configurable providers when needed.

How This Skill Works

OCFT uses text messages prefixed with 🔗OCFT: and a base64-encoded JSON payload to carry file metadata and chunks. Each chunk is 48KB and is hashed with SHA-256 for integrity; transfers can resume from the last received chunk. If the file exceeds the chunk threshold, IPFS fallback can be enabled and controlled via provider, key, and threshold settings.

When to Use It

  • 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

Quick Start

  1. Step 1: Initialize your node: ocft init
  2. Step 2: Check status and export: ocft status; ocft export
  3. Step 3: Add a trusted peer or import a URI: ocft add-peer <nodeId> <secret> --name "Friend" or ocft import ocft://<URI>

Best Practices

  • Maintain a trusted peer whitelist and use per-peer secrets.
  • Verify every chunk with SHA-256 hashes before accepting.
  • Configure a sensible IPFS threshold and provider to handle large files.
  • Use the resume feature to recover transfers after interruptions.
  • Test with small files first and tune max file size and timeouts.

Example Use Cases

  • Two agents exchange dataset shards via Slack to coordinate training.
  • A team bot shares a trained model artifact with a trusted peer network.
  • A supervisory bot receives log bundles from worker agents through Discord.
  • IPFS fallback handles multi-GB data using a chosen provider.
  • Interrupted transfers resume automatically when the network recovers.

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers