@contextline/contextline 0.1.1 → 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/README.md +154 -178
- package/dist/cli.js +324 -545
- package/dist/cli.js.map +1 -1
- package/dist/postinstall.js +1 -1
- package/dist/postinstall.js.map +1 -1
- package/docs/why-contextline.md +116 -120
- package/package.json +56 -59
- package/dist/index.d.ts +0 -2
- package/dist/index.js +0 -695
- package/dist/index.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,178 +1,154 @@
|
|
|
1
|
-
# ContextLine
|
|
2
|
-
|
|
3
|
-
ContextLine is a local-first, filesystem-backed memory layer for
|
|
4
|
-
|
|
5
|
-
It gives an assistant a small quick-memory file, links into deeper Markdown memory files, and
|
|
6
|
-
|
|
7
|
-
For product context and examples, see [Why ContextLine Exists](docs/why-contextline.md).
|
|
8
|
-
|
|
9
|
-
## Install
|
|
10
|
-
|
|
11
|
-
```sh
|
|
12
|
-
npm install -g contextline
|
|
13
|
-
contextline setup
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
The install step prints a reminder to run `contextline setup`. Setup is explicit because it creates local memory files and host integration config.
|
|
17
|
-
|
|
18
|
-
## Quick Start With Codex
|
|
19
|
-
|
|
20
|
-
From the project where you want memory enabled:
|
|
21
|
-
|
|
22
|
-
```sh
|
|
23
|
-
contextline setup
|
|
24
|
-
codex
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
- `.
|
|
34
|
-
- `.codex/
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
- `
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
-
|
|
70
|
-
-
|
|
71
|
-
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
contextline
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
```
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
## Publishing
|
|
157
|
-
|
|
158
|
-
Before publishing:
|
|
159
|
-
|
|
160
|
-
```sh
|
|
161
|
-
npm run build
|
|
162
|
-
npm test
|
|
163
|
-
npm pack --dry-run
|
|
164
|
-
```
|
|
165
|
-
|
|
166
|
-
Then publish:
|
|
167
|
-
|
|
168
|
-
```sh
|
|
169
|
-
npm publish --access public
|
|
170
|
-
git tag v0.1.0
|
|
171
|
-
git push origin main --tags
|
|
172
|
-
```
|
|
173
|
-
|
|
174
|
-
## Limitations
|
|
175
|
-
|
|
176
|
-
V1 intentionally excludes embeddings, vector search, cloud sync, databases, GUI, telemetry upload, team sharing, and automatic semantic classification inside the server.
|
|
177
|
-
|
|
178
|
-
Currently supported host setup is Codex. Other MCP-capable hosts can use manual MCP configuration.
|
|
1
|
+
# ContextLine
|
|
2
|
+
|
|
3
|
+
ContextLine is a local-first, filesystem-backed memory layer for AI assistants.
|
|
4
|
+
|
|
5
|
+
It gives an assistant a small quick-memory file, links into deeper Markdown memory files, and checkpoint instructions for saving durable memory. The host model decides what is worth remembering and writes normal Markdown files.
|
|
6
|
+
|
|
7
|
+
For product context and examples, see [Why ContextLine Exists](docs/why-contextline.md).
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
```sh
|
|
12
|
+
npm install -g @contextline/contextline
|
|
13
|
+
contextline setup
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
The install step prints a reminder to run `contextline setup`. Setup is explicit because it creates local memory files and host integration config.
|
|
17
|
+
|
|
18
|
+
## Quick Start With Codex Or Claude Code
|
|
19
|
+
|
|
20
|
+
From the project where you want memory enabled:
|
|
21
|
+
|
|
22
|
+
```sh
|
|
23
|
+
contextline setup
|
|
24
|
+
codex
|
|
25
|
+
# or
|
|
26
|
+
claude
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
By default, setup stores memory in `./.contextline`, detects supported hosts, and configures Codex and Claude Code when available.
|
|
30
|
+
|
|
31
|
+
Setup creates:
|
|
32
|
+
|
|
33
|
+
- `.contextline/` for local memory
|
|
34
|
+
- `.codex/hooks.json` for the Codex `SessionStart` and `UserPromptSubmit` hooks
|
|
35
|
+
- `.codex/hooks/contextline-hook.mjs` for the hook command
|
|
36
|
+
- `.codex/config.toml` for a filesystem MCP server scoped to `.contextline/`
|
|
37
|
+
- `.claude/settings.json` for the Claude Code `SessionStart` and `UserPromptSubmit` hooks
|
|
38
|
+
- `.claude/hooks/contextline-hook.mjs` for the hook command
|
|
39
|
+
|
|
40
|
+
On session start, the host gets a bounded memory snapshot from `L1_Quick.md`. On each user prompt, the host gets a checkpoint instruction to save durable memory from the previous exchange when the exchange was not purely transient.
|
|
41
|
+
|
|
42
|
+
## What Gets Stored
|
|
43
|
+
|
|
44
|
+
ContextLine writes plain Markdown:
|
|
45
|
+
|
|
46
|
+
```text
|
|
47
|
+
.contextline/
|
|
48
|
+
L1_Quick.md
|
|
49
|
+
L2_Deep/
|
|
50
|
+
person_customer.md
|
|
51
|
+
project_contextline.md
|
|
52
|
+
area_work.md
|
|
53
|
+
preference_media.md
|
|
54
|
+
maintenance/
|
|
55
|
+
proposals/
|
|
56
|
+
contextline_instructions.md
|
|
57
|
+
config.json
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
The cache model is:
|
|
61
|
+
|
|
62
|
+
- `L1_Quick.md`: compact facts, summaries, and active pointers.
|
|
63
|
+
- `L2_Deep/`: dated durable memory files per important person, object, project, place, preference area, event, or decision thread. L2 entries include the relevant discussion context directly.
|
|
64
|
+
|
|
65
|
+
V1 uses flat L2 filenames with semantic prefixes, such as `person_`, `project_`, `area_`, `place_`, `preference_`, `decision_`, `event_`, and `org_`.
|
|
66
|
+
|
|
67
|
+
Topology rules:
|
|
68
|
+
|
|
69
|
+
- L1 may link only to L2 files.
|
|
70
|
+
- L1 memory lines should link to relevant L2 files.
|
|
71
|
+
- L2 memory lines should be dated and should generally not contain wiki links.
|
|
72
|
+
|
|
73
|
+
## CLI
|
|
74
|
+
|
|
75
|
+
```sh
|
|
76
|
+
contextline setup [--host codex|claude|claude-code|auto|none] [--root .contextline]
|
|
77
|
+
contextline hook --root <root>
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## Host Integration
|
|
81
|
+
|
|
82
|
+
ContextLine does not run a custom MCP server. It installs hooks that provide the assistant with:
|
|
83
|
+
|
|
84
|
+
- session-start memory hydration from `L1_Quick.md`
|
|
85
|
+
- per-prompt checkpoint instructions for saving durable memory
|
|
86
|
+
- a local `.contextline/` file structure
|
|
87
|
+
|
|
88
|
+
Codex setup also registers `@modelcontextprotocol/server-filesystem`, scoped only to the `.contextline/` folder, so Codex can use file tools for memory reads and writes. Claude Code uses its native file tools plus project permissions for `.contextline/**`.
|
|
89
|
+
|
|
90
|
+
Manual Codex filesystem MCP config:
|
|
91
|
+
|
|
92
|
+
```toml
|
|
93
|
+
[mcp_servers.filesystem]
|
|
94
|
+
type = "stdio"
|
|
95
|
+
command = "npx"
|
|
96
|
+
args = ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/project/.contextline"]
|
|
97
|
+
startup_timeout_sec = 10
|
|
98
|
+
tool_timeout_sec = 10
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
## Privacy
|
|
102
|
+
|
|
103
|
+
ContextLine stores memory in local files under the folder you choose. It does not upload memory or run semantic extraction in a server. The host assistant decides what to save and edits the local Markdown files.
|
|
104
|
+
|
|
105
|
+
## Development
|
|
106
|
+
|
|
107
|
+
```sh
|
|
108
|
+
npm install
|
|
109
|
+
npm run build
|
|
110
|
+
npm test
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
To test the CLI locally:
|
|
114
|
+
|
|
115
|
+
```sh
|
|
116
|
+
npm install -g .
|
|
117
|
+
contextline setup
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
If auto-detection fails, or if you want a different memory folder:
|
|
121
|
+
|
|
122
|
+
```sh
|
|
123
|
+
contextline setup --host claude --root .contextline
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
To inspect the npm package contents before publishing:
|
|
127
|
+
|
|
128
|
+
```sh
|
|
129
|
+
npm pack --dry-run
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
## Publishing
|
|
133
|
+
|
|
134
|
+
Before publishing:
|
|
135
|
+
|
|
136
|
+
```sh
|
|
137
|
+
npm run build
|
|
138
|
+
npm test
|
|
139
|
+
npm pack --dry-run
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
Then publish:
|
|
143
|
+
|
|
144
|
+
```sh
|
|
145
|
+
npm publish --access public
|
|
146
|
+
git tag v0.2.0
|
|
147
|
+
git push origin main --tags
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
## Limitations
|
|
151
|
+
|
|
152
|
+
V1 intentionally excludes embeddings, vector search, cloud sync, databases, GUI, telemetry upload, team sharing, and automatic semantic classification.
|
|
153
|
+
|
|
154
|
+
Currently supported host setup is Codex and Claude Code.
|