← 返回 Skills 市场
lengyhua

File Manager Service

作者 lengyhua · GitHub ↗ · v1.1.3 · MIT-0
cross-platform ✓ 安全检测通过
306
总下载
1
收藏
0
当前安装
5
版本数
在 OpenClaw 中安装
/install file-manager-service
功能描述
文件管理服务,支持服务启停、Web 界面浏览、文件上传下载和目录管理
使用说明 (SKILL.md)

File Manager Service Skill

操作运行在 http://127.0.0.1:8888 的文件管理服务,管理用户家目录下的 ~/.openclaw/workspace/projects 目录。

目录结构

file-manager-service/
├── SKILL.md                      # Skill 定义
├── README.md                     # 使用说明
├── _meta.json                    # 元数据
├── .gitignore                    # Git 忽略文件
└── scripts/
    ├── file_manager.py           # 客户端脚本(含服务管理)
    ├── server.py                 # Flask 服务端
    ├── templates/
    │   └── index.html            # Web 界面模板
    ├── .service.pid              # 服务进程 ID(运行时生成)
    └── .service.log              # 服务日志(运行时生成)

快速开始

服务管理

# 启动服务
python scripts/file_manager.py start

# 停止服务
python scripts/file_manager.py stop

# 重启服务
python scripts/file_manager.py restart

# 查看状态
python scripts/file_manager.py status

# 打开 Web 页面
python scripts/file_manager.py open

文件管理

# 列出文件
python scripts/file_manager.py list

# 列出指定目录
python scripts/file_manager.py list ai-agent-enterprise-design

# 查看文件内容
python scripts/file_manager.py cat path/to/file.md

# 搜索文件
python scripts/file_manager.py search 关键词

# 统计信息
python scripts/file_manager.py stats

# 创建目录(自动递归创建父目录)
python scripts/file_manager.py mkdir parent/path NewDirName

# 删除文件/目录
python scripts/file_manager.py delete path/to/item

# 移动文件/目录
python scripts/file_manager.py move source/path dest/path

# 获取/设置目录备注
python scripts/file_manager.py note directory-name
python scripts/file_manager.py note directory-name 备注内容

# 上传文件(支持多个文件)
python scripts/file_manager.py upload file1.md file2.py
python scripts/file_manager.py upload *.txt -p project/docs

直接调用 API

操作 端点 方法
列出文件 /api/files?path=xxx GET
获取文件内容 /api/file/content?path=xxx GET
保存文件 /api/file/save POST
下载文件 /api/file/download?path=xxx GET
删除 /api/delete POST
移动 /api/move POST
创建目录 /api/create/dir POST
创建文件 /api/create/file POST
搜索 /api/search?q=xxx&regex=true GET
统计 /api/stats GET
获取备注 /api/notes/get?path=xxx GET
保存备注 /api/notes/save POST
目录树 /api/tree?path=xxx GET
下载目录 /api/download?path=xxx GET
上传文件 /api/upload POST
批量上传 /api/upload-folder POST

使用示例

启动服务并打开页面

python scripts/file_manager.py start
python scripts/file_manager.py open

查看服务状态

python scripts/file_manager.py status

输出:

{
  "running": true,
  "pid": 84078,
  "url": "http://127.0.0.1:8888",
  "service_dir": "/Users/lengyanhua/.openclaw/skills/file-manager-service/file-manager-service"
}

递归创建目录

# 自动创建 a/b/c 目录链
python scripts/file_manager.py mkdir a/b NewDir

创建文件到不存在的目录

# 自动创建父目录后创建文件
python scripts/file_manager.py mkdir x/y test.txt "文件内容"

支持的文件类型

上传: 不限制文件类型,支持任意格式(.pdf, .docx, .xlsx, .zip, 图片,视频等)

在线查看/编辑: .txt, .md, .html, .py, .js, .json, .yaml, .yml, .css, .xml, .log, .sh, .bash, .sql, .java, .go, .rs, .ts, .jsx, .tsx, .htm, .svg

注意: 非文本文件(如 PDF、图片)可上传和下载,但无法在线预览编辑

安全限制

  • 所有路径必须在 ~/.openclaw/workspace/projects
  • 不能删除根目录
  • 隐藏文件(以 . 开头)不显示
  • 目录备注仅支持第一级子目录

故障排除

服务启动失败:检查 scripts/.service.log 日志文件

端口被占用lsof -ti :8888 | xargs kill -9 然后重新启动

路径非法:确保路径在允许的根目录内

文件类型不支持:检查文件扩展名是否在允许列表中

权限错误:确认家目录可写(macOS 上不要使用 /root 路径)

特性

  • ✅ 自动递归创建父目录
  • ✅ 跨平台支持(macOS/Linux,自动检测家目录)
  • ✅ Web 界面浏览和管理文件
  • ✅ 目录备注功能
  • ✅ 搜索文件和目录(支持正则表达式)
  • ✅ 目录打包下载(ZIP)
  • ✅ 移动文件/目录自动避免覆盖
  • ✅ 现代化 UI 设计(Apple 风格,毛玻璃效果)
  • ✅ 优化的删除/备注/移动确认对话框
