@supercakex/davnote
v0.1.1
Published
Send explicitly selected Markdown notes to configured WebDAV storage.
Readme
davnote
将明确指定的 Markdown 笔记上传到 WebDAV,并提供适合 AI Agent 调用的稳定命令行接口。
davnote push "/path/to/note.md"要求
- Node.js 20 或更高版本
- 支持 HTTPS 和 Basic Auth 的 WebDAV 服务
安装
从 npm 全局安装:
npm install -g @supercakex/davnote确认安装:
davnote --version
davnote --help在本仓库中开发时:
npm install
npm link首次配置
在用户自己的交互式终端中运行:
davnote setup程序会询问:
- Profile 名称,例如
personal - WebDAV HTTPS 地址
- 用户名和密码
- Remote root,即远程保存目录,例如
/Notes/Inbox - 是否允许覆盖远程同名文件,默认不允许
配置完成后会测试连接,并在需要时创建 Remote root。
密码保存在 davnote 自己的配置文件中。配置和凭证不会出现在 skill、JSON 输出或普通日志中。
上传笔记
上传一个文件:
davnote push "/absolute/path/note.md"上传多个明确指定的文件:
davnote push "/path/one.md" "/path/two.md"默认使用本地文件名并保存到 Remote root:
本地:/Users/alice/Notes/project.md
远程:/Notes/Inbox/project.md只允许上传普通 .md 文件,默认最大文件大小为 20 MiB。不支持目录递归、附件解析、同步或远程删除。
指定远程文件名
发送时可以直接使用另一个远程文件名,不会修改本地文件:
davnote push "/path/meeting.md" --remote-name "meeting-2026-06-13.md"--remote-name 一次只能用于一个文件。
同名文件与覆盖
远程已经存在同名文件时,默认返回 REMOTE_FILE_EXISTS,不会自动覆盖。可以改名后重新上传:
davnote push "/path/note.md" --remote-name "note-2.md"只有 setup 或权限配置明确允许覆盖后,才能执行:
davnote push "/path/note.md" --conflict overwrite修改覆盖权限必须在交互式终端中运行:
davnote config permissions即使配置允许覆盖,AI Agent 也应先获得用户对当前文件的明确授权。
Agent 调用参数
推荐 Agent 使用:
davnote push "/absolute/path/note.md" --json --non-interactive--json:输出结构化 JSON,便于可靠读取结果、错误码和远程路径。--non-interactive:声明本次调用不得询问或等待用户输入。--dry-run:执行验证和路径计算,但不上传文件。--profile <name>:使用指定的 WebDAV Profile。
安装 Agent Skill
输出给 Agent 阅读的 Skill 安装提示:
davnote skill将完整输出交给 Agent,Agent 会根据自己的平台规范创建 push-notes Skill。CLI 不会自行检测或修改 Agent 的 Skill 目录。
只输出 SKILL.md 正文:
davnote skill --rawProfile 管理
davnote profile list
davnote profile show [name]
davnote profile add <name>
davnote profile edit [name]
davnote profile credentials [name]
davnote profile test [name]
davnote profile default <name>
davnote profile remove <name>修改 Profile、凭证、默认 Profile 和删除 Profile 都要求交互式终端。show 不会显示密码。
配置与诊断
查看当前配置文件位置:
davnote config path默认路径:
| 系统 | 路径 |
| --- | --- |
| macOS | ~/Library/Application Support/davnote/config.toml |
| Linux | $XDG_CONFIG_HOME/davnote/config.toml,默认 ~/.config/davnote/config.toml |
| Windows | %AppData%\davnote\config.toml |
查看脱敏后的配置:
davnote config show
davnote config show --json检查配置权限、Profile 和 WebDAV 连接:
davnote doctor
davnote doctor --json在 macOS 和 Linux 上,配置文件会设置为仅当前用户可读写的 0600 权限。Windows 使用用户目录及系统 ACL。
从旧版 note-send 升级时,如果新的配置不存在,davnote 会读取旧配置并自动复制到新的 davnote 配置目录。
命令概览
davnote setup
davnote push
davnote profile
davnote config
davnote skill
davnote doctor
davnote version完整帮助:
davnote --help开发
项目没有运行时第三方依赖。
npm test
npm run check
npm pack --dry-run