File Transfer
/install file-transfer
File Transfer Skill
Overview
Context-aware file transfer skill for OpenClaw ecosystem. Intelligently transfers files based on conversation context with progress tracking.
Features
- Context-Aware: Automatically detects group/private chat and infers transfer intent
- File Validation: MIME type checking, size limits, chunked reading
- Telegram Support: Full adapter with progress tracking (simulated)
- Extensible: Adapter pattern for adding new channels
Installation
npm install file-transfer
Usage
Basic File Transfer
import { FileTransferSkill } from 'file-transfer';
const skill = new FileTransferSkill({
channels: { telegram: { enabled: true } }
});
const result = await skill.sendFileWithContext({
file: '/path/to/document.pdf',
caption: 'Team weekly report',
context: { chatId: '-1003655501651' }
});
Direct Adapter Usage
import { TelegramAdapter } from 'file-transfer/src/adapters/telegram-adapter.js';
const adapter = new TelegramAdapter();
const result = await adapter.sendFile({
filePath: '/path/to/file.pdf',
chatId: '-1003655501651',
caption: 'Document sharing'
});
Tool Definitions
sendFileWithContext
Transfers a file with intelligent context detection.
Parameters:
file(string, required): Path to the filecaption(string, optional): File descriptioncontext(object, optional): Conversation context withchatId
Returns:
success(boolean): Transfer success statusmessageId(string): Message IDcontext(object): Context analysis result (scenario, urgency, confidence)stats(object): Transfer statistics (size, duration, channel)
getTransferHistory
Retrieves file transfer history.
Parameters:
options(object, optional): Query options
Returns:
history(array): Transfer history recordsstats(object): Transfer statistics
Configuration
const skill = new FileTransferSkill({
contextEngine: {
enableAI: false,
maxHistoryLength: 10
},
file: {
maxFileSize: 100 * 1024 * 1024, // 100MB
allowedMimeTypes: ['application/pdf', 'image/jpeg', ...]
},
channels: {
telegram: {
enabled: true,
maxFileSize: 50 * 1024 * 1024 // 50MB
}
}
});
Context Analysis
The ContextEngine analyzes file transfers and returns:
| Field | Values | Description |
|---|---|---|
| scenario | share, backup, collaborate, archive |
Transfer intent |
| urgency | low, medium, high, critical |
Priority level |
| confidence | 0.0 - 1.0 | Analysis confidence |
| fileCategory | document, image, video, archive, code |
File classification |
Current Limitations
- Telegram adapter uses simulated transfer (no real API integration yet)
- WhatsApp and Discord adapters are planned but not implemented
- Transfer history is not persisted
Testing
npm test # All tests
npm run test:unit # Unit tests
npm run test:integration # Integration tests
License
MIT License - see LICENSE for details.
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install file-transfer - After installation, invoke the skill by name or use
/file-transfer - Provide required inputs per the skill's parameter spec and get structured output
What is File Transfer?
Transfers files intelligently based on chat context with MIME validation and progress tracking, supporting Telegram and extensible channels. It is an AI Agent Skill for Claude Code / OpenClaw, with 136 downloads so far.
How do I install File Transfer?
Run "/install file-transfer" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is File Transfer free?
Yes, File Transfer is completely free, licensed under MIT-0. You can download, install and use it at no cost.
Which platforms does File Transfer support?
File Transfer is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created File Transfer?
It is built and maintained by Ghostwritten (@ghostwritten); the current version is v0.2.0.