Token导航 LogoToken导航TokenDH.com
Downloads Organizer logo
开发工具未说明官方级别未说明来源级核验

Downloads Organizer

MCP Server

一款基于文件类型和命名模式自动分类下载文件的工具,支持学术文件特殊处理和多平台运行。

工具数

0

提示词数

0

GitHub Stars

0

资源数

0
开发工具跨平台TypeScriptClaudeClaude

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

IshanRai9

提供方

IshanRai9

最后核验

2026/5/17 20:23

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

详细介绍

下载文件管理器

我构建了这个自动文件管理器,因为我厌倦了下载文件夹一团糟。它根据文件的类型和特定的命名模式对文件进行分类,将它们移动到有组织的子目录中。我将其设计为使用Agent Hooks集成与Kiro IDE无缝协作,因此文件一旦下载就会自动组织。

特性

  • 自动组织:文件在添加到下载时会自动分类和移动
  • 智能分类:按类型组织的文件(Dev、Zip、Media、Docs、Exe、Misc)
  • 学术支持:我为带有“22102”、“作业”等模式的学术文件添加了特殊处理。(最初是为我的VIT课程设计的)
  • Agent Hooks集成:使用Kiro的Agent Hooks自动触发
  • MCP服务器支持:通过回退到标准方法增强了文件操作
  • 交叉平台的:适用于Windows、macOS和Linux

文件类别

  • 开发:编程文件(.py、.js、.ts、.html、.css、.json等)
  • 压缩:存档文件(.zip、.rar、.7z、.tar.gz等)
  • 媒体:图像、视频、音频(.jpg、.mp4、.mp3等)
  • 文档:文档(.pdf、.docx、.xlsx、.csv等)
  • 可执行文件:可执行文件(.exe、.msi、.dmg、.deb等)
  • 学术的:学术档案(包含“22102”、“作业”、“实验室”等)
  • 杂项:其他一切

快速开始

1.安装

cd downloads-organizer
npm install
npm run build

2.初始化文件夹

npm run cli init

3.整理文件

# Preview what would be organized
npm run cli organize --preview

# Actually organize files
npm run cli organize

4.设置自动组织(代理挂钩)

在Kiro IDE中:

  1. 打开命令选项板(Ctrl+Shift+P)
  2. 搜索“打开Kiro Hook用户界面”
  3. 使用以下设置创建新挂钩:

- 名字:下载文件管理器 - 触发:文件系统更改 - 路径:您的下载文件夹路径 - 命令: node /path/to/downloads-organizer/dist/hooks/AgentHookHandler.js - 自动审批:是(无缝操作)

CLI命令

整理文件

# Organize all files in Downloads
npm run cli organize

# Preview organization without moving files
npm run cli organize --preview

# Use custom Downloads path
npm run cli organize --path /custom/downloads/path

监视状态

# Show detailed status and statistics
npm run cli status

配置管理

# Show current configuration
npm run cli config --show

# Set Downloads folder path
npm run cli config --set-path /new/downloads/path

# Add academic naming pattern
npm run cli config --add-pattern "Quiz"

# Enable/disable MCP server integration
npm run cli config --enable-mcp
npm run cli config --disable-mcp

# Reset to default configuration
npm run cli config --reset

文件夹管理

# Initialize all category folders
npm run cli init

# Clean up empty folders
npm run cli cleanup

自动监测

# Start watching Downloads folder
npm run cli watch

# Stop watching (from another terminal)
npm run cli watch --stop

Agent Hook设置

方法1:使用Kiro Hook UI

  1. 访问钩子UI

- 按 Ctrl+Shift+P (Windows/Linux)或 Cmd+Shift+P (macOS) - 键入“打开Kiro Hook UI” - 按 Enter

  1. 创建新钩子

- 点击“创建新钩子” - 填写详细信息:

   Name: Downloads File Organizer
   Description: Automatically organize downloaded files by type and VIT patterns

   Trigger: File Created
   Watch Path: C:\Users\[YourUsername]\Downloads (Windows)
   or ~/Downloads (macOS/Linux)

   Prompt: A file has been created in the Downloads folder. Please organize this file by running the downloads organizer script to categorize it by type and VIT patterns. Execute: npm run cli -- 

方法2:手动吊钩配置

在Kiro工作区中创建挂钩配置文件:

{
  "name": "Downloads File Organizer",
  "description": "Automatically organize downloaded files by type and VIT patterns",
  "trigger": {
    "type": "filesystem",
    "path": "~/Downloads",
    "events": ["create", "modify"],
    "debounce": 2000
  },
  "action": {
    "type": "command",
    "command": "node",
    "args": ["/path/to/downloads-organizer/dist/hooks/AgentHookHandler.js"],
    "autoApprove": true
  }
}

MCP服务器集成

我集成了MCP(模型上下文协议)服务器来增强文件操作。以下是我推荐的服务器:

推荐的MCP服务器

  1. 文件操作MCP服务器
   {
     "mcpServers": {
       "file-operations": {
         "command": "npm",
         "args": ["-y @smithery/cli install @bsmi021/mcp-file-operations-server --client claude"],
         "disabled": false,
         "autoApprove": ["moveFile", "createDirectory", "checkExists"]
       }
     }
   }
  1. 记录MCP服务器
   {
     "mcpServers": {
       "logging": {
         "command": "uvx", 
         "args": ["logging-mcp-server@latest"],
         "disabled": false,
         "autoApprove": ["log", "logError", "logInfo"]
       }
     }
   }

