hacknote-0.3.1 is not a library.
hacknote-cli
A command-line interface for HackNote — create, read, update, and delete notes, manage projects and tags, and search across your team, all from the terminal.
Installation
From crates.io (recommended)
cargo install hacknote
From GitHub Releases
Download a prebuilt binary from the Releases page. Available for Linux (x86_64), macOS (x86_64, Apple Silicon), and Windows.
From source
git clone git@github.com:xinxiaotech/hacknote-cli.git
cd hacknote-cli
cargo build --release
cp target/release/hacknote ~/.cargo/bin/
Verify:
hacknote --version
Quick Start
1. Get an API Key
Log in to HackNote → Account Settings → API Tokens → create a new token.
2. Set your API key
hacknote config set-key <your-api-key>
3. Find your Team ID
hacknote teams list
┌──────────────────┬──────────┬────────┬─────────┐
│ ID │ Name │ Slug │ Role │
├──────────────────┼──────────┼────────┼─────────┤
│ 17c261f7d8fWbdml │ My Team │ myteam │ Owner │
└──────────────────┴──────────┴────────┴─────────┘
Finding IDs from the URL
HackNote URLs follow this pattern:
https://app.hacknote.co/@team/<teamId>/@project/<projectKey>/<noteKey>
Example:
https://app.hacknote.co/@team/17c261f7d8fWbdml/@project/19c4c1e9341x5h8i/19c4fdb4ff9WIBpm
^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^
teamId projectKey noteKey
Command Reference
config
hacknote config set-key <apiKey> hacknote config show
profile
hacknote profile hacknote profile --json
teams
hacknote teams list hacknote teams list --json hacknote teams get <teamId> hacknote teams get <teamId> --json hacknote teams create <name> hacknote teams create <name> --slug <slug> hacknote teams update <teamId> --name <n> hacknote teams update <teamId> --slug <s>
Team members
hacknote teams members <teamId> hacknote teams members <teamId> --json hacknote teams change-role <teamId> <userId> <role> hacknote teams remove-member <teamId> <userId>
Invitations
hacknote teams invite <teamId> hacknote teams invite <teamId> --new hacknote teams accept-invite <code>
projects
Project lists are read in real time over WebSocket.
hacknote projects list <teamId> hacknote projects list <teamId> --all hacknote projects list <teamId> --json hacknote projects create <teamId> <title>
notes
Listing, updating, and deleting notes use WebSocket. Creating notes and reading content use the REST API.
List notes
hacknote notes list <teamId> <projectKey>
hacknote notes list <teamId> <projectKey> --all hacknote notes list <teamId> <projectKey> --json hacknote notes ls-pub <projectKey> hacknote notes list-published <projectKey> --json hacknote notes list-published <projectKey> --all
Read note content
Fetches the latest content from version history:
hacknote notes get <teamId> <projectKey> <noteKey>
hacknote notes get <teamId> <projectKey> <noteKey> --raw
Use --raw with redirection to save to a file:
hacknote notes get <teamId> <projectKey> <noteKey> --raw > note.md
Create a note
hacknote notes create <teamId> <projectKey> --content "# Title\n\nBody text"
hacknote notes create <teamId> <projectKey> --file note.md
cat note.md | hacknote notes create <teamId> <projectKey>
hacknote notes create <teamId> <projectKey> --file note.md --folder <folderKey>
Update a note
hacknote notes update <teamId> <projectKey> <noteKey> --content "New content"
hacknote notes update <teamId> <projectKey> <noteKey> --file updated.md
cat updated.md | hacknote notes update <teamId> <projectKey> <noteKey>
Delete a note
hacknote notes delete <teamId> <projectKey> <noteKey>
hacknote notes delete <teamId> <projectKey> <noteKey> --yes
Publish / unpublish
hacknote notes publish <teamId> <projectKey> <noteKey> hacknote notes unpublish <teamId> <projectKey> <noteKey>
Version history
hacknote notes versions <teamId> <projectKey> <noteKey>
hacknote notes versions <teamId> <projectKey> <noteKey> --json
search
hacknote search <teamId> <query>
hacknote search <teamId> <query> --limit 50 hacknote search <teamId> <query> --json
folders
hacknote folders list <teamId> <projectKey> hacknote folders list <teamId> <projectKey> --json hacknote folders create <teamId> <projectKey> <name> hacknote folders rename <teamId> <projectKey> <folderKey> <newName> hacknote folders delete <teamId> <projectKey> <folderKey>
tags
hacknote tags list <teamId> <projectKey> <noteKey> hacknote tags list <teamId> <projectKey> <noteKey> --json hacknote tags ls-team <teamId> hacknote tags list-team <teamId> --json hacknote tags add <teamId> <projectKey> <noteKey> <tag> hacknote tags remove <teamId> <projectKey> <noteKey> <tag>
export
hacknote export notes <teamId> <projectKey> hacknote export notes <teamId> <projectKey> -o notes.json hacknote export project <teamId> <projectKey> hacknote export published <teamId> <projectKey> hacknote export team <teamId> hacknote export team <teamId> -o backup.json hacknote export pdf <teamId> <projectKey> hacknote export latex <teamId> <projectKey>
JSON Output
All list and get commands support --json for machine-readable output, useful for scripting and piping:
hacknote teams list --json | jq '.[].name'
NOTE=$(hacknote notes list <teamId> <projectKey> --json | jq -r '.[0].key')
hacknote notes get <teamId> <projectKey> "$NOTE" --raw > latest.md
Command Aliases
| Full Command |
Alias |
notes list |
notes ls |
notes list-published |
notes ls-pub |
projects list |
projects ls |
teams list |
teams ls |
folders list |
folders ls |
tags list |
tags ls |
tags list-team |
tags ls-team |
tags remove |
tags rm |
Updating
cargo install hacknote