Skip to content

Libraries

A library is a folder of Markdown notes plus hidden PKM internals. It is the unit pkm indexes, searches, and writes into.

The global library is for personal, cross-project knowledge.

Default path:

~/PKM

Override it with:

Terminal window
PKM_GLOBAL_LIBRARY=/path/to/library pkm init --scope global

A project library lives at the git root of the current repository. Use it for repo-specific notes, decisions, data models, operational runbooks, tickets, and other local context.

Terminal window
pkm init --scope project

Commands that write notes default to:

  • project when run inside a git repository
  • global otherwise

Commands that read or discover notes can search all discovered libraries unless --scope narrows them.

PKM-owned files live under .pkm/:

.pkm/
├── types/
├── types.json
└── .index/pkm.db

Commit your Markdown and type definitions. Do not commit .pkm/.index/.