MCP设置说明

  1. 安装UV(Python包管理器)
   # Windows (PowerShell)
   powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"

   # macOS/Linux
   curl -LsSf https://astral.sh/uv/install.sh | sh
  1. 在Kiro中配置MCP

- 创建/编辑 .kiro/settings/mcp.json 在您的工作空间中 - 添加上面的MCP服务器配置 - 重新启动Kiro或刷新MCP连接

  1. 验证MCP集成
   npm run cli status
   # Should show "MCP Available: ✅"

配置

我让组织者高度可配置,这样你就可以根据自己的需求进行调整。

配置文件位置

  • 视窗: %USERPROFILE%\.downloads-organizer\config.json
  • macOS/Linux: ~/.downloads-organizer/config.json

配置选项

{
  "downloadsPath": "~/Downloads",
  "categories": [
    {
      "name": "Dev",
      "folderName": "Dev", 
      "extensions": ["js", "py", "html", "css", ...]
    }
  ],
  "academicPatterns": ["22102", "Assignment", "Lab", "Exp", "SEM"],
  "useMCP": true,
  "autoApprove": false
}

学术命名模式

我配置了组织者来识别这些学术模式(不区分大小写):

  • 课程代码: 22102, CSE22102
  • 任务类型: Assignment, Assgn
  • 实验室工作: Lab, Laboratory, Practical, Prac
  • 实验: Experiment, Exp
  • 学期: SEM

与这些模式匹配的文件被移动到 Academic 文件夹,无论其文件扩展名如何。

发展

我将这个项目设计为模块化和可测试的。我是这样组织的:

项目结构

downloads-organizer/
├── src/
│   ├── services/          # Core business logic
│   ├── interfaces/        # TypeScript interfaces
│   ├── types/            # Type definitions
│   ├── constants/        # Configuration constants
│   ├── hooks/            # Agent Hook handlers
│   ├── __tests__/        # Unit and integration tests
│   └── cli.ts            # Command-line interface
├── dist/                 # Compiled JavaScript
└── docs/                 # Additional documentation

开发命令

# Install dependencies
npm install

# Run tests
npm test

# Run tests with coverage
npm run test:coverage

# Build project
npm run build

# Development mode with auto-rebuild
npm run dev

# Lint code
npm run lint

# Format code
npm run format

运行测试

# Run all tests
npm test

# Run specific test file
npm test -- ExtensionMatcher.test.ts

# Run tests in watch mode
npm test -- --watch

# Run integration tests
npm test -- integration.test.ts

故障排除

我在开发和使用过程中遇到了这些问题。以下是我找到的解决方案:

常见问题

  1. “找不到下载文件夹”

- 检查下载文件夹是否存在 - 验证配置中的路径: npm run cli config --show - 设置正确的路径: npm run cli config --set-path /correct/path

  1. “权限被拒绝”错误

- 必要时以提升的权限运行 - 检查文件/文件夹权限 - 确保文件未被其他应用程序使用

  1. Agent Hook未触发

- 验证钩子在Kiro hook UI中是否处于活动状态 - 检查吊钩配置和路径 - 查找Kiro输出面板中的错误

  1. MCP服务器不工作

- 安装紫外线: curl -LsSf https://astral.sh/uv/install.sh | sh - 检查中的MCP配置 .kiro/settings/mcp.json - MCP配置更改后重新启动Kiro

  1. 文件分类不正确

- 检查是否支持文件扩展名: npm run cli status - 验证VIT模式: npm run cli config --show - 预览测试: npm run cli organize --preview

调试模式

通过设置环境变量启用详细日志记录:

DEBUG=downloads-organizer npm run cli organize

获取帮助

  1. 检查状态: npm run cli status
  2. 审查配置: npm run cli config --show
  3. 预览测试: npm run cli organize --preview
  4. 检查Kiro输出面板中的日志
  5. 运行集成测试: npm test -- integration.test.ts

贡献

我欢迎捐款!以下是您可以提供帮助的方式:

  1. 分叉存储库
  2. 创建要素分支: git checkout -b feature-name
  3. 进行更改并添加测试
  4. 运行测试: npm test
  5. 构建项目: npm run build
  6. 提交拉取请求

对于bug、功能请求或问题,请随时打开问题。

我为什么建造这个

我一直对下载文件夹变得混乱感到沮丧。作为一名学生,我的学术文件和随机下载的文件混杂在一起,开发文件到处都是,找到任何东西都是一场噩梦。因此,我构建了这个组织者,以便在文件下载后立即自动对所有内容进行排序。

学术模式识别是专门为我的课程设计的(最初是VIT模式),但我使其可配置,这样任何人都可以根据自己的需求进行调整。

许可证

MIT许可证-详见许可证文件

目录标签

目录标签

开发工具跨平台TypeScriptClaude文件管理本地部署自动化工具学术支持

支持客户端

Claude

接入字段

传输方式(transport,传输协议)

未说明

鉴权方式(authType,认证方式)

none

工具数量(toolCount,工具数)

0

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

未说明none部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

仍需确认:installCommand

来源信息

继续浏览同类 MCP