@empirical-gauzza/cli 1.0.11 → 1.0.13
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 +63 -0
- package/lib/installers/hooks.js +21 -21
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# @empirical-gauzza/cli
|
|
2
|
+
|
|
3
|
+
Command-line installer and local MCP wiring helper for [Empirical](https://empirical.gauzza.com) — portable memory infrastructure for AI agents, assistants, and coding tools.
|
|
4
|
+
|
|
5
|
+
Full documentation: **[empirical.gauzza.com/docs/cli-details](https://empirical.gauzza.com/docs/cli-details)**
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install -g @empirical-gauzza/cli
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Quick start
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
empirical install # interactive setup for Claude Code, Codex, or Copilot CLI
|
|
17
|
+
empirical auth login # browser-based OAuth login
|
|
18
|
+
empirical doctor # verify token, API connectivity, and workspace status
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Full walkthrough: [empirical.gauzza.com/docs/install](https://empirical.gauzza.com/docs/install)
|
|
22
|
+
|
|
23
|
+
## What it does
|
|
24
|
+
|
|
25
|
+
- Installs and configures the Empirical MCP plugin for supported coding agents (Claude Code, Codex CLI, Copilot CLI)
|
|
26
|
+
- Manages OAuth login, including headless/CI bootstrap and Docker token flows
|
|
27
|
+
- Reads, writes, and maintains memories from the command line
|
|
28
|
+
- Manages Skills Kits — create, sync, and push authored Skills across machines
|
|
29
|
+
- Manages workspaces, invites, and registered devices
|
|
30
|
+
- Exposes agent-readable docs and a connectivity `doctor` check
|
|
31
|
+
|
|
32
|
+
## Commands
|
|
33
|
+
|
|
34
|
+
| Command | Docs |
|
|
35
|
+
| --- | --- |
|
|
36
|
+
| `empirical install` | [/docs/install](https://empirical.gauzza.com/docs/install#connect) |
|
|
37
|
+
| `empirical plugin install / check` | [/docs/cli-plugins](https://empirical.gauzza.com/docs/cli-plugins) |
|
|
38
|
+
| `empirical auth login / logout` | [/docs/cli-auth](https://empirical.gauzza.com/docs/cli-auth) |
|
|
39
|
+
| `empirical oauth bootstrap / refresh` | [/docs/cli-oauth](https://empirical.gauzza.com/docs/cli-oauth) |
|
|
40
|
+
| `empirical policy show / set` | [/docs/cli-policy](https://empirical.gauzza.com/docs/cli-policy) |
|
|
41
|
+
| `empirical memory query / record / update / delete / export ...` | [/docs/cli-memory](https://empirical.gauzza.com/docs/cli-memory) |
|
|
42
|
+
| `empirical workspace list / create / invite ...` | [/docs/cli-workspaces](https://empirical.gauzza.com/docs/cli-workspaces) |
|
|
43
|
+
| `empirical kit create / sync / use ...` | [/docs/cli-kit](https://empirical.gauzza.com/docs/cli-kit) |
|
|
44
|
+
| `empirical skill push / history / rollback` | [/docs/cli-skill](https://empirical.gauzza.com/docs/cli-skill) |
|
|
45
|
+
| `empirical device list / show` | [/docs/cli-devices](https://empirical.gauzza.com/docs/cli-devices) |
|
|
46
|
+
| `empirical doc [topic]` | [/docs/cli-doc-command](https://empirical.gauzza.com/docs/cli-doc-command) |
|
|
47
|
+
| `empirical doctor` | [/docs/cli-doctor](https://empirical.gauzza.com/docs/cli-doctor) |
|
|
48
|
+
|
|
49
|
+
Run `empirical --help` at any time for the full, current command list, or `empirical doc` for agent-readable topic docs.
|
|
50
|
+
|
|
51
|
+
## Security model
|
|
52
|
+
|
|
53
|
+
API keys and OAuth tokens are stored locally and are never printed in full after initial issuance. See [empirical.gauzza.com/docs/security-model](https://empirical.gauzza.com/docs/security-model) for details on credential handling and headless/CI usage.
|
|
54
|
+
|
|
55
|
+
## Links
|
|
56
|
+
|
|
57
|
+
- [Documentation](https://empirical.gauzza.com/docs/install)
|
|
58
|
+
- [Homepage](https://empirical.gauzza.com)
|
|
59
|
+
- [Support](https://empirical.gauzza.com/support/)
|
|
60
|
+
|
|
61
|
+
## License
|
|
62
|
+
|
|
63
|
+
MIT
|
package/lib/installers/hooks.js
CHANGED
|
@@ -217,16 +217,13 @@ function main() {
|
|
|
217
217
|
main();
|
|
218
218
|
`;
|
|
219
219
|
|
|
220
|
-
// Claude-only variant of the Stop reminder above.
|
|
221
|
-
//
|
|
222
|
-
//
|
|
223
|
-
//
|
|
224
|
-
//
|
|
225
|
-
//
|
|
226
|
-
//
|
|
227
|
-
// is the same script with the loop guard actually load-bearing: block once per turn, never twice.
|
|
228
|
-
// Codex/Copilot keep using the silent EMPIRICAL_HOOK_STOP_SOURCE until their own Stop/agentStop
|
|
229
|
-
// blocking semantics are confirmed against source the way Claude's was here.
|
|
220
|
+
// Claude-only variant of the Stop reminder above. hookSpecificOutput.additionalContext (stdout,
|
|
221
|
+
// exit 0) is Claude Code's non-blocking Stop-hook feedback channel: the text is fed into context
|
|
222
|
+
// and the conversation continues, same outcome the earlier exit-2 approach achieved, but the
|
|
223
|
+
// transcript UI renders it as a plain system reminder instead of a red "Stop hook error" line.
|
|
224
|
+
// EMPIRICAL_HOOK_STOP_SOURCE above still uses plain console.log + exit 0, which Claude Code treats
|
|
225
|
+
// as non-blocking output that's logged but never reaches the model - that was this hook's original
|
|
226
|
+
// bug (fixed for Claude here, unconfirmed/unfixed for Codex/Copilot's own Stop/agentStop semantics).
|
|
230
227
|
const CLAUDE_HOOK_STOP_SOURCE = `#!/usr/bin/env node
|
|
231
228
|
'use strict';
|
|
232
229
|
|
|
@@ -264,22 +261,25 @@ function main() {
|
|
|
264
261
|
var payload = readStdinPayload();
|
|
265
262
|
|
|
266
263
|
// stop_hook_active === true means Claude is re-invoking this hook because a PRIOR Stop hook
|
|
267
|
-
// (possibly this same one) already forced a continuation this
|
|
268
|
-
//
|
|
269
|
-
//
|
|
264
|
+
// (possibly this same one) already surfaced additionalContext and forced a continuation this
|
|
265
|
+
// turn. additionalContext causes the same forced-continuation behavior decision:block does -
|
|
266
|
+
// confirmed empirically: without this guard the hook re-fired every ~2-3s in an infinite loop,
|
|
267
|
+
// since each additionalContext output triggers another Stop event. Must exit 0 with no output
|
|
268
|
+
// here, unconditionally, or the loop continues.
|
|
270
269
|
if (payload && payload.stop_hook_active === true) {
|
|
271
|
-
appendLog('stop_hook_active=true, skipping reminder (already
|
|
270
|
+
appendLog('stop_hook_active=true, skipping reminder (already surfaced once this turn)');
|
|
272
271
|
process.exit(0);
|
|
273
272
|
}
|
|
274
273
|
|
|
275
|
-
appendLog('stop hook fired (pid=' + process.pid + ', platform=' + process.platform + '),
|
|
274
|
+
appendLog('stop hook fired (pid=' + process.pid + ', platform=' + process.platform + '), surfacing reminder via additionalContext');
|
|
276
275
|
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
276
|
+
process.stdout.write(JSON.stringify({
|
|
277
|
+
hookSpecificOutput: {
|
|
278
|
+
hookEventName: 'Stop',
|
|
279
|
+
additionalContext: '[Empirical] Record memory-worthy work now via empirical-memory skill.'
|
|
280
|
+
}
|
|
281
|
+
}) + '\\n');
|
|
282
|
+
process.exit(0);
|
|
283
283
|
}
|
|
284
284
|
|
|
285
285
|
main();
|