@genspark/opencode-conversation-archiver 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 +16 -2
- package/USER_GUIDE.md +287 -0
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -11,7 +11,21 @@ records only user-visible text:
|
|
|
11
11
|
Reasoning, tool calls, tool outputs, file URLs, synthetic text, ignored text,
|
|
12
12
|
and child/subagent sessions are excluded.
|
|
13
13
|
|
|
14
|
-
## Install
|
|
14
|
+
## Install
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
opencode plugin -g @genspark/opencode-conversation-archiver@0.1.1
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Completely quit and restart OpenCode after installation. The first completed
|
|
21
|
+
turn is archived locally under `~/opencode-conversations` with no additional
|
|
22
|
+
setup.
|
|
23
|
+
|
|
24
|
+
See the [User Guide](./USER_GUIDE.md) for Second Brain connection, sharing one
|
|
25
|
+
remote repository with Claude Code, management commands, privacy details,
|
|
26
|
+
upgrades, troubleshooting, and removal.
|
|
27
|
+
|
|
28
|
+
## Install From Source
|
|
15
29
|
|
|
16
30
|
Build the package:
|
|
17
31
|
|
|
@@ -88,7 +102,7 @@ OpenCode SDK and current session identity.
|
|
|
88
102
|
|
|
89
103
|
## Second Brain
|
|
90
104
|
|
|
91
|
-
|
|
105
|
+
The CLI `connect` supports:
|
|
92
106
|
|
|
93
107
|
1. A one-time `.../sb-connect/<code>` URL.
|
|
94
108
|
2. No arguments, using `GSK_API_KEY` or the credential created by `gsk login`.
|
package/USER_GUIDE.md
ADDED
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
# OpenCode Conversation Archiver User Guide
|
|
2
|
+
|
|
3
|
+
OpenCode Conversation Archiver saves each top-level OpenCode chat as readable
|
|
4
|
+
Markdown and can synchronize it to a git repository. It archives completed
|
|
5
|
+
turns automatically without changing the conversation or blocking OpenCode.
|
|
6
|
+
|
|
7
|
+
## Requirements
|
|
8
|
+
|
|
9
|
+
- OpenCode `1.17.18` or newer, below `2.0.0`
|
|
10
|
+
- Git on `PATH`
|
|
11
|
+
- Node.js 20 or newer for the management CLI
|
|
12
|
+
|
|
13
|
+
## Install
|
|
14
|
+
|
|
15
|
+
Install globally so the plugin is available in every OpenCode project:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
opencode plugin -g @genspark/opencode-conversation-archiver@0.1.1
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
To enable it only in the current project, omit `-g`:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
opencode plugin @genspark/opencode-conversation-archiver@0.1.1
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
OpenCode writes the package to the selected `opencode.json`. On the next
|
|
28
|
+
startup it installs and caches the npm package automatically. Completely quit
|
|
29
|
+
and restart OpenCode after installing or upgrading the plugin.
|
|
30
|
+
|
|
31
|
+
To track the latest release rather than pinning a version:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
opencode plugin -g @genspark/opencode-conversation-archiver
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## First Conversation
|
|
38
|
+
|
|
39
|
+
No setup is required for local archiving. After the next completed OpenCode
|
|
40
|
+
turn, the plugin creates:
|
|
41
|
+
|
|
42
|
+
```text
|
|
43
|
+
~/opencode-conversations/
|
|
44
|
+
└── YYYY-MM/
|
|
45
|
+
└── YYYY-MM-DD-HHMM-conversation-title.md
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
The directory is initialized as a git repository. With no remote configured,
|
|
49
|
+
archives are committed locally and push failures never interrupt OpenCode.
|
|
50
|
+
|
|
51
|
+
Check the setup from a terminal:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
npx -y @genspark/opencode-conversation-archiver@0.1.1 status
|
|
55
|
+
npx -y @genspark/opencode-conversation-archiver@0.1.1 doctor
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
If the package is installed globally with npm, the shorter executable also
|
|
59
|
+
works:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
opencode-conversation-archiver status
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Connect Second Brain
|
|
66
|
+
|
|
67
|
+
Use one of these methods from a terminal. Connection credentials are never
|
|
68
|
+
accepted through an LLM-visible OpenCode tool.
|
|
69
|
+
|
|
70
|
+
### One-Time Link
|
|
71
|
+
|
|
72
|
+
Copy the Second Brain connection link and run:
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
npx -y @genspark/opencode-conversation-archiver@0.1.1 connect '<sb-connect-link>'
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### Existing Genspark CLI Login
|
|
79
|
+
|
|
80
|
+
If `gsk login` has already created a local credential, run:
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
npx -y @genspark/opencode-conversation-archiver@0.1.1 connect
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
The command can also use `GSK_API_KEY` from the environment.
|
|
87
|
+
|
|
88
|
+
### Explicit Git Remote
|
|
89
|
+
|
|
90
|
+
For another HTTP(S) git server:
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
npx -y @genspark/opencode-conversation-archiver@0.1.1 \
|
|
94
|
+
connect 'https://git.example.com/archive.git' '<token>' 'opencode'
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
`connect` succeeds only after the initial remote synchronization succeeds. A
|
|
98
|
+
partially configured connection with a failed first push exits nonzero so
|
|
99
|
+
scripts can detect and retry it.
|
|
100
|
+
|
|
101
|
+
## Share One Repository With Claude Code
|
|
102
|
+
|
|
103
|
+
Claude Code and OpenCode can synchronize to the same remote repository without
|
|
104
|
+
sharing a local working tree:
|
|
105
|
+
|
|
106
|
+
```text
|
|
107
|
+
Remote conversation repository
|
|
108
|
+
├── YYYY-MM/ Claude Code archives
|
|
109
|
+
└── opencode/
|
|
110
|
+
└── YYYY-MM/ OpenCode archives
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
Recommended local layout:
|
|
114
|
+
|
|
115
|
+
```text
|
|
116
|
+
~/claude-conversations/ Claude Code clone and locks
|
|
117
|
+
~/opencode-conversations/ OpenCode clone and locks
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
Connect OpenCode to the same remote/token used by Claude Code, with `opencode`
|
|
121
|
+
as the subdirectory. The default Second Brain connection already uses this
|
|
122
|
+
layout.
|
|
123
|
+
|
|
124
|
+
Do not point both plugins at the same local clone. Each plugin performs its own
|
|
125
|
+
commit, rebase, push, state tracking, and locking. Separate clones prevent one
|
|
126
|
+
plugin from staging the other plugin's in-progress files while still producing
|
|
127
|
+
one combined remote history.
|
|
128
|
+
|
|
129
|
+
## Daily Use
|
|
130
|
+
|
|
131
|
+
Automatic mode is enabled by default. Each changed completed turn is written,
|
|
132
|
+
committed, and pushed in the background when a remote exists.
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
# Show mode, repository, redacted remote, recent commits, and pending changes
|
|
136
|
+
npx -y @genspark/opencode-conversation-archiver@0.1.1 status
|
|
137
|
+
|
|
138
|
+
# Run read-only dependency, repository, and remote checks
|
|
139
|
+
npx -y @genspark/opencode-conversation-archiver@0.1.1 doctor
|
|
140
|
+
|
|
141
|
+
# Keep writing Markdown locally without commit or push
|
|
142
|
+
npx -y @genspark/opencode-conversation-archiver@0.1.1 manual
|
|
143
|
+
|
|
144
|
+
# Restore automatic commit and push
|
|
145
|
+
npx -y @genspark/opencode-conversation-archiver@0.1.1 auto
|
|
146
|
+
|
|
147
|
+
# Commit and push pending archives immediately
|
|
148
|
+
npx -y @genspark/opencode-conversation-archiver@0.1.1 upload
|
|
149
|
+
|
|
150
|
+
# Send future local archives to another dedicated clone
|
|
151
|
+
npx -y @genspark/opencode-conversation-archiver@0.1.1 \
|
|
152
|
+
repo ~/Documents/opencode-conversations
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
The `repo` command repoints future archives. It does not move or delete the old
|
|
156
|
+
repository.
|
|
157
|
+
|
|
158
|
+
## OpenCode Tools
|
|
159
|
+
|
|
160
|
+
The plugin gives OpenCode four tools:
|
|
161
|
+
|
|
162
|
+
| Tool | Behavior |
|
|
163
|
+
| --- | --- |
|
|
164
|
+
| `conversation_archive_status` | Read-only archive status |
|
|
165
|
+
| `conversation_archive_doctor` | Read-only diagnostics |
|
|
166
|
+
| `conversation_archive_current` | Archive the current top-level project session after permission approval |
|
|
167
|
+
| `conversation_archive_backfill` | Archive existing top-level sessions in the current project after permission approval |
|
|
168
|
+
|
|
169
|
+
Examples to type in OpenCode:
|
|
170
|
+
|
|
171
|
+
```text
|
|
172
|
+
Check my conversation archive status.
|
|
173
|
+
Diagnose my conversation archive.
|
|
174
|
+
Archive this conversation now.
|
|
175
|
+
Backfill this project's existing conversations.
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
Repository paths, modes, uploads, connection links, and tokens are CLI-only so
|
|
179
|
+
those values do not enter the model conversation.
|
|
180
|
+
|
|
181
|
+
## What Is Saved
|
|
182
|
+
|
|
183
|
+
Saved:
|
|
184
|
+
|
|
185
|
+
- User-visible user text
|
|
186
|
+
- User-visible assistant text
|
|
187
|
+
- Context compaction boundaries
|
|
188
|
+
- Session ID, start time, title, machine name, and turn count
|
|
189
|
+
|
|
190
|
+
Not saved:
|
|
191
|
+
|
|
192
|
+
- Reasoning parts
|
|
193
|
+
- Tool calls and tool outputs
|
|
194
|
+
- Uploaded file URLs
|
|
195
|
+
- Synthetic or ignored text parts
|
|
196
|
+
- Child/subagent sessions
|
|
197
|
+
- Git credentials
|
|
198
|
+
|
|
199
|
+
Credentials are stored outside the archive repository at:
|
|
200
|
+
|
|
201
|
+
```text
|
|
202
|
+
~/.config/opencode/conversation-archiver/git-credentials
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
The file is created with mode `0600`. Status, doctor, and logs redact
|
|
206
|
+
credentials embedded in HTTP(S) URLs.
|
|
207
|
+
|
|
208
|
+
## Configuration And Files
|
|
209
|
+
|
|
210
|
+
Runtime configuration:
|
|
211
|
+
|
|
212
|
+
```text
|
|
213
|
+
~/.config/opencode/conversation-archiver/config.json
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
Runtime state and logs:
|
|
217
|
+
|
|
218
|
+
```text
|
|
219
|
+
~/.config/opencode/conversation-archiver/state/
|
|
220
|
+
~/.config/opencode/conversation-archiver/archive.log
|
|
221
|
+
~/.config/opencode/conversation-archiver/push.log
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
Environment overrides:
|
|
225
|
+
|
|
226
|
+
| Variable | Purpose |
|
|
227
|
+
| --- | --- |
|
|
228
|
+
| `OPENCODE_ARCHIVE_MODE` | `auto` or `manual` |
|
|
229
|
+
| `OPENCODE_ARCHIVE_REPO` | Override the local archive clone |
|
|
230
|
+
| `OPENCODE_ARCHIVE_NO_NOTIFY` | Disable terminal completion notification when set |
|
|
231
|
+
|
|
232
|
+
## Upgrade
|
|
233
|
+
|
|
234
|
+
Install a newer version with `--force`, then restart OpenCode:
|
|
235
|
+
|
|
236
|
+
```bash
|
|
237
|
+
opencode plugin -g -f @genspark/opencode-conversation-archiver@0.1.1
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
Your Markdown repository and runtime state are outside OpenCode's plugin cache
|
|
241
|
+
and remain in place across upgrades.
|
|
242
|
+
|
|
243
|
+
## Troubleshooting
|
|
244
|
+
|
|
245
|
+
### No Markdown Appears
|
|
246
|
+
|
|
247
|
+
1. Completely restart OpenCode after installation.
|
|
248
|
+
2. Finish a top-level conversation turn; child/subagent sessions are excluded.
|
|
249
|
+
3. Run `doctor` and confirm Git is available.
|
|
250
|
+
4. Check the configured repository shown by `status`.
|
|
251
|
+
|
|
252
|
+
### Local Commit Exists But Remote Is Behind
|
|
253
|
+
|
|
254
|
+
Run:
|
|
255
|
+
|
|
256
|
+
```bash
|
|
257
|
+
npx -y @genspark/opencode-conversation-archiver@0.1.1 upload
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
Then run `doctor`. It tests remote authentication without printing the token.
|
|
261
|
+
The plugin serializes pushes and performs `pull --rebase` before pushing, so a
|
|
262
|
+
Claude Code commit arriving first is integrated into the same remote history.
|
|
263
|
+
|
|
264
|
+
### Connect Link Does Not Work
|
|
265
|
+
|
|
266
|
+
One-time links can expire or be consumed once. Generate a new link and run the
|
|
267
|
+
CLI command again. Do not paste the link into an OpenCode chat.
|
|
268
|
+
|
|
269
|
+
### OpenCode Loads The Plugin Twice
|
|
270
|
+
|
|
271
|
+
Check both global and project `opencode.json`. Keep one npm entry unless you
|
|
272
|
+
intentionally need different project-specific options. A local plugin file and
|
|
273
|
+
an npm plugin are separate and can both load.
|
|
274
|
+
|
|
275
|
+
## Remove
|
|
276
|
+
|
|
277
|
+
Remove `@genspark/opencode-conversation-archiver` from the `plugin` array in the
|
|
278
|
+
project or global `opencode.json`, then restart OpenCode.
|
|
279
|
+
|
|
280
|
+
Uninstalling does not delete either of these locations:
|
|
281
|
+
|
|
282
|
+
```text
|
|
283
|
+
~/opencode-conversations/
|
|
284
|
+
~/.config/opencode/conversation-archiver/
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
Delete or retain them according to your own backup policy.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@genspark/opencode-conversation-archiver",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Archive OpenCode conversations as readable Markdown in a git repository",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"opencode",
|
|
@@ -33,7 +33,8 @@
|
|
|
33
33
|
},
|
|
34
34
|
"files": [
|
|
35
35
|
"dist",
|
|
36
|
-
"README.md"
|
|
36
|
+
"README.md",
|
|
37
|
+
"USER_GUIDE.md"
|
|
37
38
|
],
|
|
38
39
|
"bin": {
|
|
39
40
|
"opencode-conversation-archiver": "./dist/cli.js"
|