@justestif/pk 0.3.2 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. package/README.md +60 -32
  2. package/dist/index.js +26031 -12390
  3. package/package.json +22 -2
  4. package/skill/SKILL.md +22 -7
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@justestif/pk",
3
3
  "type": "module",
4
- "version": "0.3.2",
4
+ "version": "0.4.0",
5
5
  "description": "Project knowledge — structured intake, search, and recall",
6
6
  "bin": {
7
7
  "pk": "dist/index.js"
@@ -15,21 +15,41 @@
15
15
  "build": "bun build src/index.ts --outfile dist/index.js --target bun && printf '#!/usr/bin/env bun\n' | cat - dist/index.js > dist/tmp.js && mv dist/tmp.js dist/index.js && chmod +x dist/index.js",
16
16
  "check": "bun run typecheck && bun run lint && bun test",
17
17
  "typecheck": "bunx tsc --noEmit",
18
- "lint": "xo",
18
+ "lint": "xo src",
19
19
  "test": "bun test",
20
20
  "prepublishOnly": "bun run build"
21
21
  },
22
22
  "dependencies": {
23
23
  "@clack/prompts": "^1.3.0",
24
+ "ai": "^6.0.177",
24
25
  "commander": "^14.0.0",
25
26
  "gray-matter": "^4.0.3",
26
27
  "markdownlint": "^0.40.0",
28
+ "ollama-ai-provider-v2": "^3.5.0",
27
29
  "zod": "^4"
28
30
  },
29
31
  "repository": {
30
32
  "type": "git",
31
33
  "url": "git+https://github.com/justEstif/pk.git"
32
34
  },
35
+ "xo": {
36
+ "ignores": [
37
+ "site/**",
38
+ "docs/**"
39
+ ],
40
+ "rules": {
41
+ "@stylistic/curly-newline": "off",
42
+ "@typescript-eslint/naming-convention": "off",
43
+ "@typescript-eslint/no-restricted-types": "off",
44
+ "@typescript-eslint/no-unsafe-type-assertion": "off",
45
+ "n/prefer-global/process": "off",
46
+ "unicorn/no-array-callback-reference": "off",
47
+ "unicorn/no-array-reduce": "off",
48
+ "unicorn/no-null": "off",
49
+ "unicorn/no-process-exit": "off",
50
+ "unicorn/prevent-abbreviations": "off"
51
+ }
52
+ },
33
53
  "devDependencies": {
34
54
  "@types/bun": "latest",
35
55
  "fallow": "^2.67.0",
package/skill/SKILL.md CHANGED
@@ -7,7 +7,7 @@ description: "Load when maintaining project knowledge, capturing decisions or qu
7
7
 
8
8
  Structured project knowledge — intake, search, recall, and audit.
9
9
 
10
- Use the `pk` CLI for all knowledge operations. Every command supports `--json` for machine-readable output. Never read or write knowledge files directly — always go through `pk`.
10
+ Use the `pk` CLI for all knowledge operations. Every command outputs JSON by default. Use `--pretty` for human-readable output. Never read or write knowledge files directly — always go through `pk`.
11
11
 
12
12
  ## Commands
13
13
 
@@ -27,10 +27,13 @@ Returns formatted markdown with title, type, status, tags, and an excerpt per no
27
27
  pk search "database schema"
28
28
  pk search "api" --type question --status open
29
29
  pk search "deploy" --tag infra --limit 5
30
+ pk search "slow queries" --semantic # vector similarity (requires embeddings)
30
31
  ```
31
32
 
32
33
  Returns path, type, status, title, tags, and snippet per match. Always search before creating — duplicates erode trust faster than gaps do.
33
34
 
35
+ Use `--semantic` when keyword search misses the intent — e.g. searching "latency issues" should find a note titled "slow database queries". Requires Ollama configured via `pk config --embedding <model>`.
36
+
34
37
  ### `pk read` — full note body
35
38
 
36
39
  ```bash
@@ -51,6 +54,7 @@ pk new source "Meeting notes 2024-06-01"
51
54
  Prints the absolute path. Frontmatter (id, dates, status, tags) is generated automatically — don't edit frontmatter after creation. After receiving the path: `pk read` to see the skeleton, then edit the file to fill in the required sections.
52
55
 
53
56
  **Required sections by type:**
57
+
54
58
  - `note` → `## Summary`, `## Details`, `## Evidence`, `## Related`
55
59
  - `decision` → `## Decision`, `## Context`, `## Rationale`, `## Consequences`, `## Related`
56
60
  - `question` → `## Question`, `## Why It Matters`, `## Current Understanding`, `## Resolution`
@@ -80,10 +84,10 @@ pk history --filter-operation update # only updates
80
84
  ### `pk delete` — delete a note
81
85
 
82
86
  ```bash
83
- pk delete /abs/path/to/note.md --yes
87
+ pk delete /abs/path/to/note.md
84
88
  ```
85
89
 
86
- Deletes and commits. `--yes` skips confirmation (required in non-interactive mode).
90
+ Deletes and commits. The command is non-interactive and outputs JSON by default.
87
91
 
88
92
  ### `pk vocab` — list tags by frequency
89
93
 
@@ -91,15 +95,26 @@ Deletes and commits. `--yes` skips confirmation (required in non-interactive mod
91
95
  pk vocab
92
96
  ```
93
97
 
94
- Useful for orienting before searching.
98
+ Useful for orienting before searching. Requires the search index.
99
+
100
+ ### `pk index` — rebuild search indexes
101
+
102
+ ```bash
103
+ pk index
104
+ ```
105
+
106
+ Run after creating or editing notes. Rebuilds `~/.pk/<name>/.index.db` and `~/.pk/<name>/indexes/`. If embeddings are configured (`pk config --embedding <model>`), also generates vectors for semantic search.
95
107
 
96
- ### `pk edit` — edit a note in $EDITOR
108
+ ### `pk config` — show or update configuration
97
109
 
98
110
  ```bash
99
- pk edit /abs/path/to/note.md
111
+ pk config # show current config
112
+ pk config --embedding nomic-embed-text # enable Ollama embeddings
113
+ pk config --no-embedding # disable embeddings
114
+ pk config --base-url http://my-ollama:11434 # custom Ollama endpoint
100
115
  ```
101
116
 
102
- Opens the note in `$EDITOR`, validates after save, commits changes. For agents: use `pk read` + file edit + `pk lint` instead.
117
+ Config lives at `~/.pk/config.json`.
103
118
 
104
119
  ### Status transitions
105
120