360 Secure SkillHub
360 安全技能中心

HackMD

基于 HackMD 命令行工具读取、创建、更新、删除个人与团队 Markdown 笔记;附带 Node 脚本记录笔记最后修改时间,检测自上次检查后是否发生变化,支持单篇或全部检查、列表、移除与重置,状态存于本地目录。需要访问令牌并联网。

nulltea
nulltea
热度 69.95
最近更新 2026-05-11 15:54:46
分类:知识依赖:代码执行 / 第三方 API / 读写文件应用场景:笔记整理 / 工作流 / 自动化脚本

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add hackmd
Metadata
name
hackmd
description
Work with HackMD documents. Use when reading, creating, updating, or deleting notes on HackMD. Supports change tracking to detect document modifications since last check. Supports personal and team workspaces.
metadata
{"clawdbot":{"emoji":"📜","requires":{"bins":["hackmd-cli"],"env":["HMD_API_ACCESS_TOKEN"]},"primaryEnv":"HMD_API_ACCESS_TOKEN"}}

HackMD Integration

Requirements

npm install -g @hackmd/hackmd-cli

Quick Reference

Read Notes

# List all personal notes
hackmd-cli notes

# Get note metadata (includes lastChangedAt)
hackmd-cli notes --noteId=<id> --output json

# Get note content (markdown)
hackmd-cli export --noteId=<id>

# List teams
hackmd-cli teams

# List team notes
hackmd-cli team-notes --teamPath=<path>

Write Notes

# Create note
hackmd-cli notes create --content='# Title'

# Create from file
cat file.md | hackmd-cli notes create

# Update note
hackmd-cli notes update --noteId=<id> --content='# Updated'

# Delete note
hackmd-cli notes delete --noteId=<id>

Team Notes

hackmd-cli team-notes create --teamPath=<path> --content='# Team Note'
hackmd-cli team-notes update --teamPath=<path> --noteId=<id> --content='...'
hackmd-cli team-notes delete --teamPath=<path> --noteId=<id>

Change Tracking

Use hackmd-track.js (in scripts/) to detect document changes efficiently.

Track a Note

node scripts/hackmd-track.js add <noteId>

Check for Changes

# Single note - outputs content only if changed
node scripts/hackmd-track.js changes <noteId>

# All tracked notes
node scripts/hackmd-track.js changes --all

# JSON output for parsing
node scripts/hackmd-track.js changes <noteId> --json

Manage Tracking

node scripts/hackmd-track.js list              # Show tracked notes
node scripts/hackmd-track.js remove <noteId>   # Stop tracking
node scripts/hackmd-track.js reset <noteId>    # Reset (next check shows as changed)

How It Works

  1. hackmd-track.js add stores note's lastChangedAt timestamp
  2. hackmd-track.js changes compares current lastChangedAt with stored value
  3. If changed: outputs content and updates stored timestamp
  4. If unchanged: outputs nothing (use --verbose for status)

State stored in ./.hackmd/tracked-notes.json (current working directory)

Note Metadata Fields

When using --output json, notes include:

Field Description
lastChangedAt Unix timestamp of last modification
lastChangeUser {name, userPath, photo} of last editor
titleUpdatedAt When title changed
tagsUpdatedAt When tags changed

Rate Limits

  • 100 calls per 5 minutes
  • 2000 calls/month (10k on Prime plan)