mailcli
Mailcli Skill
Use this skill to run reliable, repeatable mailcli workflows for email operations.
在用户需要通过命令行处理邮件任务时,使用此技能进行稳定、可复用的命令编排与执行。
Trigger Rules / 触发规则
Use this skill when the user asks about:
mailclicommands or setup- IMAP/SMTP authentication and mailbox operations
- inbox listing, searching, reading, moving, deleting, tagging
- sending email, replying, draft save/list/send
- downloading attachments
- troubleshooting email CLI failures
以下中文意图也应触发本技能:
- 邮件 CLI 使用、邮箱命令行管理
- IMAP/SMTP 配置、鉴权、密钥口令
- 收件箱查询、搜索、读信、移动、删除、打标
- 发信、回复、草稿、附件下载
- mailcli 报错排障
Installation / 安装与初始化
Read install.md before first use. 首次使用前先阅读 install.md。
Default install command:
npm install -g @yupingwang/mailcli
Execution Policy / 执行策略
-
Always use
mailclias the command entrypoint. -
Prefer direct execution for the user task; avoid unnecessary confirmation loops.
-
Validate parameters before executing risky or state-changing commands.
-
Keep commands explicit and reproducible in output.
-
固定使用
mailcli作为入口命令。 -
默认直接执行,避免不必要的确认回合。
-
对高风险或写操作命令先做参数校验。
-
输出时保留可复现的命令文本。
Core Workflow / 核心流程
-
Identify the operation category.
-
Load the relevant reference file(s) only.
-
Build command(s) with
scripts/build_mailcli_cmd.shwhen helpful. -
Validate argument constraints with
scripts/validate_mailcli_args.sh. -
Execute command(s), then summarize result and next action.
-
识别任务类型。
-
仅加载相关 reference 文件。
-
必要时用
scripts/build_mailcli_cmd.sh生成命令。 -
用
scripts/validate_mailcli_args.sh校验参数约束。 -
执行命令并汇总结果与下一步。
Command Rules / 命令规则
-
Respect runtime behavior from the project implementation.
-
For
send:--reply-allrequires--reply-uid--quoterequires--reply-uid--bodyand--body-fileare mutually exclusive- At least one recipient is required (unless inferred from reply flow)
- A message body (plain/html/quote result) is required
-
For UID operations (
read,delete,move,tag,draft send,attachments download), UID must be a positive integer. -
严格遵循项目中的真实运行语义。
-
send命令需满足 reply 依赖、正文参数互斥、收件人和正文约束。 -
UID 类操作必须使用正整数 UID。
Output Contract / 输出约定
Always produce output in this order:
- Intent / 任务意图(1 句)
- Commands / 执行命令(可多条)
- Result / 执行结果摘要
- Recovery / 失败时修复动作(仅失败时)
Template:
Intent: ...
Commands:
- ...
Result: ...
Recovery: ...
Reference Routing / 参考资料路由
-
For install and environment setup: read install.md
-
For command syntax/options: read commands.md
-
For end-to-end task execution: read workflows.md
-
For error diagnosis and fixes: read troubleshooting.md
-
安装与环境初始化:读取 install.md
-
命令参数与语法:读取 commands.md
-
任务闭环流程:读取 workflows.md
-
故障诊断修复:读取 troubleshooting.md
Safety Boundaries / 安全边界
-
Do not fabricate unsupported subcommands or options.
-
Do not expose secrets in output; redact passwords unless user explicitly asks.
-
Prefer minimal-change command sequences for mailbox mutations.
-
不虚构未实现的子命令或参数。
-
不在输出中泄露敏感信息;密码默认脱敏。
-
写操作使用最小化变更序列,避免误删误移。