@kevin0181/memoc 1.0.6 → 1.1.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.
Files changed (3) hide show
  1. package/README.md +90 -13
  2. package/bin/cli.js +652 -457
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -4,15 +4,18 @@
4
4
 
5
5
  Scaffolds a Markdown-based project memory into any codebase. Works with Claude Code, Codex, Cursor, Windsurf, GitHub Copilot, and Gemini CLI.
6
6
 
7
- ## Quick Start
8
-
7
+ ## Quick Start
8
+
9
9
  ```bash
10
10
  npx @kevin0181/memoc init
11
+
12
+ # Upgrade memoc in this project without deleting existing memory
13
+ npx @kevin0181/memoc@latest upgrade
11
14
  ```
12
15
 
13
16
  Run inside your project directory. Detects your stack automatically and generates everything agents need.
14
17
 
15
- `init` also creates PATH helpers so agents can keep using memoc even when the global/npm bin is not on PATH. It installs a `memoc` launcher into a writable directory already on the current PATH when possible, then also installs a user-local launcher and registers that launcher directory on Windows, macOS, and Linux.
18
+ `init` also creates project-local PATH helpers so agents can keep using memoc even when the global/npm bin is not on PATH.
16
19
 
17
20
  ```bash
18
21
  # PowerShell
@@ -22,9 +25,48 @@ Run inside your project directory. Detects your stack automatically and generate
22
25
  . ./.memoc/env.sh
23
26
  ```
24
27
 
25
- Agents are instructed to try commands in this order: `memoc <command>`, `.\.memoc\bin\memoc.cmd <command>` on Windows or `.memoc/bin/memoc <command>` in sh, then `npx @kevin0181/memoc <command>`.
26
-
27
- ---
28
+ Agents are instructed to use the project-local wrapper if PATH fails:
29
+
30
+ ```bash
31
+ # Windows
32
+ .\.memoc\bin\memoc.cmd summary
33
+
34
+ # macOS / Linux
35
+ .memoc/bin/memoc summary
36
+ ```
37
+
38
+ ---
39
+
40
+ ## Ask An Agent To Install
41
+
42
+ If you are giving this repo or npm package to an AI coding agent, use a prompt like:
43
+
44
+ ```text
45
+ Install memoc in this project and run init.
46
+ Use npm/npx if available. If npm is missing but node is available, clone or download
47
+ https://github.com/neneee0181/memoc and run `node <memoc-repo>/bin/cli.js init`
48
+ from this project's root. After init, verify with the project-local wrapper:
49
+ Windows: .\.memoc\bin\memoc.cmd summary
50
+ macOS/Linux: .memoc/bin/memoc summary
51
+ ```
52
+
53
+ Agent install checklist:
54
+
55
+ 1. Run `node --version`. If Node.js is missing, ask the user to install Node.js LTS first.
56
+ 2. Run `npx @kevin0181/memoc init` from the target project root.
57
+ 3. If `npx` or `npm` is missing, use GitHub source instead:
58
+ ```bash
59
+ git clone https://github.com/neneee0181/memoc.git
60
+ node /path/to/memoc/bin/cli.js init
61
+ ```
62
+ 4. If `git` is missing too, download the GitHub ZIP, extract it, then run `node /path/to/memoc/bin/cli.js init`.
63
+ 5. After init, do not depend on global PATH. Use the project-local wrapper when needed:
64
+ - Windows: `.\.memoc\bin\memoc.cmd <command>`
65
+ - macOS/Linux: `.memoc/bin/memoc <command>`
66
+
67
+ If `node --version` fails, memoc cannot run yet. Install Node.js first, then repeat the steps above.
68
+
69
+ ---
28
70
 
29
71
  ## The Problem
30
72
 
@@ -46,10 +88,14 @@ npx @kevin0181/memoc update
46
88
  # Print current status in ~10 lines
47
89
  npx @kevin0181/memoc summary
48
90
 
49
- # Find relevant files before opening them (token-efficient)
91
+ # Search memory/agent docs first (token-efficient)
50
92
  npx @kevin0181/memoc search "auth"
51
93
  npx @kevin0181/memoc search "auth" --snippets --limit 5
52
94
 
95
+ # Search project source/text files only when memory is not enough
96
+ npx @kevin0181/memoc grep "GetParticles"
97
+ npx @kevin0181/memoc grep "GetParticles" --snippets --limit 5
98
+
53
99
  # Estimate token cost of current memory files
54
100
  npx @kevin0181/memoc tokens
55
101
 
@@ -65,7 +111,38 @@ npx @kevin0181/memoc add gemini
65
111
 
66
112
  ---
67
113
 
68
- ## What Gets Created
114
+ ## Upgrade Existing Projects
115
+
116
+ memoc never auto-updates itself. Upgrade only when you choose to run:
117
+
118
+ ```bash
119
+ npx @kevin0181/memoc@latest upgrade
120
+ ```
121
+
122
+ Run it from the project root. It preserves existing project memory, including:
123
+
124
+ - `.memoc/session-summary.md`
125
+ - `.memoc/02-current-project-state.md` human-written sections
126
+ - `.memoc/03-decisions.md`
127
+ - `.memoc/04-handoff.md`
128
+ - `.memoc/06-project-rules.md`
129
+ - `.memoc/log.md`
130
+ - `.memoc/systems/`
131
+ - `.memoc/wiki/`
132
+
133
+ It refreshes the managed blocks, project-local wrappers, runtime copy, PATH helpers, and missing template files. If `memoc` is not on PATH after upgrading, keep using:
134
+
135
+ ```bash
136
+ # Windows
137
+ .\.memoc\bin\memoc.cmd summary
138
+
139
+ # macOS / Linux
140
+ .memoc/bin/memoc summary
141
+ ```
142
+
143
+ ---
144
+
145
+ ## What Gets Created
69
146
 
70
147
  ```
71
148
  CLAUDE.md ← Claude Code entry point (auto-loaded)
@@ -73,11 +150,11 @@ AGENTS.md ← Codex entry point (auto-loaded)
73
150
  llms.txt ← LLM-facing project map
74
151
  .claude/settings.json ← Claude Code Stop hook
75
152
 
76
- .memoc/
77
- bin/memoc ← project-local wrapper for PATH fallback
78
- env.ps1 · env.sh ← shell helpers that prepend .memoc/bin to PATH
79
- session-summary.md ← Only required startup read (~150 tokens)
80
- 02-current-project-state.md ← Status, open tasks, commands
153
+ .memoc/
154
+ bin/memoc ← project-local wrapper for PATH fallback
155
+ env.ps1 · env.sh ← shell helpers that prepend .memoc/bin to PATH
156
+ session-summary.md ← Only required startup read (~150 tokens)
157
+ 02-current-project-state.md ← Status, open tasks, commands
81
158
  03-decisions.md ← Durable decision log
82
159
  04-handoff.md ← Resume context, verified/unverified
83
160
  06-project-rules.md ← User preferences