| name | hackmd-cli |
| description | Use HackMD CLI to create, read, update, delete, export, and automate personal notes and team notes from Cursor. |
HackMD CLI
Use this skill when a user wants to manage HackMD content programmatically from Cursor.
What This Skill Covers
- personal note workflows
- team note workflows
- authentication and setup
- export and sync workflows
- scripting-friendly output formats
Setup
Install
npm install -g @hackmd/hackmd-cli
Configure Access Token
Create an API token at hackmd.io/settings#api, then configure either:
hackmd-cli login
or:
export HMD_API_ACCESS_TOKEN=YOUR_TOKEN
For HackMD EE instances:
export HMD_API_ENDPOINT_URL=https://your.hackmd-ee.endpoint
Core Commands
Authentication
hackmd-cli login
hackmd-cli logout
hackmd-cli whoami
Use hackmd-cli whoami to confirm the CLI can reach HackMD with current credentials (interactive login or HMD_API_ACCESS_TOKEN). For scripts or agents, prefer hackmd-cli whoami --output=json. Other useful flags: -x (--extended), --columns=..., --filter=..., --sort=..., --no-header, --no-truncate (see hackmd-cli whoami --help).
Personal Notes
hackmd-cli notes
hackmd-cli notes --noteId=<id>
hackmd-cli notes create --content='# Title' --title='My Note'
cat README.md | hackmd-cli notes create
hackmd-cli notes create -e
hackmd-cli notes update --noteId=<id> --content='# Updated'
hackmd-cli notes delete --noteId=<id>
Team Notes
hackmd-cli team-notes --teamPath=<team-path>
hackmd-cli team-notes create --teamPath=<team-path> --content='# Team Doc'
hackmd-cli team-notes update --teamPath=<team-path> --noteId=<id> --content='# Updated'
hackmd-cli team-notes delete --teamPath=<team-path> --noteId=<id>
Teams, History, and Export
hackmd-cli teams
hackmd-cli history
hackmd-cli export --noteId=<id>
Output Options
Use these flags on list-style commands when scripting:
--output=json
--output=yaml
--output=csv
--no-header
--no-truncate
--columns=id,title
--filter=title=README
--sort=title
-x
Common Workflows
Sync a local file to HackMD
cat doc.md | hackmd-cli notes create --title="My Doc"
cat doc.md | hackmd-cli notes update --noteId=<id>
Export a note to a local file
hackmd-cli export --noteId=<id> > note.md
Script against note metadata
hackmd-cli notes --output=json | jq '.[] | .id'
Guidance
- Use
notes for personal notes.
- Use
team-notes only when a teamPath is known.
- Prefer environment variables or interactive login over hardcoding tokens.
- Keep examples free of real secrets.
Source
Adapted from the upstream HackMD CLI skill:
github.com/hackmdio/hackmd-cli