Config
Project and global configuration for pk.
Project config — .pk/config.json
pk init writes .pk/config.json to your project root. pk commands
find the knowledge directory by walking up from the current directory — no environment
variables needed. .pk/ is automatically added to your .gitignore.
| location | <project-root>/.pk/config.json |
| mode: local | knowledge store at .pk/ (default) |
| mode: global | knowledge store at ~/.pk/<name>/ — note: global mode writes to ~/.pk/config.json instead |
| gitignore | yes — .pk/ added automatically |
To switch projects temporarily, set PK_KNOWLEDGE_DIR in your shell.
The env var takes precedence over all other resolution. For persistent switching,
use pk use <name>.
Global config — ~/.pk/config.json
~/.pk/config.json stores machine-wide pk settings. pk init --global writes currentProject here. pk use changes it.
| currentProject | Name of the active global project. Fallback for requireKnowledgeDir(). |
Resolution order
requireKnowledgeDir() resolves the knowledge directory in this order:
PK_KNOWLEDGE_DIR env var.pk/config.json found by walking up from CWDcurrentProject in ~/.pk/config.jsonEmbedding config
Embeddings are optional but strongly recommended — without them, search only matches exact keywords. See Embeddings for why that matters.
When to rebuild
After changing embedding settings, rebuild the index so existing notes get the new vectors.