| 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
hackmd-cli notes
hackmd-cli notes --noteId=<id> --output json
hackmd-cli export --noteId=<id>
hackmd-cli teams
hackmd-cli team-notes --teamPath=<path>
Write Notes
hackmd-cli notes create --content='# Title'
cat file.md | hackmd-cli notes create
hackmd-cli notes update --noteId=<id> --content='# Updated'
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
node scripts/hackmd-track.js changes <noteId>
node scripts/hackmd-track.js changes --all
node scripts/hackmd-track.js changes <noteId> --json
Manage Tracking
node scripts/hackmd-track.js list
node scripts/hackmd-track.js remove <noteId>
node scripts/hackmd-track.js reset <noteId>
How It Works
hackmd-track.js add stores note's lastChangedAt timestamp
hackmd-track.js changes compares current lastChangedAt with stored value
- If changed: outputs content and updates stored timestamp
- 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)