---
name: easy-explorer
description: Easy Explorer CLI (easy-explorer.exe) — Windows 多窗格文件管理器的命令行接口。GUI 能力全覆盖：目录浏览、复制移动、批量重命名、文件夹同步、暂存架、快捷启动、文件模板、着色/快捷键/侧栏分组、视图记忆与预设、SFTP 远程浏览传输。适合脚本与 AI agent 直接驱动本机文件操作。
version: 0.1.0
updated: 2026-10-23
---

# Easy Explorer CLI

Windows 10/11 上的现代多窗格文件管理器：操作习惯与系统资源管理器一致，在此之上提供多窗格、工作区、批量重命名、暂存架、文件夹同步、视图系统与 SFTP 远程连接。**全程本机处理，文件不上传；GPL-3.0 开源，v1 全免费。**

GUI 与 CLI 共用同一套引擎与状态文件，命令行做到 GUI 能力全覆盖。

## 安装

从官网下载安装包（per-machine 装到 `C:\Program Files\Easy Explorer`），安装器会把安装目录加入用户 PATH：

- 产品详情页 / 下载：https://pinnadash.com/easy-explorer
- skill 下载：https://pinnadash.com/assets/skills/easy-explorer-SKILL.md

安装后：

- `easy_explorer.exe` — GUI 主程序
- `easy-explorer.exe` — 无头 CLI（本 skill 的调用入口）

```powershell
easy-explorer help
easy-explorer version
```

所有命令成功退出码 `0`，失败退出码 `1` 并在 stderr 输出错误原文。

## 浏览与基础操作

```powershell
easy-explorer list C:\Users\lin\Downloads              # 列目录（大小/修改时间）
easy-explorer list D:\ --all --sort mtime --dir desc --limit 50
easy-explorer copy  D:\a\file.zip C:\backup --overwrite
easy-explorer move  C:\tmp\report.pdf D:\docs
easy-explorer rename one C:\tmp old.txt new.txt
easy-explorer trash C:\tmp\old.txt                     # 删除到回收站（可恢复）
easy-explorer open  C:\tmp\report.pdf                  # 系统默认程序打开
easy-explorer open  C:\tmp\report.pdf --reveal         # 在资源管理器中显示
easy-explorer search C:\src "config" --limit 200 --all
easy-explorer preview C:\src\main.ts                   # 文本头部预览（二进制只报类型）
easy-explorer drives                                   # 列出本地驱动器
easy-explorer fav list
easy-explorer fav add C:\work
easy-explorer log 30                                   # 查看应用状态台账
```

排序键：`name | size | mtime | type`；方向：`asc | desc`。

## 批量重命名

`rename` 读取一份计划 JSON（目录 + 条目名 + 规则管线），与 GUI 使用同一规则引擎：

```json
{
  "dir": "D:\\photos",
  "items": ["IMG_0001.JPG", "IMG_0002.JPG"],
  "rules": [
    { "kind": "replace", "find": "IMG_", "replacement": "trip-" },
    { "kind": "number", "position": "suffix", "start": 1, "step": 1, "pad": 3, "sep": "-" },
    { "kind": "case", "mode": "lower", "scope": "ext" }
  ]
}
```

```powershell
easy-explorer rename --batch plan.json --dry-run       # 先预览：OK / SAME / CONFLICT / INVALID
easy-explorer rename --batch plan.json                 # 执行（两阶段改名，失败尽力回滚）
```

规则类型：

- `replace`：字面量或正则替换（`regex: true` 时 `replacement` 支持 `$1` 捕获组；默认大小写不敏感，`caseSensitive: true` 可改）
- `insert`：插入固定文本（`position: prefix|suffix`）
- `number`：按条目顺序编号（`start` / `step` / `pad` 补零 / `sep` 连接符）
- `case`：大小写转换（`mode: lower|upper|capitalize`）
- 每条规则可用 `scope: stem|ext|all` 限定作用域（默认 `stem`）

预览会校验批内互撞、与盘上既有条目冲突、非法名称；`canApply=true` 才建议执行。

