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.
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install file-transfer - 安装完成后,直接呼叫该 Skill 的名称或使用
/file-transfer触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
File Transfer 是什么?
Transfers files intelligently based on chat context with MIME validation and progress tracking, supporting Telegram and extensible channels. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 136 次。
如何安装 File Transfer?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install file-transfer」即可一键安装,无需额外配置。
File Transfer 是免费的吗?
是的,File Transfer 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
File Transfer 支持哪些平台?
File Transfer 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 File Transfer?
由 Ghostwritten(@ghostwritten)开发并维护,当前版本 v0.2.0。