本 Skill 用于让 AI Agent 通过 OpenList HTTP API 以可审计、可确认的方式执行常见操作:浏览路径、移动、重命名、单路径删除、创建离线任务,以及查询/取消任务。默认不支持覆盖写入、批量删除或其他高风险不可逆动作。
必需环境变量:
OPENLIST_BASE_URL:OpenList 根地址,例如 http://localhost:5244 或 https://example.com/openlistOPENLIST_TOKEN:OpenList Token 原文,请求头使用 Authorization: ,不要加 Bearer可选环境变量:
OPENLIST_TIMEOUT_SECONDS:默认 30OPENLIST_VERIFY_TLS:默认 true,自签名证书环境可设为 falseOPENLIST_AUDIT_PATH:默认 ~/.codex/openlist/audit.jsonl支持从仓库根 .env 或 skills/openlist/.env 读取配置;环境变量优先级更高。请不要把 .env 提交到仓库。
脚本入口:python skills/openlist/scripts/openlist.py
只读命令:
pingwhoamifs-get --path fs-list --path [--refresh] offline-toolstask-info --task-type --tid task-list --task-type [--state undone|done] audit-show [--event-id ] [--plan-id ] [--tid ] 变更命令:
preview-move --src-path --dst-dir [--conflict-policy fail|auto_rename|skip] preview-rename --path --new-name [--conflict-policy fail|auto_rename] preview-delete --path preview-offline-create --url [--url ...] --dst-dir [--tool ] [--delete-policy ] apply --plan-file task-cancel --task-type offline_download --tid 所有会修改状态的操作都必须走两步:
preview-* 生成 OperationPlanapply典型流程:
python skills/openlist/scripts/openlist.py preview-move `
--src-path "/from/report.pdf" `
--dst-dir "/to/" `
--json > move.plan.json
python skills/openlist/scripts/openlist.py apply --plan-file move.plan.json --json
preview-* --json 的 stdout 只输出单个 JSON 对象;apply --json 的 stdout 也只输出单个 JSON 对象。错误会保留在 stderr,方便 Agent 读取。
删除操作额外要求:
preview-deleteapply移动文件:
python skills/openlist/scripts/openlist.py preview-move `
--src-path "/from/report.pdf" `
--dst-dir "/archive/" `
--conflict-policy fail `
--json > move.plan.json
python skills/openlist/scripts/openlist.py apply --plan-file move.plan.json --json
重命名文件:
python skills/openlist/scripts/openlist.py preview-rename `
--path "/archive/report.pdf" `
--new-name "report-2026.pdf" `
--json > rename.plan.json
python skills/openlist/scripts/openlist.py apply --plan-file rename.plan.json --json
冲突策略说明:
fail:默认策略。发现同名冲突时只生成带冲突信息的 plan,apply 会拒绝执行auto_rename:自动生成稳定的新名称,例如 report (1).pdfskip:仅 preview-move 支持。目标已存在时,最终执行会跳过该项无变更检测:
preview-move 会标记为 no-oppreview-rename 会标记为 no-opapply 会返回成功并写审计,不会调用写接口预览删除:
python skills/openlist/scripts/openlist.py preview-delete `
--path "/archive/report.pdf" `
--json > delete.plan.json
Agent 在执行 apply 前必须向用户明确展示:
/archive/report.pdffile 或 dir用户确认后执行:
python skills/openlist/scripts/openlist.py apply --plan-file delete.plan.json --json
删除执行前会再次在线校验:
任一条件不满足时,apply 会拒绝执行并提示重新 preview-delete。
先查看可用工具:
python skills/openlist/scripts/openlist.py offline-tools --json
预览创建任务:
python skills/openlist/scripts/openlist.py preview-offline-create `
--url "https://example.com/file.iso" `
--dst-dir "/downloads/" `
--json > offline.plan.json
执行并查询:
python skills/openlist/scripts/openlist.py apply --plan-file offline.plan.json --json
python skills/openlist/scripts/openlist.py task-list --task-type offline_download --json
python skills/openlist/scripts/openlist.py task-info --task-type offline_download --tid "<tid>" --json
python skills/openlist/scripts/openlist.py task-cancel --task-type offline_download --tid "<tid>" --json
默认工具选择规则:
SimpleHttp,优先选择 SimpleHttpdelete_policy=delete_never每一次 preview、apply、deny 和只读命令都会写入 JSONL 审计。默认位置:
~/.codex/openlist/audit.jsonl
审计记录包含:
event_idtimestampphaserequest_idplan_idoperation_typeinputsoutcome敏感字段如 Authorization、token、password、secret 会被脱敏。
查询示例:
python skills/openlist/scripts/openlist.py audit-show --event-id "<event-id>" --json
python skills/openlist/scripts/openlist.py audit-show --plan-id "<plan-id>" --json
python skills/openlist/scripts/openlist.py audit-show --tid "<task-id>" --json
回退指引:
task-canceloverwrite=true/api/fs/remove 的单路径显式删除,不支持批量路径/apply 只允许执行白名单 endpoint:/api/fs/move/api/fs/rename/api/fs/remove/api/fs/add_offline_downloadapply 会拒绝执行并写 deny 审计fs-get 或 fs-listauto_rename 或 skippreview-delete,再次确认路径与对象类型openlist_code 与 messageoffline-tools,确认实例已经启用下载工具OPENLIST_VERIFY_TLS=false共 1 个版本