## 文件夹同步

```powershell
easy-explorer sync C:\photos D:\backup                    # 默认单向 left → right（增量）
easy-explorer sync C:\photos D:\backup --direction both   # 双向合并（新者胜）
easy-explorer sync C:\photos D:\backup --delete           # 镜像：删除目标独有（单向时可用）
easy-explorer sync C:\photos D:\backup --dry-run          # 只预览逐条动作
```

## 暂存架

跨目录临时收集，最多 500 项；状态与 GUI 共用：

```powershell
easy-explorer shelf add D:\a\file1.zip D:\b\file2.zip
easy-explorer shelf list
easy-explorer shelf remove D:\a\file1.zip
easy-explorer shelf copy D:\target            # 整架复制
easy-explorer shelf move D:\target --overwrite # 整架移动（成功项自动出架）
easy-explorer shelf clear
```

## 快捷启动 / 文件模板 / 着色 / 快捷键 / 侧栏分组

```powershell
easy-explorer ql list
easy-explorer ql open vscode C:\src              # 支持 {{dir}} / {{path}} 占位符
easy-explorer ql add mytool "My Tool" "C:\tools\my.exe" --arg "--fast" --scope both
easy-explorer ql disable mytool

easy-explorer template list
easy-explorer template new D:\notes meeting.md   # 从模板新建（自动去重命名）

easy-explorer color list
easy-explorer color add tmp-hidden hidden true "#f59e0b"
easy-explorer color add ps1 ext ps1 "#22c55e"
easy-explorer color move tmp-hidden up

easy-explorer shortcut list
easy-explorer shortcut set rename Ctrl+Shift+R
easy-explorer shortcut clear rename

easy-explorer group list
easy-explorer group add Projects
easy-explorer group item-add <group-id> D:\work\project-a
```

## 视图记忆与预设

```powershell
easy-explorer folderview list
easy-explorer folderview set D:\photos --view icons --sort name --dir asc --group date
easy-explorer folderview clear D:\photos

easy-explorer preset list
easy-explorer preset add photos --view icons --sort mtime --dir desc --group date --columns size,mtime
easy-explorer preset rename <id> photos-2026
easy-explorer preset remove <id>
```

视图：`details | icons | columns`；分组：`none | kind | date | ext`。

## SFTP 远程

连接配置与密码存本机（密码进 Windows 凭据管理器，不写 `state.json`）。首次连接按 TOFU 记录主机指纹：

```powershell
easy-explorer remote add vps 192.168.1.10 --port 22 --user lin --auth key --key C:\Users\lin\.ssh\id_ed25519
easy-explorer remote add nas 192.168.1.20 --user backup --auth password
easy-explorer remote list
easy-explorer remote show vps
easy-explorer remote test vps
easy-explorer remote ls vps /data --sort mtime --dir desc --limit 100

easy-explorer remote download vps /data/report.csv D:\downloads --overwrite
easy-explorer remote upload D:\downloads\report.csv vps /data --overwrite
easy-explorer remote update vps --rename nas-main --clear-password
easy-explorer remote remove nas-main
```

## 状态与日志

- 状态文件：`%APPDATA%\com.easyexplorer.app\state.json`（收藏、暂存架、快捷启动、着色规则、快捷键、分组、视图记忆/预设、远程连接；密码不在其中）
- 状态台账：`%APPDATA%\com.easyexplorer.app\state-log.ndjson`（`log` 命令读取）
- GUI 日志：`%APPDATA%\com.easyexplorer.app\logs\easy-explorer.log.*`（按天滚动，保留 14 天）
- CLI 不落盘日志，错误直接写 stderr

## 安全边界

- 删除一律走系统回收站（`trash`），不提供永久删除
- 文件操作只在本机进行，不上传任何文件内容
- 远程密码存系统凭据管理器；SFTP 主机指纹首次记录并校验
- 批量重命名与同步均支持先预览（`--dry-run`），建议脚本化时先跑预览再执行
