@codehourra/llm-iwiki 0.2.2 → 0.3.1
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.
- package/README.md +117 -48
- package/README.zh-CN.md +146 -0
- package/dist/index.js +276 -197
- package/docs/roadmap.md +25 -0
- package/docs/roadmap.zh-CN.md +25 -0
- package/package.json +10 -2
package/README.md
CHANGED
|
@@ -1,77 +1,146 @@
|
|
|
1
1
|
# llm-iwiki
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[简体中文](./README.zh-CN.md)
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
[](https://www.npmjs.com/package/@codehourra/llm-iwiki)
|
|
6
|
+
[](https://www.npmjs.com/package/@codehourra/llm-iwiki)
|
|
7
|
+
[](https://www.npmjs.com/package/@codehourra/llm-iwiki)
|
|
8
|
+
[](https://github.com/CodeHourra/llm-iwiki/actions/workflows/release.yml)
|
|
9
|
+
[](./LICENSE)
|
|
10
|
+
[](./CHANGELOG.md)
|
|
6
11
|
|
|
7
|
-
|
|
12
|
+
Turn local AI coding sessions into a searchable Obsidian knowledge base.
|
|
8
13
|
|
|
9
|
-
|
|
14
|
+
`llm-iwiki` collects sessions from Claude Code, Cursor, Codex, Gemini, and CodeBuddy, normalizes them by project in SQLite, prepares AI-friendly summarization tasks, stores accepted project learnings, and exports navigable Markdown notes to Obsidian.
|
|
15
|
+
|
|
16
|
+
## Features
|
|
17
|
+
|
|
18
|
+
- Collect local AI coding sessions across multiple tools.
|
|
19
|
+
- Resolve sessions by project, repository, path, or slug.
|
|
20
|
+
- Generate summarization and experience-extraction task files for AI assistants.
|
|
21
|
+
- Review and accept reusable engineering experiences before publishing them.
|
|
22
|
+
- Export project summaries, session notes, and project-scoped experiences to Obsidian.
|
|
23
|
+
- Preserve user-written note sections while updating managed content blocks.
|
|
24
|
+
- Search session summaries and accepted experiences from the CLI.
|
|
25
|
+
|
|
26
|
+
## Requirements
|
|
27
|
+
|
|
28
|
+
- Node.js 20 or newer at runtime.
|
|
29
|
+
- Bun for local development, testing, and building.
|
|
30
|
+
|
|
31
|
+
SQLite is provided by `better-sqlite3`; prebuilt binaries are installed automatically by npm where available.
|
|
32
|
+
|
|
33
|
+
## Installation
|
|
10
34
|
|
|
11
35
|
```bash
|
|
12
|
-
# 全局安装
|
|
13
36
|
npm install -g @codehourra/llm-iwiki
|
|
14
|
-
|
|
15
|
-
llm-iwiki init # 初始化配置与状态库
|
|
16
|
-
llm-iwiki doctor # 自检
|
|
17
37
|
```
|
|
18
38
|
|
|
19
|
-
|
|
39
|
+
You can also run it without installing globally:
|
|
20
40
|
|
|
21
41
|
```bash
|
|
22
|
-
npx @codehourra/llm-iwiki
|
|
23
|
-
npx @codehourra/llm-iwiki sync
|
|
42
|
+
npx @codehourra/llm-iwiki --help
|
|
24
43
|
```
|
|
25
44
|
|
|
26
|
-
##
|
|
45
|
+
## Quick Start
|
|
27
46
|
|
|
28
|
-
|
|
29
|
-
-
|
|
30
|
-
-
|
|
31
|
-
-
|
|
32
|
-
-
|
|
33
|
-
|
|
47
|
+
```bash
|
|
48
|
+
llm-iwiki init
|
|
49
|
+
llm-iwiki sync
|
|
50
|
+
llm-iwiki projects list
|
|
51
|
+
llm-iwiki projects inspect .
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Configure an Obsidian vault and export notes:
|
|
34
55
|
|
|
35
56
|
```bash
|
|
36
|
-
llm-iwiki
|
|
37
|
-
llm-iwiki
|
|
38
|
-
llm-iwiki
|
|
39
|
-
llm-iwiki summarize prepare changed --project . # 生成会话总结任务
|
|
40
|
-
llm-iwiki summarize apply --project . --file summaries.yaml
|
|
57
|
+
llm-iwiki config set obsidian.vault ~/Obsidian/Vault
|
|
58
|
+
llm-iwiki summarize prepare changed --project .
|
|
59
|
+
llm-iwiki summarize apply --project . --file .llm-iwiki/exchange/summaries.yaml
|
|
41
60
|
llm-iwiki experiences prepare --project . --from changed-summaries
|
|
42
|
-
llm-iwiki experiences propose --project . --file experiences.yaml
|
|
43
|
-
llm-iwiki experiences candidates --project .
|
|
44
|
-
llm-iwiki experiences accept <candidate-id>
|
|
45
|
-
llm-iwiki
|
|
46
|
-
llm-iwiki obsidian export --project . # 导出为 Markdown 笔记
|
|
47
|
-
llm-iwiki obsidian check # 检查笔记是否漂移
|
|
48
|
-
llm-iwiki skills init # 写入 AI 助手 skill 模板
|
|
61
|
+
llm-iwiki experiences propose --project . --file .llm-iwiki/exchange/experiences.yaml
|
|
62
|
+
llm-iwiki experiences candidates --project .
|
|
63
|
+
llm-iwiki experiences accept <candidate-id>
|
|
64
|
+
llm-iwiki obsidian export --project .
|
|
49
65
|
```
|
|
50
66
|
|
|
51
|
-
|
|
67
|
+
The `prepare` commands generate task files for an AI assistant. Write the corresponding YAML files from those task files, then apply/propose them with the commands above.
|
|
52
68
|
|
|
53
|
-
|
|
69
|
+
## Common Commands
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
llm-iwiki sync [--project <path>]
|
|
73
|
+
llm-iwiki projects list
|
|
74
|
+
llm-iwiki projects inspect <project>
|
|
75
|
+
llm-iwiki projects dedupe
|
|
76
|
+
llm-iwiki sessions list --project <project>
|
|
77
|
+
llm-iwiki sessions read <session-id>
|
|
78
|
+
llm-iwiki summarize prepare [changed|all] --project <project>
|
|
79
|
+
llm-iwiki summarize apply --project <project> --file <summaries.yaml>
|
|
80
|
+
llm-iwiki experiences prepare --project <project> [--since 30d]
|
|
81
|
+
llm-iwiki experiences propose --project <project> --file <experiences.yaml>
|
|
82
|
+
llm-iwiki experiences accept <candidate-id>
|
|
83
|
+
llm-iwiki search <sessions|experiences> <query>
|
|
84
|
+
llm-iwiki obsidian export [--project <project>|--all]
|
|
85
|
+
llm-iwiki obsidian check
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
`<project>` can be a local path, a `proj_xxx` id, a display name, or a slug. If multiple projects match, use `projects list` to pick the exact project id.
|
|
89
|
+
|
|
90
|
+
## Obsidian Output
|
|
91
|
+
|
|
92
|
+
Exports are written under `LLM-iWiki/` in your configured vault:
|
|
93
|
+
|
|
94
|
+
```text
|
|
95
|
+
LLM-iWiki/
|
|
96
|
+
├── README.md
|
|
97
|
+
├── Projects/
|
|
98
|
+
│ └── <project-slug>/
|
|
99
|
+
│ ├── Project Summary.md
|
|
100
|
+
│ ├── sessions/
|
|
101
|
+
│ └── experiences/
|
|
102
|
+
└── Topics/
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Generated notes use frontmatter plus an `aiwiki:managed` block. You can write your own notes outside the managed block; re-exporting preserves those sections unless `--force` is used.
|
|
106
|
+
|
|
107
|
+
## AI Assistant Skill
|
|
108
|
+
|
|
109
|
+
Install the bundled `aiwiki-knowledge` skill into the current project:
|
|
54
110
|
|
|
55
111
|
```bash
|
|
56
|
-
llm-iwiki skills # 列出可用 target 与将写入的 skill(等同 skills list)
|
|
57
112
|
llm-iwiki skills init [--target codex|claude-code|cursor] [--force] [--dry-run]
|
|
58
113
|
```
|
|
59
114
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
115
|
+
The skill teaches compatible assistants how to run the `sync -> summarize -> experiences -> export` workflow and how to produce valid YAML for `summarize apply` and `experiences propose`.
|
|
116
|
+
|
|
117
|
+
## Development
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
bun install
|
|
121
|
+
bun run typecheck
|
|
122
|
+
bun test
|
|
123
|
+
bun run build
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
This project uses Changesets for versioning, changelog generation, and npm publishing:
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
bun run changeset
|
|
130
|
+
bun run version-packages
|
|
131
|
+
bun run release
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
User-facing changes should include a `.changeset/*.md` file. GitHub Actions creates the release PR and publishes to npm after the release PR is merged.
|
|
135
|
+
|
|
136
|
+
## Changelog
|
|
137
|
+
|
|
138
|
+
See [CHANGELOG.md](./CHANGELOG.md).
|
|
139
|
+
|
|
140
|
+
## Roadmap
|
|
64
141
|
|
|
65
|
-
|
|
142
|
+
See [docs/roadmap.md](./docs/roadmap.md).
|
|
66
143
|
|
|
67
|
-
|
|
144
|
+
## License
|
|
68
145
|
|
|
69
|
-
|
|
70
|
-
| --- | --- | --- | --- |
|
|
71
|
-
| 经验融合 | `experiences merge <candidate-id> <experience-id>` | 人工确认后把候选正文融合进已有经验,先生成 `merge-preview-*.md` 预览,确认后改写 managed block,合并 `source_sessions` / `evidence`,保留用户手写区 | 待开发 |
|
|
72
|
-
| 项目目录迁移 | `obsidian move-project <project-id>` | `projects rename` 后按 `obsidian_notes` 映射与 frontmatter 中的 `aiwiki_project_id` 迁移 vault 目录,目标已存在时先做冲突检查 | 待开发 |
|
|
73
|
-
| 结构化检索 | `search [sessions\|experiences] <query>` | SQLite FTS5 为主检索(projects / sessions / messages / summaries / experiences),可选 ripgrep 检索已导出 Markdown,`--index sqlite\|obsidian\|all` 切换 | 待开发 |
|
|
74
|
-
| 打开笔记 | `obsidian open <note-id>` | 在 Obsidian 中直接打开对应笔记 | 待开发 |
|
|
75
|
-
| 路径冲突批处理 | `obsidian export --overwrite-conflicts \| --skip-conflicts` | 目录迁移 / 导出时对路径冲突批量选择,跳过的标记 `conflict_status=path_conflict` 供 `obsidian check` 持续报告 | 待开发 |
|
|
76
|
-
| 增量范围导出 | `obsidian export --changed \| --all` | 按变更范围而非单项目导出 | 待开发 |
|
|
77
|
-
| 时间窗筛选 | `experiences prepare --since 30d` | 经验提炼任务按时间窗口限定来源摘要 | 待开发 |
|
|
146
|
+
[MIT](./LICENSE)
|
package/README.zh-CN.md
ADDED
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
# llm-iwiki
|
|
2
|
+
|
|
3
|
+
[English](./README.md)
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@codehourra/llm-iwiki)
|
|
6
|
+
[](https://www.npmjs.com/package/@codehourra/llm-iwiki)
|
|
7
|
+
[](https://www.npmjs.com/package/@codehourra/llm-iwiki)
|
|
8
|
+
[](https://github.com/CodeHourra/llm-iwiki/actions/workflows/release.yml)
|
|
9
|
+
[](./LICENSE)
|
|
10
|
+
[](./CHANGELOG.md)
|
|
11
|
+
|
|
12
|
+
把本地 AI 编程会话沉淀为可检索的 Obsidian 知识库。
|
|
13
|
+
|
|
14
|
+
`llm-iwiki` 会采集 Claude Code、Cursor、Codex、Gemini 和 CodeBuddy 的本地会话记录,按项目归一化到 SQLite,生成适合 AI 助手处理的总结任务,保存经过确认的项目经验,并导出为可导航的 Obsidian Markdown 笔记。
|
|
15
|
+
|
|
16
|
+
## 功能特性
|
|
17
|
+
|
|
18
|
+
- 采集多个 AI 编程工具的本地会话记录。
|
|
19
|
+
- 按项目、仓库、路径或 slug 解析和归类会话。
|
|
20
|
+
- 为 AI 助手生成会话总结和经验提取任务文件。
|
|
21
|
+
- 在发布到知识库前审核并采纳可复用的工程经验。
|
|
22
|
+
- 导出项目摘要、会话笔记和项目经验到 Obsidian。
|
|
23
|
+
- 更新托管内容块时保留用户手写区域。
|
|
24
|
+
- 通过 CLI 检索会话摘要和已采纳经验。
|
|
25
|
+
|
|
26
|
+
## 环境要求
|
|
27
|
+
|
|
28
|
+
- 运行时需要 Node.js 20 或更高版本。
|
|
29
|
+
- 本地开发、测试和构建需要 Bun。
|
|
30
|
+
|
|
31
|
+
SQLite 由 `better-sqlite3` 提供;npm 安装时会自动下载可用的预编译二进制。
|
|
32
|
+
|
|
33
|
+
## 安装
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
npm install -g @codehourra/llm-iwiki
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
也可以不全局安装,直接使用 `npx`:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
npx @codehourra/llm-iwiki --help
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## 快速开始
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
llm-iwiki init
|
|
49
|
+
llm-iwiki sync
|
|
50
|
+
llm-iwiki projects list
|
|
51
|
+
llm-iwiki projects inspect .
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
配置 Obsidian 库并导出笔记:
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
llm-iwiki config set obsidian.vault ~/Obsidian/Vault
|
|
58
|
+
llm-iwiki summarize prepare changed --project .
|
|
59
|
+
llm-iwiki summarize apply --project . --file .llm-iwiki/exchange/summaries.yaml
|
|
60
|
+
llm-iwiki experiences prepare --project . --from changed-summaries
|
|
61
|
+
llm-iwiki experiences propose --project . --file .llm-iwiki/exchange/experiences.yaml
|
|
62
|
+
llm-iwiki experiences candidates --project .
|
|
63
|
+
llm-iwiki experiences accept <candidate-id>
|
|
64
|
+
llm-iwiki obsidian export --project .
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
`prepare` 命令会生成供 AI 助手阅读的任务文件。根据任务文件编写对应 YAML 后,再用上面的 `apply` / `propose` 命令落库。
|
|
68
|
+
|
|
69
|
+
## 常用命令
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
llm-iwiki sync [--project <path>]
|
|
73
|
+
llm-iwiki projects list
|
|
74
|
+
llm-iwiki projects inspect <project>
|
|
75
|
+
llm-iwiki projects dedupe
|
|
76
|
+
llm-iwiki sessions list --project <project>
|
|
77
|
+
llm-iwiki sessions read <session-id>
|
|
78
|
+
llm-iwiki summarize prepare [changed|all] --project <project>
|
|
79
|
+
llm-iwiki summarize apply --project <project> --file <summaries.yaml>
|
|
80
|
+
llm-iwiki experiences prepare --project <project> [--since 30d]
|
|
81
|
+
llm-iwiki experiences propose --project <project> --file <experiences.yaml>
|
|
82
|
+
llm-iwiki experiences accept <candidate-id>
|
|
83
|
+
llm-iwiki search <sessions|experiences> <query>
|
|
84
|
+
llm-iwiki obsidian export [--project <project>|--all]
|
|
85
|
+
llm-iwiki obsidian check
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
`<project>` 可以是本地路径、`proj_xxx` 项目 id、展示名或 slug。如果匹配到多个项目,请先用 `projects list` 找到准确的项目 id。
|
|
89
|
+
|
|
90
|
+
## Obsidian 输出结构
|
|
91
|
+
|
|
92
|
+
导出内容会写入已配置 vault 下的 `LLM-iWiki/` 目录:
|
|
93
|
+
|
|
94
|
+
```text
|
|
95
|
+
LLM-iWiki/
|
|
96
|
+
├── README.md
|
|
97
|
+
├── Projects/
|
|
98
|
+
│ └── <project-slug>/
|
|
99
|
+
│ ├── Project Summary.md
|
|
100
|
+
│ ├── sessions/
|
|
101
|
+
│ └── experiences/
|
|
102
|
+
└── Topics/
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
生成的笔记包含 frontmatter 和 `aiwiki:managed` 托管内容块。你可以在托管块之外自由补充内容;重新导出时会保留这些手写内容,除非显式使用 `--force`。
|
|
106
|
+
|
|
107
|
+
## AI 助手 Skill
|
|
108
|
+
|
|
109
|
+
将内置的 `aiwiki-knowledge` skill 安装到当前项目:
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
llm-iwiki skills init [--target codex|claude-code|cursor] [--force] [--dry-run]
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
这个 skill 会教兼容的 AI 助手如何执行 `sync -> summarize -> experiences -> export` 流程,以及如何为 `summarize apply` 和 `experiences propose` 生成合法 YAML。
|
|
116
|
+
|
|
117
|
+
## 开发
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
bun install
|
|
121
|
+
bun run typecheck
|
|
122
|
+
bun test
|
|
123
|
+
bun run build
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
项目使用 Changesets 管理版本号、变更记录和 npm 发布:
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
bun run changeset
|
|
130
|
+
bun run version-packages
|
|
131
|
+
bun run release
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
面向用户的变更应包含一个 `.changeset/*.md` 文件。GitHub Actions 会创建发布 PR,并在发布 PR 合并后发布到 npm。
|
|
135
|
+
|
|
136
|
+
## 变更记录
|
|
137
|
+
|
|
138
|
+
见 [CHANGELOG.md](./CHANGELOG.md)。
|
|
139
|
+
|
|
140
|
+
## 路线图
|
|
141
|
+
|
|
142
|
+
见 [docs/roadmap.zh-CN.md](./docs/roadmap.zh-CN.md)。
|
|
143
|
+
|
|
144
|
+
## 许可证
|
|
145
|
+
|
|
146
|
+
[MIT](./LICENSE)
|