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: localknowledge store at .pk/ (default)
mode: globalknowledge store at ~/.pk/<name>/ — note: global mode writes to ~/.pk/config.json instead
gitignoreyes — .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.

currentProjectName of the active global project. Fallback for requireKnowledgeDir().
example
${
$ "currentProject": "journal"
$}

Resolution order

requireKnowledgeDir() resolves the knowledge directory in this order:

1 PK_KNOWLEDGE_DIR env var
2 .pk/config.json found by walking up from CWD
3 currentProject in ~/.pk/config.json
4 Error

Embedding config

Embeddings are optional but strongly recommended — without them, search only matches exact keywords. See Embeddings for why that matters.

embedding
$pk config --embedding nomic-embed-text
$pk config --no-embedding
$pk config --base-url http://localhost:11434

When to rebuild

After changing embedding settings, rebuild the index so existing notes get the new vectors.

rebuild
$pk index