llm-wiki-kit 0.1.3 → 0.1.5
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/docs/troubleshooting.md +26 -0
- package/package.json +1 -1
- package/src/cli.js +14 -0
- package/src/doctor.js +2 -0
- package/src/install.js +26 -0
package/docs/troubleshooting.md
CHANGED
|
@@ -71,6 +71,32 @@ sudo npm install -g llm-wiki-kit@latest
|
|
|
71
71
|
|
|
72
72
|
If the proxy performs TLS inspection, install the organization's CA and set `cafile` instead of disabling TLS verification. As a temporary diagnostic only, `sudo npm config set strict-ssl false` can confirm that the failure is CA-related, but do not keep that setting in production.
|
|
73
73
|
|
|
74
|
+
## npm install -g Succeeds But llm-wiki Is Still Old
|
|
75
|
+
|
|
76
|
+
If `npm install -g llm-wiki-kit@latest` succeeds but `llm-wiki --help` does not show newer commands such as `projects` or `version`, the shell is probably executing an older source checkout or stale shim before the npm global binary.
|
|
77
|
+
|
|
78
|
+
Confirm what is actually running:
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
which -a llm-wiki
|
|
82
|
+
readlink -f "$(command -v llm-wiki)"
|
|
83
|
+
npm ls -g llm-wiki-kit --depth=0
|
|
84
|
+
npm root -g
|
|
85
|
+
node "$(npm root -g)/llm-wiki-kit/bin/llm-wiki.js" version
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
If the direct `node "$(npm root -g)/llm-wiki-kit/bin/llm-wiki.js" version` command prints the latest version but plain `llm-wiki` is old, fix `PATH` or replace the stale shim:
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
mkdir -p "$HOME/.local/bin"
|
|
92
|
+
ln -sfn "$(npm root -g)/llm-wiki-kit/bin/llm-wiki.js" "$HOME/.local/bin/llm-wiki"
|
|
93
|
+
export PATH="$HOME/.local/bin:$PATH"
|
|
94
|
+
hash -r
|
|
95
|
+
llm-wiki status
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
If `readlink -f "$(command -v llm-wiki)"` points at a repository checkout such as `/mnt/d/dev_proj/llm-wiki-kit/bin/llm-wiki.js`, `npm install -g` is not updating that checkout. Either switch the shim to the npm package as above, or update the checkout itself with `git pull` and run it intentionally as source.
|
|
99
|
+
|
|
74
100
|
## npm install -g Fails With EACCES
|
|
75
101
|
|
|
76
102
|
If npm tries to write under `/usr` and fails with `EACCES`, use sudo when the server policy allows system-wide global packages:
|
package/package.json
CHANGED
package/src/cli.js
CHANGED
|
@@ -65,6 +65,7 @@ Usage:
|
|
|
65
65
|
llm-wiki doctor
|
|
66
66
|
llm-wiki projects --workspace /apps
|
|
67
67
|
llm-wiki status
|
|
68
|
+
llm-wiki version
|
|
68
69
|
llm-wiki uninstall
|
|
69
70
|
llm-wiki hook codex <EventName>
|
|
70
71
|
llm-wiki hook claude <EventName>
|
|
@@ -97,6 +98,16 @@ Usage:
|
|
|
97
98
|
return;
|
|
98
99
|
}
|
|
99
100
|
|
|
101
|
+
if (command === 'version' || command === '--version' || command === '-v') {
|
|
102
|
+
const result = await status(options);
|
|
103
|
+
printJsonOrText({
|
|
104
|
+
version: result.runtimeVersion,
|
|
105
|
+
installSource: result.installSource,
|
|
106
|
+
binPath: result.binPath,
|
|
107
|
+
}, options, (value) => value.version);
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
|
|
100
111
|
if (command === 'projects') {
|
|
101
112
|
const result = await listProjects(options);
|
|
102
113
|
printJsonOrText(result, options, formatProjects);
|
|
@@ -169,8 +180,11 @@ function formatStatus(value) {
|
|
|
169
180
|
const project = value.project || {};
|
|
170
181
|
return [
|
|
171
182
|
'llm-wiki-kit status',
|
|
183
|
+
`- version: ${value.runtimeVersion}`,
|
|
172
184
|
`- runtime: ${value.runtimeVersion} (${value.installSource})`,
|
|
173
185
|
`- bin: ${value.binPath}`,
|
|
186
|
+
`- command: ${value.commandPath || 'not found'}`,
|
|
187
|
+
`- command matches runtime: ${value.commandMatchesRuntime ? 'yes' : 'no'}`,
|
|
174
188
|
`- hooks current: ${value.hooksCurrent ? 'yes' : 'no'}`,
|
|
175
189
|
`- codex hook: ${value.codexInstalled ? 'current' : 'missing/outdated'}`,
|
|
176
190
|
`- claude hook: ${value.claudeInstalled ? 'current' : 'missing/outdated'}`,
|
package/src/doctor.js
CHANGED
|
@@ -17,6 +17,8 @@ export async function runDoctor() {
|
|
|
17
17
|
add('node >= 20', nodeMajor() >= 20, process.version);
|
|
18
18
|
add('runtime version detected', Boolean(stat.runtimeVersion), stat.runtimeVersion || 'unknown');
|
|
19
19
|
add('llm-wiki bin exists', await exists(stat.binPath), stat.binPath);
|
|
20
|
+
add('runtime installed from npm', stat.installSource === 'npm', `${stat.installSource}; npm install -g does not update source checkouts`);
|
|
21
|
+
add('llm-wiki command resolves to current runtime', stat.commandMatchesRuntime, stat.commandPath ? `command=${stat.commandPath}; runtime=${stat.binPath}` : 'command not found on PATH');
|
|
20
22
|
add('Codex hook installed', stat.codexInstalled, stat.codexHooksPath);
|
|
21
23
|
add('Claude hook installed', stat.claudeInstalled, stat.claudeSettingsPath);
|
|
22
24
|
add('project templates current', stat.project.managedFilesCurrent, stat.project.statePath);
|
package/src/install.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { realpathSync } from 'fs';
|
|
1
2
|
import { chmod } from 'fs/promises';
|
|
3
|
+
import { spawnSync } from 'child_process';
|
|
2
4
|
import { join, resolve } from 'path';
|
|
3
5
|
import { CLAUDE_EVENTS, CODEX_EVENTS, KIT_NAME } from './constants.js';
|
|
4
6
|
import { backupFile, ensureDir, exists, homeDir, readJson, safeSymlink, writeJson } from './fs-utils.js';
|
|
@@ -15,6 +17,23 @@ export function hookCommand(provider, eventName) {
|
|
|
15
17
|
return `${shellQuote(process.execPath)} ${shellQuote(binPath)} hook ${provider} ${eventName}`;
|
|
16
18
|
}
|
|
17
19
|
|
|
20
|
+
function llmWikiCommandPaths() {
|
|
21
|
+
const result = spawnSync('sh', ['-lc', 'which -a llm-wiki 2>/dev/null || true'], {
|
|
22
|
+
encoding: 'utf8',
|
|
23
|
+
});
|
|
24
|
+
if (result.error) return [];
|
|
25
|
+
return [...new Set(result.stdout.split(/\r?\n/).map((line) => line.trim()).filter(Boolean))];
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function realpathOrOriginal(path) {
|
|
29
|
+
if (!path) return null;
|
|
30
|
+
try {
|
|
31
|
+
return realpathSync(path);
|
|
32
|
+
} catch {
|
|
33
|
+
return path;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
18
37
|
function addHook(hooks, eventName, command, options = {}) {
|
|
19
38
|
hooks[eventName] = Array.isArray(hooks[eventName]) ? hooks[eventName] : [];
|
|
20
39
|
const already = JSON.stringify(hooks[eventName]).includes(command);
|
|
@@ -151,11 +170,18 @@ export async function status(options = {}) {
|
|
|
151
170
|
const claude = await readJson(claudeSettingsPath, {});
|
|
152
171
|
const codexInstalled = JSON.stringify(codex.hooks || {}).includes(binPath);
|
|
153
172
|
const claudeInstalled = JSON.stringify(claude.hooks || {}).includes(binPath);
|
|
173
|
+
const commandPaths = llmWikiCommandPaths();
|
|
174
|
+
const commandPath = commandPaths[0] || null;
|
|
175
|
+
const resolvedCommandPath = realpathOrOriginal(commandPath);
|
|
176
|
+
const resolvedBinPath = realpathOrOriginal(binPath);
|
|
154
177
|
return {
|
|
155
178
|
runtimeVersion: runtimeVersion(),
|
|
156
179
|
packageRoot,
|
|
157
180
|
installSource: detectInstallSource(),
|
|
158
181
|
binPath,
|
|
182
|
+
commandPath,
|
|
183
|
+
commandPaths,
|
|
184
|
+
commandMatchesRuntime: Boolean(resolvedCommandPath && resolvedBinPath && resolvedCommandPath === resolvedBinPath),
|
|
159
185
|
codexInstalled,
|
|
160
186
|
claudeInstalled,
|
|
161
187
|
hooksCurrent: codexInstalled && claudeInstalled,
|