create-ai-memory 0.1.0 → 0.1.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 CHANGED
@@ -1,20 +1,31 @@
1
1
  <div align="center">
2
2
 
3
- # ai-memory
3
+ # create-ai-memory
4
4
 
5
- **Persistent, agent-agnostic session memory for AI coding CLIs. One Markdown vault, any agent.**
5
+ **The persistent memory layer for AI coding agents. One Markdown vault, every CLI.**
6
6
 
7
- Give Claude Code, Codex, Gemini, Cursor, and opencode a shared second brain that
8
- survives across sessions: durable profile, per-project context, and last-session carryover,
9
- injected at launch. The vault is the source of truth; the chat is disposable.
7
+ Your agent forgets everything the moment a session ends. create-ai-memory gives Claude
8
+ Code, Codex, Gemini, Cursor, and opencode a shared second brain: a plain-Markdown
9
+ vault that carries your profile, each project's context, and where you left off
10
+ into every new session, on its own.
10
11
 
11
- No daemon, no database, no API key. Just zsh and Markdown files you can read.
12
+ No daemon. No database. No API key. Just zsh and Markdown you can read.
12
13
 
14
+ ```sh
15
+ npm create ai-memory@latest
16
+ ```
17
+
18
+ [![npm](https://img.shields.io/npm/v/create-ai-memory?color=cb3837&label=npm)](https://www.npmjs.com/package/create-ai-memory)
13
19
  ![zsh](https://img.shields.io/badge/shell-zsh-89e051)
14
- ![tests](https://img.shields.io/badge/tests-35%20passing-brightgreen)
20
+ ![tests](https://img.shields.io/badge/tests-38%20passing-brightgreen)
21
+ ![deps](https://img.shields.io/badge/runtime%20deps-0-blue)
15
22
  ![license](https://img.shields.io/badge/license-MIT-blue)
16
23
  ![PRs](https://img.shields.io/badge/PRs-welcome-orange)
17
24
 
25
+ <br>
26
+
27
+ <img src="https://raw.githubusercontent.com/rambaarde/create-ai-memory/main/assets/demo.gif" alt="Installing create-ai-memory with npm create ai-memory@latest" width="820">
28
+
18
29
  </div>
19
30
 
20
31
  ---
@@ -41,9 +52,10 @@ or none. Knowledge earned in Claude doesn't reach Codex.
41
52
  ## How it works
42
53
 
43
54
  Keep the memory outside the chat, in plain Markdown on disk, and inject it into
44
- whichever agent you launch. Because it's just files, the vault doubles as an
45
- [Obsidian](https://obsidian.md) folder with graph view, backlinks, and search;
46
- nothing here requires Obsidian.
55
+ whichever agent you launch. A chat thread is disposable; the vault is permanent.
56
+ Because it is just files, the same vault opens as an
57
+ [Obsidian](https://obsidian.md) second brain with graph view, backlinks, and
58
+ search. Nothing here requires Obsidian; it is Markdown either way.
47
59
 
48
60
  Memory sits in three layers, each injected at the right scope:
49
61
 
@@ -53,10 +65,13 @@ Memory sits in three layers, each injected at the right scope:
53
65
  | **Project** | `_projects/<repo>.md` | sessions in that repo | purpose, architecture, constraints, active decisions |
54
66
  | **Session** | `_session_logs/<repo>/<timestamp>.md` | next session as carryover | what changed, blockers, next steps |
55
67
 
68
+ When you run a launcher, create-ai-memory assembles those layers into one prompt and
69
+ hands it to the agent as its opening message:
70
+
56
71
  ```
57
72
  $ claude-start
58
73
 
59
- ├─ resolve project from the current git repo
74
+ ├─ resolve the project from the current git repo
60
75
  ├─ create a fresh session log from the template
61
76
  ├─ gather: Global Profile + Standards (who you are)
62
77
  │ Project note (this repo)
@@ -73,10 +88,10 @@ Memory sits in three layers, each injected at the right scope:
73
88
  → the NEXT session inherits it as carryover
74
89
  ```
75
90
 
76
- One environment variable, `AI_MEM_ROOT`, points at the vault, so the system moves
77
- between machines by pointing at the same folder.
91
+ One environment variable, `AI_MEM_ROOT`, points at the vault, so the whole system
92
+ moves between machines by pointing at the same folder.
78
93
 
79
- ## A session, start to finish
94
+ ## See a full session
80
95
 
81
96
  ```console
82
97
  $ cd ~/code/checkout-api
@@ -124,7 +139,8 @@ off last time.
124
139
 
125
140
  - [The problem](#the-problem)
126
141
  - [How it works](#how-it-works)
127
- - [A session, start to finish](#a-session-start-to-finish)
142
+ - [See a full session](#see-a-full-session)
143
+ - [What you get](#what-you-get)
128
144
 
129
145
  **Getting started**
130
146
 
@@ -138,9 +154,9 @@ off last time.
138
154
  **Reference**
139
155
 
140
156
  - [Session skills](#session-skills-optional)
141
- - [Vault layout](#vault-layout)
142
- - [Adding a new agent](#adding-a-new-agent)
143
- - [Optional integrations](#optional-integrations)
157
+ - [Your vault](#your-vault)
158
+ - [Add another agent](#add-another-agent)
159
+ - [Integrations](#integrations)
144
160
  - [Configuration](#configuration)
145
161
 
146
162
  </td>
@@ -148,15 +164,31 @@ off last time.
148
164
 
149
165
  **Project**
150
166
 
167
+ - [Why plain files](#why-plain-files)
151
168
  - [Tests](#tests)
152
- - [Design notes](#design-notes)
169
+ - [FAQ](#faq)
153
170
  - [Roadmap](#roadmap)
171
+ - [Contributing](#contributing)
154
172
  - [License](#license)
155
173
 
156
174
  </td>
157
175
  </tr>
158
176
  </table>
159
177
 
178
+ ## What you get
179
+
180
+ | | |
181
+ |---|---|
182
+ | **Cross-agent memory** | One vault serves Claude Code, Codex, Gemini, Cursor, and opencode. Context earned in one reaches the next. |
183
+ | **Automatic carryover** | A Stop hook writes the branch, the commits you made, and uncommitted changes into the session log, so tomorrow's run resumes where today's ended. |
184
+ | **Per-project context** | Each git repo gets its own note for purpose, architecture, and decisions, injected only for that project. |
185
+ | **Your rules, everywhere** | A global profile and standards note ride along in every session, on every project. |
186
+ | **Session skills you define** | Register your own y/n launch options (terse output, design review, minimal-code). create-ai-memory ships none; they are yours. |
187
+ | **Open agent model** | Adapters are three lines. Add opencode, aider, or anything with a CLI without touching the core. |
188
+ | **Obsidian-native** | The vault is plain Markdown, so it opens as an Obsidian second brain with graph view and backlinks, or as plain files with grep. |
189
+ | **Guardrails built in** | Every write is checked to stay inside the vault, and a commit hook refuses commits made without the vault context loaded. |
190
+ | **Zero runtime deps** | No daemon, no database, no API key, no server. It runs in your shell. |
191
+
160
192
  ## Install
161
193
 
162
194
  Pick whichever fits how you manage your shell. All paths end at the same place.
@@ -168,6 +200,8 @@ npm create ai-memory@latest # into ~/ai-memory, then runs the setup
168
200
  npx create-ai-memory ~/code/ai-memory # or a directory you choose
169
201
  ```
170
202
 
203
+ Package: [npmjs.com/package/create-ai-memory](https://www.npmjs.com/package/create-ai-memory)
204
+
171
205
  **zsh plugin manager:**
172
206
 
173
207
  ```zsh
@@ -180,9 +214,9 @@ rambaarde/create-ai-memory
180
214
  # oh-my-zsh: clone into custom/plugins, then add create-ai-memory to plugins=(...)
181
215
  ```
182
216
 
183
- Plugin-manager installs only source the module. That's fine: the vault
217
+ Plugin-manager installs only source the module. That is fine: the vault
184
218
  auto-scaffolds from the shipped templates on first use, so `install.sh` is
185
- optional. Set `AI_MEM_ROOT` in `~/.zshrc` first if you don't want the default
219
+ optional. Set `AI_MEM_ROOT` in `~/.zshrc` first if you do not want the default
186
220
  `~/.ai-memory/_Ai_Memory`.
187
221
 
188
222
  **Clone and run** (the source of truth all paths reuse):
@@ -192,7 +226,7 @@ git clone https://github.com/rambaarde/create-ai-memory.git ~/ai-memory
192
226
  ~/ai-memory/install.sh
193
227
  ```
194
228
 
195
- > **zsh only.** The module uses `print -r`, `${(s:|:)}`, and `select`. A bash
229
+ > **zsh only.** The module uses `print -r`, `${(s:|:)}`, and associative arrays. A bash
196
230
  > port is welcome as a PR; see [Roadmap](#roadmap).
197
231
 
198
232
  ## Commands
@@ -208,7 +242,7 @@ Project is auto-resolved from the current git repo; pass a name to override.
208
242
 
209
243
  ## Session skills (optional)
210
244
 
211
- You define your own per-session skills; ai-memory ships none. At launch it asks
245
+ You define your own per-session skills; create-ai-memory ships none. At launch it asks
212
246
  y/n for each skill you registered, then injects the chosen instruction blocks into
213
247
  the agent (and for Cursor, writes them as a managed always-apply rule). Register
214
248
  nothing and every session is plain.
@@ -228,7 +262,50 @@ source "$HOME/ai-memory/shell/ai-mem.zsh"
228
262
  The injected block applies for the whole run, so a session's chosen skills persist
229
263
  as instructions across every change the agent makes.
230
264
 
231
- ## Vault layout
265
+ ### Recommended skills to wire in
266
+
267
+ These are the session skills worth having on the picker. Each maps to a working
268
+ Claude Code skill; if you have the skill installed, the block below tells the agent
269
+ to use it, and the behavior still applies to agents that do not have the skill
270
+ because the instruction is inlined. Drop them into `AI_MEM_SKILLS` and reorder to
271
+ taste.
272
+
273
+ ```zsh
274
+ typeset -gA AI_MEM_SKILLS
275
+
276
+ # caveman: terse, no-filler output
277
+ AI_MEM_SKILLS[caveman]='Terse output (caveman) this session?::Respond terse like a smart caveman. Keep technical substance exact; drop filler, pleasantries, and hedging.'
278
+
279
+ # ponytail: the laziest solution that actually works (stdlib > deps, one line > fifty)
280
+ AI_MEM_SKILLS[ponytail]='Minimal-code (ponytail) this session?::Use the ponytail approach. Prefer the standard library before new code, native platform features before dependencies, and one line before fifty. Question whether the task needs to exist at all (YAGNI).'
281
+
282
+ # hallmark: anti-AI-slop UI and frontend design
283
+ AI_MEM_SKILLS[hallmark]='Strict UI design (hallmark) this session?::Use the hallmark approach for any frontend, UI, or design work. Avoid generic AI-slop layouts; make type, spacing, color, and hierarchy intentional.'
284
+
285
+ AI_MEM_SKILL_ORDER=(caveman ponytail hallmark)
286
+
287
+ source "$HOME/ai-memory/shell/ai-mem.zsh"
288
+ ```
289
+
290
+ | Skill | What it does | Reach for it when | Source |
291
+ |---|---|---|---|
292
+ | **caveman** | Strips output to terse, no-filler answers | You want signal over prose | [caveman.so](https://caveman.so/) |
293
+ | **ponytail** | Pushes the smallest change that works; stdlib and native features over dependencies | Building features or reviewing for over-engineering | [DietrichGebert/ponytail](https://github.com/DietrichGebert/ponytail) |
294
+ | **hallmark** | Anti-AI-slop design discipline for UI and frontend work | Any visual or frontend task | [usehallmark.com](https://www.usehallmark.com/) |
295
+
296
+ Skills are per session and independent, so you can turn on `ponytail` for a
297
+ refactor and add `hallmark` only when you touch the UI. These are separate,
298
+ installable Claude Code skills; the blocks above inline their behavior so a
299
+ session still benefits even on an agent that does not have the skill installed.
300
+
301
+ If you want a queryable knowledge graph of your codebase alongside your memory,
302
+ pair create-ai-memory with [graphify](https://github.com/safishamsi/graphify).
303
+
304
+ ## Your vault
305
+
306
+ The vault is a folder of Markdown. Point `AI_MEM_ROOT` at a new directory or at an
307
+ existing Obsidian vault; either way you get graph view, backlinks, and full-text
308
+ search over your own AI memory, plus plain `grep` when you want it.
232
309
 
233
310
  ```
234
311
  $AI_MEM_ROOT/
@@ -247,11 +324,11 @@ Notes are created from templates on first use and never overwritten. Edit
247
324
  `_Global_Profile.md` and `_Standards.md` to make them yours; the shipped versions
248
325
  are sanitized placeholders.
249
326
 
250
- ## Adding a new agent
327
+ ## Add another agent
251
328
 
252
- Launchers aren't hardcoded. Each agent is one small adapter, and the
329
+ Launchers are not hardcoded. Each agent is one small adapter, and the
253
330
  `<name>-start` function is generated for you. `claude`, `codex`, `gemini`,
254
- `cursor`, and `opencode` ship built in. To add another, say `aider`:
331
+ `cursor`, and `opencode` ship built in. To add `aider`:
255
332
 
256
333
  1. Define the adapter in `shell/adapters.zsh`. It receives `$1` memory prompt,
257
334
  `$2` mode block, and `$3` onward extra args:
@@ -267,7 +344,7 @@ Launchers aren't hardcoded. Each agent is one small adapter, and the
267
344
  ```
268
345
  3. `aider-start` now exists. No core edits.
269
346
 
270
- ## Optional integrations
347
+ ## Integrations
271
348
 
272
349
  ### Claude Code hooks
273
350
  The files live in `hooks/claude/`. Record repo `HEAD` at session start, then on
@@ -282,7 +359,7 @@ The files live in `hooks/git/`:
282
359
 
283
360
  - **`commit-msg`** requires Conventional Commits and a structured body, and that
284
361
  `ai-context` was loaded in the committing shell, matching a per-repo token. An
285
- agent can't commit without the vault context loaded.
362
+ agent cannot commit without the vault context loaded.
286
363
  - **`pre-push`** blocks direct pushes to `main` unless `ALLOW_PUSH_TO_MAIN=1`.
287
364
 
288
365
  Enable per repo:
@@ -300,14 +377,36 @@ git -C <repo> config core.hooksPath .githooks
300
377
  | `AI_MEM_AGENTS` | `claude codex gemini cursor opencode` | Space-separated agents to generate `-start` functions for |
301
378
  | `AI_MEM_SKILLS` / `AI_MEM_SKILL_ORDER` | empty | Your per-session skills (see above) |
302
379
 
380
+ ## Why plain files
381
+
382
+ create-ai-memory is deliberately small. There is no server to run, no container to pull,
383
+ no database to migrate, no API key to store. The design choices behind that:
384
+
385
+ - **The vault is the source of truth; the chat is disposable.** Durable state
386
+ lives in Markdown you can read, diff, and version, not inside any agent.
387
+ - **Files over a service.** A folder syncs over git, Dropbox, or Syncthing, opens
388
+ in Obsidian, and greps in a shell. It outlives any one tool.
389
+ - **Explicit over magic.** You decide what goes in the profile, the project note,
390
+ and the session log. The agent reads them; it does not silently rewrite your
391
+ memory behind your back.
392
+ - **Path-guarded writes.** Every file operation is checked to stay inside
393
+ `$AI_MEM_ROOT`, so an agent cannot write outside the memory boundary.
394
+ - **Project equals git repo.** Resolution prefers the repo you are standing in, so
395
+ moving between projects in one shell never pins the wrong project.
396
+
397
+ If you want an auto-capturing server with a web UI and vector search, other tools
398
+ do that. create-ai-memory trades those for something you can read end to end in an
399
+ afternoon and carry anywhere.
400
+
303
401
  ## Tests
304
402
 
305
- Offline unit suite (throwaway vault + git repo, no network): path guarding,
306
- project resolution, session prep, context prompt, skill picker, launcher
307
- generation, adapter dispatch, the commit token, and `ai-note`.
403
+ Offline unit suite (throwaway vault and git repo, no network): path guarding,
404
+ project resolution, session prep, the context prompt, the skill picker, launcher
405
+ generation, adapter dispatch, the commit token, `ai-note`, and the cursor rule
406
+ file.
308
407
 
309
408
  ```sh
310
- zsh tests/run.sh # offline unit tests
409
+ zsh tests/run.sh # offline unit tests (38 assertions)
311
410
  zsh tests/smoke.sh # live: launches each agent headlessly, checks it responds
312
411
  ```
313
412
 
@@ -315,25 +414,50 @@ zsh tests/smoke.sh # live: launches each agent headlessly, checks it responds
315
414
  (opencode defaults to DeepSeek; set it up or pass
316
415
  `AIMEM_SMOKE_OPENCODE_MODEL=provider/model`).
317
416
 
318
- ## Design notes
417
+ ## FAQ
319
418
 
320
- - **The vault is the source of truth; the chat is disposable.** Durable state lives
321
- in Markdown, not in any agent's memory.
322
- - **Path-guarded writes.** Every file operation is checked to stay inside
323
- `$AI_MEM_ROOT`, so an agent can't write outside the memory boundary.
324
- - **Project = git repo.** Resolution prefers the repo you're standing in, so
325
- `cd`-ing between projects in one shell never pins the wrong project.
326
- - **Additive by default.** Templates fill in; notes are never clobbered.
419
+ **Does it send my code anywhere?**
420
+ No. create-ai-memory is shell functions plus Markdown files on your disk. The only network
421
+ calls are the ones your agent already makes.
422
+
423
+ **Do I need Obsidian?**
424
+ No. The vault is plain Markdown. Obsidian is a nice way to browse it, not a
425
+ requirement.
426
+
427
+ **Do I need an API key or a paid plan?**
428
+ No. create-ai-memory itself needs neither. Your agents use whatever auth they already have.
429
+
430
+ **Which shells and platforms?**
431
+ zsh today, on macOS and Linux (including WSL). A bash port is on the roadmap.
432
+
433
+ **Does plain `claude` still work?**
434
+ Yes. Only the `*-start` launchers inject memory; plain runs are untouched, and the
435
+ hooks no-op unless a session was launched through create-ai-memory.
436
+
437
+ **Can I use my existing Obsidian vault?**
438
+ Yes. Point `AI_MEM_ROOT` at it. Notes are additive and never overwrite your files.
439
+
440
+ **How is a "project" identified?**
441
+ By the directory name of the git repo you are in.
442
+
443
+ **My agent isn't listed. Can I add it?**
444
+ Yes, if it has a CLI. See [Add another agent](#add-another-agent); it is three
445
+ lines.
327
446
 
328
447
  ## Roadmap
329
448
 
330
449
  - Bash port of the shell module.
331
- - Publish `create-ai-memory` to npm.
332
- - More agent adapters shipped by default: opencode, aider.
450
+ - More agent adapters shipped by default: aider and others.
333
451
  - Optional cross-project index and search over session logs.
334
452
 
335
- PRs welcome. Persistent AI memory shouldn't be a personal hack; it should be
336
- something the whole community can install.
453
+ ## Contributing
454
+
455
+ Issues and PRs are welcome. Good first areas: a bash port, new agent adapters, and
456
+ docs. Run `zsh tests/run.sh` before opening a PR; keep changes additive and the
457
+ vault path-guarded.
458
+
459
+ Persistent AI memory should not be a personal hack; it should be something the
460
+ whole community can install.
337
461
 
338
462
  ## License
339
463
 
@@ -31,11 +31,14 @@ for (const item of ITEMS) {
31
31
  if (existsSync(src)) cpSync(src, join(dest, item), { recursive: true });
32
32
  }
33
33
 
34
- // Hand off to the shell installer for the interactive setup.
35
- const r = spawnSync('sh', [join(dest, 'install.sh')], { stdio: 'inherit' });
34
+ // Hand off to the shell installer for the interactive setup. Run it with bash,
35
+ // not sh: install.sh is a bash script (arrays, printf -v, ${!var}) and would
36
+ // fail under a POSIX sh such as dash, which is /bin/sh on Debian and Ubuntu.
37
+ const installer = join(dest, 'install.sh');
38
+ const r = spawnSync('bash', [installer], { stdio: 'inherit' });
36
39
  if (r.error) {
37
- console.error(`create-ai-memory: could not run install.sh: ${r.error.message}`);
38
- console.error(`Files are in ${dest}; run sh ${join(dest, 'install.sh')} yourself.`);
40
+ console.error(`create-ai-memory: could not run the installer with bash: ${r.error.message}`);
41
+ console.error(`Files are in ${dest}; run bash ${installer} yourself.`);
39
42
  process.exit(1);
40
43
  }
41
44
  process.exit(r.status ?? 0);
package/install.sh CHANGED
@@ -32,11 +32,14 @@ confirm() { # confirm <prompt> -> 0 for yes; defaults to yes, and yes when pipe
32
32
  case "${__reply:-Y}" in [Nn]*) return 1 ;; *) return 0 ;; esac
33
33
  }
34
34
 
35
- # Color only when it lands in a real terminal that wants it.
35
+ # Color only in a real terminal that actually supports 24-bit color. Terminals
36
+ # that do not advertise truecolor (e.g. macOS Terminal.app) fall back to the
37
+ # plain block art rather than rendering the gradient as wrong colors.
36
38
  supports_color() {
37
39
  [ "$INTERACTIVE" -eq 1 ] || return 1
38
40
  [ -z "${NO_COLOR:-}" ] || return 1
39
41
  [ "${TERM:-}" != "dumb" ] || return 1
42
+ case "${COLORTERM:-}" in truecolor|24bit) return 0 ;; *) return 1 ;; esac
40
43
  }
41
44
 
42
45
  # ANSI Shadow "AI MEMORY" with a teal->violet vertical gradient (24-bit color),
@@ -69,7 +72,7 @@ banner
69
72
  # --- gather settings ---------------------------------------------------------
70
73
  AI_MEM_ROOT="${AI_MEM_ROOT:-$HOME/.ai-memory/_Ai_Memory}"
71
74
  ask AI_MEM_ROOT "Where should your memory vault live?" "$AI_MEM_ROOT"
72
- AI_MEM_AGENTS="${AI_MEM_AGENTS:-claude codex gemini cursor}"
75
+ AI_MEM_AGENTS="${AI_MEM_AGENTS:-claude codex gemini cursor opencode}"
73
76
  ask AI_MEM_AGENTS "Which agents should get <agent>-start launchers?" "$AI_MEM_AGENTS"
74
77
 
75
78
  # --- scaffold the vault ------------------------------------------------------
@@ -88,7 +91,7 @@ copy_if_absent "$HERE/vault-template/_session_logs/_session_template.md" "$AI_ME
88
91
 
89
92
  # --- assemble the ~/.zshrc lines ---------------------------------------------
90
93
  LINES="export AI_MEM_ROOT=\"$AI_MEM_ROOT\""
91
- if [ "$AI_MEM_AGENTS" != "claude codex gemini cursor" ]; then
94
+ if [ "$AI_MEM_AGENTS" != "claude codex gemini cursor opencode" ]; then
92
95
  LINES="$LINES
93
96
  export AI_MEM_AGENTS=\"$AI_MEM_AGENTS\""
94
97
  fi
@@ -115,10 +118,21 @@ $(printf '%s\n' "$LINES" | sed 's/^/ /')
115
118
  EOF
116
119
  fi
117
120
 
121
+ case "${SHELL:-}" in
122
+ *zsh) : ;;
123
+ *) echo; echo " note: ai-memory is zsh-only; your login shell looks like ${SHELL:-unknown}." ;;
124
+ esac
125
+
118
126
  cat <<EOF
119
127
 
120
- Done. From inside any git repo, run: claude-start
121
- (or codex-start / gemini-start / cursor-start)
128
+ Done.
129
+ tool: $HERE
130
+ (keep this folder; your shell sources it on startup)
131
+ vault: $AI_MEM_ROOT
132
+ (your memory; safe to back up, sync, or open in Obsidian)
133
+
134
+ From inside any git repo, run: claude-start
135
+ (or codex-start / gemini-start / cursor-start / opencode-start)
122
136
 
123
137
  Optional integrations: see $HERE/hooks/ and the README.
124
138
  EOF
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-ai-memory",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Persistent, agent-agnostic session memory for AI coding CLIs (Claude Code, Codex, Gemini, Cursor, opencode). One Markdown vault, any agent.",
5
5
  "bin": {
6
6
  "create-ai-memory": "bin/create-ai-memory.js"
package/shell/ai-mem.zsh CHANGED
@@ -1,7 +1,7 @@
1
1
  # === AI CLI + Obsidian memory ===
2
2
  # Portable, agent-agnostic session memory. Source this from ~/.zshrc after
3
3
  # exporting AI_MEM_ROOT to point at your vault. Zsh-only (uses print -r, ${(s)},
4
- # select). Add a new agent by defining _ai_adapter_<name> in adapters.zsh and
4
+ # and associative arrays). Add a new agent by defining _ai_adapter_<name> in adapters.zsh and
5
5
  # listing it in AI_MEM_AGENTS; a matching <name>-start function is generated.
6
6
 
7
7
  # Directory holding this module, used to source sibling files.
@@ -350,6 +350,14 @@ _ai_session_start() {
350
350
 
351
351
  local session_prompt="${*:-}"
352
352
 
353
+ # Fail fast with a clear message if the agent's CLI is missing, before a
354
+ # session log is created. Cursor is exempt: its adapter falls back to opening
355
+ # the app when the `cursor` CLI is absent.
356
+ if [[ "$launcher" != cursor ]] && ! command -v "$launcher" >/dev/null 2>&1; then
357
+ echo "ai-memory: '$launcher' CLI not found on PATH. Install it, or drop it from AI_MEM_AGENTS." >&2
358
+ return 1
359
+ fi
360
+
353
361
  local resolved
354
362
  resolved="$(_ai_mem_prepare_session)" || return 1
355
363