@hawkeye-xb.com/imprint-cli 0.1.0 → 0.2.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.
- package/dist/cli.js +62 -0
- package/package.json +3 -2
package/dist/cli.js
CHANGED
|
@@ -263,6 +263,68 @@ async function install(args) {
|
|
|
263
263
|
await installCodex(creds.token, apiBase);
|
|
264
264
|
break;
|
|
265
265
|
}
|
|
266
|
+
await bootstrapUsageDoc(creds.token, apiBase);
|
|
267
|
+
}
|
|
268
|
+
var USAGE_DOC_PATH = "users/_imprint-usage.md";
|
|
269
|
+
var USAGE_DOC = `# How to use Imprint (auto-seeded)
|
|
270
|
+
|
|
271
|
+
This file was created by \`imprint install\` on first run as a primer for any AI agent that connects to this user's Imprint memory. Edit or \`rm\` it freely \u2014 it will only be re-seeded if missing.
|
|
272
|
+
|
|
273
|
+
## Triggers
|
|
274
|
+
|
|
275
|
+
- **Session start**: run \`ls /\` to see what context exists. Then \`cat\` or \`grep\` anything that might be relevant before asking the user identity questions.
|
|
276
|
+
- **User reveals a preference / decision / constraint**: \`write\` it. Don't wait for explicit "remember this".
|
|
277
|
+
- **Stored memory contradicts current observation**: overwrite or \`rm\` it. Stale memories are worse than missing ones.
|
|
278
|
+
|
|
279
|
+
## Path taxonomy
|
|
280
|
+
|
|
281
|
+
- \`users/<topic>.md\` \u2014 identity, working style, preferences, principles
|
|
282
|
+
- \`projects/<name>/<topic>.md\` \u2014 per-project goals, constraints, decisions
|
|
283
|
+
- \`feedback/<topic>.md\` \u2014 corrections received, validated approaches
|
|
284
|
+
- \`references/<topic>.md\` \u2014 pointers to external systems (Linear, Slack, dashboards)
|
|
285
|
+
|
|
286
|
+
## Entry shape
|
|
287
|
+
|
|
288
|
+
Lead with the rule or fact in one line, then:
|
|
289
|
+
|
|
290
|
+
- **Why:** the reason it matters (often a past incident, deadline, or stated preference)
|
|
291
|
+
- **How to apply:** when this should change behavior in future sessions
|
|
292
|
+
|
|
293
|
+
Knowing *why* lets future agents handle edge cases instead of mechanically following the rule.
|
|
294
|
+
|
|
295
|
+
## Privacy
|
|
296
|
+
|
|
297
|
+
Don't persist employer names, work emails, or any identifier that could leak day-job context unless the user has explicitly said it's safe. When in doubt, abstract ("a tech company") or omit.
|
|
298
|
+
`;
|
|
299
|
+
async function bootstrapUsageDoc(token, apiBase) {
|
|
300
|
+
const url = `${apiBase}/api/v1/memories/${USAGE_DOC_PATH}`;
|
|
301
|
+
try {
|
|
302
|
+
const head = await fetch(url, {
|
|
303
|
+
headers: { Authorization: `Bearer ${token}` }
|
|
304
|
+
});
|
|
305
|
+
if (head.status === 200) return;
|
|
306
|
+
if (head.status !== 404) {
|
|
307
|
+
console.warn(` (skipped seeding ${USAGE_DOC_PATH}: HTTP ${head.status})`);
|
|
308
|
+
return;
|
|
309
|
+
}
|
|
310
|
+
const res = await fetch(`${apiBase}/api/v1/memories`, {
|
|
311
|
+
method: "POST",
|
|
312
|
+
headers: {
|
|
313
|
+
Authorization: `Bearer ${token}`,
|
|
314
|
+
"Content-Type": "application/json"
|
|
315
|
+
},
|
|
316
|
+
body: JSON.stringify({ path: USAGE_DOC_PATH, content: USAGE_DOC })
|
|
317
|
+
});
|
|
318
|
+
if (res.ok) {
|
|
319
|
+
console.log(`\u2713 Seeded ${USAGE_DOC_PATH} (visible on first \`ls /\`)`);
|
|
320
|
+
} else {
|
|
321
|
+
console.warn(` (skipped seeding ${USAGE_DOC_PATH}: HTTP ${res.status})`);
|
|
322
|
+
}
|
|
323
|
+
} catch (err) {
|
|
324
|
+
console.warn(
|
|
325
|
+
` (skipped seeding ${USAGE_DOC_PATH}: ${err.message})`
|
|
326
|
+
);
|
|
327
|
+
}
|
|
266
328
|
}
|
|
267
329
|
function parseTool(args) {
|
|
268
330
|
const idx = args.indexOf("--tool");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hawkeye-xb.com/imprint-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Imprint CLI — long-term memory for AI coding tools (Claude Code, Cursor, Codex). Installs the imprint MCP server into your tool's settings file via a browser OAuth flow.",
|
|
6
6
|
"license": "Elastic-2.0",
|
|
@@ -23,7 +23,8 @@
|
|
|
23
23
|
"codex"
|
|
24
24
|
],
|
|
25
25
|
"bin": {
|
|
26
|
-
"imprint": "./dist/cli.js"
|
|
26
|
+
"imprint": "./dist/cli.js",
|
|
27
|
+
"imprint-cli": "./dist/cli.js"
|
|
27
28
|
},
|
|
28
29
|
"files": [
|
|
29
30
|
"dist",
|