安全使用建议
This skill appears to be what it claims: a local Flask-based file manager that operates only within ~/.openclaw/workspace/projects. Before running it, consider: (1) audit the included scripts (server.py and file_manager.py) yourself — starting the service will execute code on your machine; (2) the web UI references an external CDN script (marked.min.js) — loading the UI causes your browser to fetch that third-party JS (which reveals your IP to the CDN and runs code in the browser). If you want tighter control, host the marked.js bundle locally or remove the external script reference; (3) the CLI uses ps/lsof or /proc to find PIDs — this touches system-level info to implement start/stop and is normal but does read process metadata; (4) run the service under a non-root user and validate backups of any important data in the targeted directory. If you want additional assurance, run the skill in a sandboxed environment or inspect the remaining truncated parts of server.py (upload handling, etc.) to confirm there are no unexpected network calls or logging of file contents to external endpoints.
功能分析
Type: OpenClaw Skill Name: file-manager-service Version: 1.1.3 The file-manager-service bundle provides a legitimate Flask-based utility for managing files within a specific workspace (~/.openclaw/workspace/projects). The implementation in scripts/server.py includes robust security checks using Path.relative_to() to prevent path traversal attacks across all API endpoints (upload, delete, move, read). While the service lacks authentication and listens on all interfaces (0.0.0.0:8888), which is a significant security vulnerability if exposed to a network, there is no evidence of malicious intent, data exfiltration, or unauthorized persistence mechanisms. The code logic is transparent and aligns with the stated purpose of providing a Web UI and CLI for file management.
能力评估
Purpose & Capability
Name/description state a local file management service and the bundle actually contains a Flask server (scripts/server.py) and a CLI client (scripts/file_manager.py) that start/stop and call that local server. The declared root directory (HOME/.openclaw/workspace/projects) matches the code's BASE_DIR, so required capabilities are proportional to the stated purpose.
Instruction Scope
SKILL.md and README instruct running the included Python scripts and interacting with the local HTTP API; they do not ask for other system credentials. Two notes: (1) the web UI template loads an external script from https://cdn.jsdelivr.net/npm/marked/marked.min.js — opening the UI will cause the browser to fetch code from that CDN (network call from the user's browser); (2) README and SKILL.md contain minor mismatches (e.g., references to file-manager-service/app.py) which are inconsistent with the provided scripts directory. Otherwise instructions limit file operations to the declared BASE_DIR.
Install Mechanism
There is no install spec — this is instruction + included code. No remote download or install-from-URL is performed by the skill metadata. Execution requires the user to run the included Python scripts locally; the package does not automatically fetch arbitrary archives or third-party binaries.
Credentials
The skill declares no required environment variables or credentials and the code does not request external API keys. The service reads/writes files under the user's HOME/.openclaw/workspace/projects directory only (as implemented).
Persistence & Privilege
The skill is not always-enabled and does not request system-wide privileges. Running the skill spawns a local Flask process and writes a .service.pid/.service.log in its service directory, which is expected for a local service. The client includes logic to inspect processes/ports to manage the service (uses ps/lsof or /proc), which is typical for start/stop functionality.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install file-manager-service
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /file-manager-service 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.1.3
file-manager-service 1.1.3 - 改进 Web UI,采用现代化 Apple 风格设计并加入毛玻璃效果 - 优化删除、备注、移动操作的确认对话框体验 - 文档(SKILL.md, README.md)更新:反映新版界面和特性 - package.json 更新,维护依赖和元数据
v1.1.2
- 搜索 API 增加正则表达式参数(`/api/search?q=xxx&regex=true`),支持正则搜索。 - 文档同步:README.md 与 SKILL.md 更新,修正和充实搜索相关说明。 - Web 界面布局优化:搜索框集成到标题行,界面更紧凑、统一。 - 特性列表新增“支持正则表达式搜索”“紧凑 UI 布局”等。 - 依赖更新:package.json 有相应调整以配合前端细节更新。
v1.1.1
- 新增 package.json 文件,提供依赖与配置信息 - 优化 SKILL.md,描述更简洁明了 - 更新 _meta.json 以适配最新 skill 信息结构 - 增强 scripts/file_manager.py 代码(细节见代码差异)
v1.1.0
**Major update with new features, improved cross-platform support, and enhanced file operations.** - Added server-side code organization: new scripts/server.py and web template scripts/templates/index.html; removed old app.py and template. - Switched workspace management to user's home directory (~/.openclaw/workspace/projects) with automatic path detection and better cross-platform (macOS/Linux) support. - Introduced new features: recursive directory creation, file/folder upload (single and batch), downloadable directory ZIP, and API endpoints for tree view and uploads. - Updated documentation with clearer structure, usage examples, and troubleshooting tips. - Improved file operation safety and extended file format support (uploads allowed for any file type). - Simplified and clarified command line operations and API usage for file/directory management.
v1.0.0
Initial release of file-manager-service. - File management service for browsing, editing, moving, and organizing files under /root/.openclaw/workspace/projects. - Provides command-line tools for starting/stopping service, managing files and folders, and opening a web interface. - REST API endpoints for file operations (list, read, write, move, delete, create, search, and notes). - Safety features: restricts actions to workspace root, hides dotfiles, prevents root deletion. - Supports a range of editable text/code file types. - Troubleshooting tips and usage examples included in documentation.
元数据
Slug file-manager-service
版本 1.1.3
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 5
常见问题

File Manager Service 是什么?

文件管理服务,支持服务启停、Web 界面浏览、文件上传下载和目录管理. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 306 次。

如何安装 File Manager Service?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install file-manager-service」即可一键安装,无需额外配置。

File Manager Service 是免费的吗?

是的,File Manager Service 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

File Manager Service 支持哪些平台?

File Manager Service 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 File Manager Service?

由 lengyhua(@lengyhua)开发并维护,当前版本 v1.1.3。

💬 留言讨论