微算力 · API 导航与自营网关
API 接入 EN
未登录登录
📋

macOS终端Drafts笔记管家

drafts · vv1.0.0
办公 安全 A 级 作者 nerveband 公开目录收录
1.7k 下载 721 安装 3.8k 收藏 50.5k 浏览

简介

基于AppleScript的Drafts CLI文档指南,助力macOS用户通过终端高效管理笔记,需配合Drafts Pro订阅使用。

原始描述

Manage Drafts app notes via CLI on macOS. Create, view, list, edit, append, prepend, and run actions on drafts. Use when a user asks to create a note, list drafts, search drafts, or manage their Drafts inbox. IMPORTANT - Drafts app must be running on macOS for this to work.

通过你的 Agent 添加

点「快速安装」复制一段指令,粘给你正在用的 Agent(Claude Code、Codex、OpenClaw 等),它会自己完成安装。

或者手动安装

Claude Codeunzip -o skill.zip -d ~/.claude/skills/drafts/
其它 Agent解压到它自己的 skills 目录,目录名用 drafts

包里是 SKILL.md 加作者附带的文件,解压后目录名就是技能名。 技能申请的权限由作者决定,装之前请确认它能读什么、能执行什么。

中文使用说明 来自收录源

核心用法

drafts Skill 是一个纯文档型工具说明,指导用户通过命令行与 macOS 上的 Drafts 笔记应用交互。主要功能包括:

  • 创建笔记:drafts create "内容" [-t 标签] [-f 标记] [-a 归档]
  • 列出笔记:drafts list [-f 文件夹] [-t 标签过滤]
  • 查看/编辑:drafts get [uuid] 获取内容,drafts edit <uuid> 打开编辑器
  • 修改内容:drafts prepend/append/replace 支持在笔记前后插入或替换全文
  • 运行动作:drafts run "动作名" 执行 Drafts 自动化动作

所有命令返回 JSON 格式结果,支持 --plain 切换为可读文本。

显著优点

  1. 效率提升:无需离开终端即可快速捕获想法,适合开发者工作流
  2. 结构化输出:JSON 格式便于脚本集成和自动化处理
  3. 标签系统完善:支持多标签管理和按标签过滤
  4. 与 Drafts 生态深度整合:可直接调用 Drafts 强大的动作系统
  5. 文档清晰:命令示例丰富,常见工作流(快速捕获、每日日志)有明确指引

潜在缺点与局限性

  1. 平台极度受限:仅支持 macOS(依赖 AppleScript),Linux/Windows 完全不可用
  2. 应用依赖性强:Drafts 必须正在运行,命令才能执行;若应用无响应会导致命令挂起
  3. 付费门槛:需要 Drafts Pro 订阅才能使用自动化功能
  4. 外部工具依赖:Skill 本身仅为文档,实际功能依赖用户自行安装的 drafts CLI 工具
  5. 无原生错误处理:若 Drafts 未运行,命令会失败或挂起,需用户手动排查

适合人群

  • macOS 重度用户:已习惯使用 Drafts 作为主力笔记工具
  • 开发者/极客:希望在终端环境中快速记录,避免切换应用
  • 自动化爱好者:需要将笔记操作集成到 Shell 脚本或工作流中
  • 已有 Drafts Pro 订阅者:已解锁自动化功能,可充分利用 CLI 能力

常规风险

风险类型 说明 等级
平台锁定风险 更换操作系统后完全不可用 中
功能依赖风险 CLI 工具停止维护或 Drafts API 变更可能导致 Skill 失效 低
隐私风险 笔记内容通过 AppleScript 在本地传递,无云端传输,风险可控 低
剪贴板操作 文档包含复制到剪贴板的示例,属正常功能但需注意敏感内容 极低

安全认证结论:安全等级 A(95 分),纯文档无代码,无恶意模式,来源为个人开发者(T3),建议关注上游更新。

技能正文


name: drafts description: Manage Drafts app notes via CLI on macOS. Create, view, list, edit, append, prepend, and run actions on drafts. Use when a user asks to create a note, list drafts, search drafts, or manage their Drafts inbox. IMPORTANT - Drafts app must be running on macOS for this to work. homepage: https://github.com/nerveband/drafts metadata: {"clawdbot":{"emoji":"📋","os":["darwin"],"requires":{"bins":["drafts"]}}}

Drafts CLI

Manage Drafts notes from the terminal on macOS.

IMPORTANT REQUIREMENTS

This CLI ONLY works on macOS with Drafts app running.

  • macOS only - Uses AppleScript, will not work on Linux/Windows
  • Drafts must be RUNNING - The app must be open for any command to work
  • Drafts Pro required - Automation features require Pro subscription

If commands fail or hang, first check: open -a Drafts

Setup

Install via Go:

go install github.com/nerveband/drafts/cmd/drafts@latest

Or build from source:

git clone https://github.com/nerveband/drafts
cd drafts && go build ./cmd/drafts

Commands

Create a Draft

# Simple draft
drafts create "Meeting notes for Monday"

# With tags
drafts create "Shopping list" -t groceries -t todo

# Flagged draft
drafts create "Urgent reminder" -f

# Create in archive
drafts create "Reference note" -a

List Drafts

# List inbox (default)
drafts list

# List archived drafts
drafts list -f archive

# List trashed drafts
drafts list -f trash

# List all drafts
drafts list -f all

# Filter by tag
drafts list -t mytag

Get a Draft

# Get specific draft
drafts get <uuid>

# Get active draft (currently open in Drafts)
drafts get

Modify Drafts

# Prepend text
drafts prepend "New first line" -u <uuid>

# Append text
drafts append "Added at the end" -u <uuid>

# Replace entire content
drafts replace "Completely new content" -u <uuid>

Edit in Editor

drafts edit <uuid>

Run Actions

# Run action on text
drafts run "Copy" "Text to copy to clipboard"

# Run action on existing draft
drafts run "Copy" -u <uuid>

Get Schema

# Full schema for LLM integration
drafts schema

# Schema for specific command
drafts schema create

Output Format

JSON (default) - All commands return structured JSON:

{
  "success": true,
  "data": {
    "uuid": "ABC123",
    "content": "Note content",
    "title": "Note title",
    "tags": ["tag1", "tag2"],
    "folder": "inbox"
  }
}

Plain text - Human-readable output:

drafts list --plain

Common Workflows

Quick Capture

drafts create "Remember to call dentist tomorrow" -t reminder

Daily Journal

drafts append "$(date): Completed project review" -u <journal-uuid>

Search and Review

# List all drafts with a specific tag
drafts list -t work

# Get full content of a draft
drafts get <uuid>

Troubleshooting

Commands fail or return empty:

  1. Is Drafts running? → open -a Drafts
  2. Is Drafts Pro active? → Automation requires Pro
  3. Permissions granted? → System Settings > Privacy > Automation

Commands hang:

  • Check if Drafts is showing a dialog

Notes

  • macOS ONLY (AppleScript-based)
  • Drafts app MUST be running
  • Requires Drafts Pro subscription
  • All UUIDs are Drafts-generated identifiers
  • Tags are case-sensitive

Version

Latest (from go install)

正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。

标签

productivitydocsofficeautomation

同类 Skill