clikit-plugin 0.2.28 → 0.2.30
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/AGENTS.md +30 -32
- package/README.md +45 -26
- package/command/create.md +37 -122
- package/command/handoff.md +45 -69
- package/command/init.md +125 -48
- package/command/plan.md +101 -159
- package/command/research.md +1 -1
- package/command/resume.md +34 -55
- package/command/vision.md +132 -64
- package/dist/.tsbuildinfo +1 -0
- package/dist/agents/index.d.ts.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +95 -11
- package/dist/clikit.schema.json +245 -0
- package/dist/commands/index.d.ts.map +1 -1
- package/dist/config.d.ts +43 -43
- package/dist/config.d.ts.map +1 -1
- package/dist/hooks/git-guard.test.d.ts +2 -0
- package/dist/hooks/git-guard.test.d.ts.map +1 -0
- package/dist/hooks/index.d.ts +3 -14
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/memory-digest.d.ts +27 -0
- package/dist/hooks/memory-digest.d.ts.map +1 -0
- package/dist/hooks/security-check.test.d.ts +2 -0
- package/dist/hooks/security-check.test.d.ts.map +1 -0
- package/dist/hooks/todo-beads-sync.d.ts +23 -0
- package/dist/hooks/todo-beads-sync.d.ts.map +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +740 -909
- package/dist/skills/index.d.ts.map +1 -1
- package/dist/tools/beads-memory-sync.d.ts.map +1 -1
- package/dist/tools/context-summary.d.ts.map +1 -1
- package/dist/tools/memory-db.d.ts +12 -0
- package/dist/tools/memory-db.d.ts.map +1 -0
- package/dist/tools/memory.d.ts.map +1 -1
- package/dist/tools/observation.d.ts.map +1 -1
- package/memory/_templates/plan.md +18 -0
- package/package.json +7 -4
- package/src/agents/AGENTS.md +11 -39
- package/src/agents/build.md +152 -94
- package/src/agents/index.ts +31 -5
- package/src/agents/looker.md +5 -0
- package/src/agents/oracle.md +2 -0
- package/src/agents/plan.md +247 -44
- package/src/agents/review.md +1 -0
- package/src/agents/vision.md +251 -115
- package/dist/cli.test.d.ts +0 -2
- package/dist/cli.test.d.ts.map +0 -1
- package/dist/hooks/auto-format.d.ts +0 -30
- package/dist/hooks/auto-format.d.ts.map +0 -1
- package/dist/hooks/comment-checker.d.ts +0 -17
- package/dist/hooks/comment-checker.d.ts.map +0 -1
- package/dist/hooks/compaction.d.ts +0 -60
- package/dist/hooks/compaction.d.ts.map +0 -1
- package/dist/hooks/env-context.d.ts +0 -43
- package/dist/hooks/env-context.d.ts.map +0 -1
- package/dist/hooks/ritual-enforcer.d.ts +0 -29
- package/dist/hooks/ritual-enforcer.d.ts.map +0 -1
- package/dist/hooks/session-notification.d.ts +0 -23
- package/dist/hooks/session-notification.d.ts.map +0 -1
- package/dist/hooks/session-notification.test.d.ts +0 -2
- package/dist/hooks/session-notification.test.d.ts.map +0 -1
- package/dist/hooks/typecheck-gate.d.ts +0 -31
- package/dist/hooks/typecheck-gate.d.ts.map +0 -1
- package/memory/handoffs/2026-02-15-complete-audit.md +0 -136
- package/memory/handoffs/2026-02-15-complete-fix.md +0 -140
- package/memory/handoffs/2026-02-15-importmeta-fix.md +0 -121
- package/memory/handoffs/2026-02-15-installing.md +0 -90
- package/memory/handoffs/2026-02-15-plugin-install-fix.md +0 -140
- package/memory/handoffs/2026-02-15-runtime-fixes.md +0 -80
- package/memory/plans/2026-02-16-plugin-install.md +0 -195
- package/memory/research/2026-02-16-opencode-plugin-alignment.md +0 -128
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
date: 2026-02-15
|
|
3
|
-
phase: implementing
|
|
4
|
-
branch: main
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Handoff: CliKit Runtime Bug Fixes
|
|
8
|
-
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
## Status Summary
|
|
12
|
-
|
|
13
|
-
CliKit plugin v0.2.3 published with installer merge fix and type guards in hooks. **NEW ISSUES IDENTIFIED**:
|
|
14
|
-
1. Backup creation is now unnecessary since merge works correctly - should be removed
|
|
15
|
-
2. Runtime error `todos.filter is not a function` when OpenCode starts
|
|
16
|
-
|
|
17
|
-
---
|
|
18
|
-
|
|
19
|
-
## Task Status
|
|
20
|
-
|
|
21
|
-
### ✅ Completed
|
|
22
|
-
- [x] Fix installer to MERGE with existing opencode.json (v0.2.3)
|
|
23
|
-
- [x] Add defensive type checks to hooks (truncator, security-check, compaction)
|
|
24
|
-
- [x] Publish v0.2.1, v0.2.2, v0.2.3 to npm
|
|
25
|
-
|
|
26
|
-
### 🔄 In Progress
|
|
27
|
-
- [ ] Remove backup creation from cli.ts
|
|
28
|
-
- [ ] Fix `todos.filter is not a function` runtime error
|
|
29
|
-
|
|
30
|
-
### 📋 Not Started
|
|
31
|
-
- [ ] Publish v0.2.4
|
|
32
|
-
|
|
33
|
-
---
|
|
34
|
-
|
|
35
|
-
## Files Modified
|
|
36
|
-
|
|
37
|
-
| File | Status | Notes |
|
|
38
|
-
|------|--------|-------|
|
|
39
|
-
| `.opencode/src/cli.ts` | Needs Fix | Remove backup logic |
|
|
40
|
-
| `.opencode/src/index.ts` | Needs Fix | Add Array.isArray check |
|
|
41
|
-
| `.opencode/src/hooks/todo-enforcer.ts` | Needs Fix | Add array guard |
|
|
42
|
-
|
|
43
|
-
---
|
|
44
|
-
|
|
45
|
-
## Git State
|
|
46
|
-
|
|
47
|
-
- **Branch:** `main`
|
|
48
|
-
- **Last commit:** `31b200c` - Update README with simplified installation
|
|
49
|
-
- **Uncommitted changes:** Yes (8 modified files)
|
|
50
|
-
|
|
51
|
-
---
|
|
52
|
-
|
|
53
|
-
## Next Steps
|
|
54
|
-
|
|
55
|
-
1. [ ] Remove backup logic from cli.ts (delete `backupConfig`, `cleanupOldBackups` functions)
|
|
56
|
-
2. [ ] Fix `todos.filter` error in `index.ts:172` and `todo-enforcer.ts:20`
|
|
57
|
-
3. [ ] Run typecheck
|
|
58
|
-
4. [ ] Publish v0.2.4
|
|
59
|
-
|
|
60
|
-
---
|
|
61
|
-
|
|
62
|
-
## Root Cause: `todos.filter` Bug
|
|
63
|
-
|
|
64
|
-
```typescript
|
|
65
|
-
// Current (broken) - index.ts:166-172
|
|
66
|
-
const todos = props?.todos as Array<{...}> | undefined;
|
|
67
|
-
if (todos && todos.length > 0) { // Objects with .length pass this!
|
|
68
|
-
checkTodoCompletion(todos); // But .filter fails
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
// Fix
|
|
72
|
-
if (Array.isArray(todos) && todos.length > 0) {
|
|
73
|
-
checkTodoCompletion(todos);
|
|
74
|
-
}
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
**Key files:**
|
|
78
|
-
- `.opencode/src/cli.ts:78-107` — Backup functions to delete
|
|
79
|
-
- `.opencode/src/index.ts:165-180` — Todo handling to fix
|
|
80
|
-
- `.opencode/src/hooks/todo-enforcer.ts:20` — Add array guard
|
|
@@ -1,195 +0,0 @@
|
|
|
1
|
-
# Implementation Plan: Align CliKit Plugin Installation with OpenCode
|
|
2
|
-
|
|
3
|
-
**Date:** 2026-02-16
|
|
4
|
-
**Author:** Plan Agent
|
|
5
|
-
**Status:** Draft
|
|
6
|
-
**bead_id:** clikit-plugin
|
|
7
|
-
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
## Overview
|
|
11
|
-
|
|
12
|
-
Define and implement an installation and configuration workflow for CliKit that mirrors Oh My OpenCode’s opinionated setup. This includes documenting the desired behavior, creating a CLI installer that automates plugin registration and config scaffolding, and updating guidance so users can reliably install via npm/local files following OpenCode’s documented plugin system.
|
|
13
|
-
|
|
14
|
-
## References
|
|
15
|
-
|
|
16
|
-
- **Spec:** *(not provided)*
|
|
17
|
-
- **PRD:** *(not provided)*
|
|
18
|
-
- **Research:** `.opencode/memory/research/2026-02-16-opencode-plugin-alignment.md` *(planned; current knowledge from repo/docs review)*
|
|
19
|
-
|
|
20
|
-
---
|
|
21
|
-
|
|
22
|
-
## Tasks
|
|
23
|
-
|
|
24
|
-
### Task 1: Capture Target Installation Workflow
|
|
25
|
-
|
|
26
|
-
| Field | Value |
|
|
27
|
-
|-------|-------|
|
|
28
|
-
| **task_id** | T-001 |
|
|
29
|
-
| **type** | task |
|
|
30
|
-
| **assignee** | build |
|
|
31
|
-
| **effort** | S |
|
|
32
|
-
| **priority** | P1 |
|
|
33
|
-
| **status** | not_started |
|
|
34
|
-
| **dependencies** | none |
|
|
35
|
-
|
|
36
|
-
**Description:**
|
|
37
|
-
Summarize Oh My OpenCode’s installation behavior (CLI prompts, subscription flags, config injection) and map each requirement to CliKit. Produce a short design note describing which steps we will replicate and which remain optional.
|
|
38
|
-
|
|
39
|
-
**Input:**
|
|
40
|
-
- README + docs from `code-yeongyu/oh-my-opencode`
|
|
41
|
-
- OpenCode plugin docs (`opencode.ai/docs/plugins`)
|
|
42
|
-
|
|
43
|
-
**Output:**
|
|
44
|
-
- Design note (e.g., `.opencode/memory/research/2026-02-16-opencode-plugin-alignment.md`)
|
|
45
|
-
- Checklist of actions installer must perform
|
|
46
|
-
|
|
47
|
-
**Acceptance Criteria:**
|
|
48
|
-
- [ ] AC-01: Clearly list each step Oh My OpenCode installer performs.
|
|
49
|
-
- [ ] AC-02: Define corresponding CliKit behavior (adopt/skip) with rationale.
|
|
50
|
-
|
|
51
|
-
**Boundaries:**
|
|
52
|
-
- Do not implement code changes here—documentation/research only.
|
|
53
|
-
|
|
54
|
-
---
|
|
55
|
-
|
|
56
|
-
### Task 2: Implement CliKit Installer CLI
|
|
57
|
-
|
|
58
|
-
| Field | Value |
|
|
59
|
-
|-------|-------|
|
|
60
|
-
| **task_id** | T-002 |
|
|
61
|
-
| **type** | feature |
|
|
62
|
-
| **assignee** | build |
|
|
63
|
-
| **effort** | M |
|
|
64
|
-
| **priority** | P0 |
|
|
65
|
-
| **status** | not_started |
|
|
66
|
-
| **dependencies** | [T-001] |
|
|
67
|
-
|
|
68
|
-
**Description:**
|
|
69
|
-
Create a `bunx clikit-plugin install` command paralleling Oh My OpenCode: accept provider flags, update `opencode.json` plugin array, scaffold `.opencode/clikit.config.json`, and emit post-install instructions. Include validation (prevent duplicates) and support non-interactive defaults.
|
|
70
|
-
|
|
71
|
-
**Input:**
|
|
72
|
-
- Output of Task 1 design note
|
|
73
|
-
- Existing `.opencode/plugin.ts`, `.opencode/src/config.ts`
|
|
74
|
-
|
|
75
|
-
**Output:**
|
|
76
|
-
- CLI script (likely under `.opencode/script/install.ts` or package bin entry)
|
|
77
|
-
- Updated package metadata so command is published
|
|
78
|
-
- Tests or manual verification steps documenting expected behavior
|
|
79
|
-
|
|
80
|
-
**Acceptance Criteria:**
|
|
81
|
-
- [ ] AC-01: Running installer registers CliKit in `plugin` array when absent and is idempotent.
|
|
82
|
-
- [ ] AC-02: Installer writes/merges config template without overwriting user overrides.
|
|
83
|
-
- [ ] AC-03: Help text documents supported flags modeled after Oh My OpenCode.
|
|
84
|
-
|
|
85
|
-
**Boundaries:**
|
|
86
|
-
- Do not modify runtime hook logic; focus on installer.
|
|
87
|
-
|
|
88
|
-
---
|
|
89
|
-
|
|
90
|
-
### Task 3: Update Documentation and Verification Guide
|
|
91
|
-
|
|
92
|
-
| Field | Value |
|
|
93
|
-
|-------|-------|
|
|
94
|
-
| **task_id** | T-003 |
|
|
95
|
-
| **type** | chore |
|
|
96
|
-
| **assignee** | build |
|
|
97
|
-
| **effort** | S |
|
|
98
|
-
| **priority** | P1 |
|
|
99
|
-
| **status** | not_started |
|
|
100
|
-
| **dependencies** | [T-002] |
|
|
101
|
-
|
|
102
|
-
**Description:**
|
|
103
|
-
Revise `.opencode/README.md` and root `README.md` to outline installation paths (npm + installer, manual config). Include verification steps (opencode version check, config inspection) and troubleshooting tips inspired by Oh My OpenCode docs.
|
|
104
|
-
|
|
105
|
-
**Input:**
|
|
106
|
-
- Completed installer features
|
|
107
|
-
- Task 1 research checklist
|
|
108
|
-
|
|
109
|
-
**Output:**
|
|
110
|
-
- Updated documentation referencing new CLI command, load order, and auth reminders
|
|
111
|
-
|
|
112
|
-
**Acceptance Criteria:**
|
|
113
|
-
- [ ] AC-01: README contains explicit step-by-step instructions mirroring OpenCode plugin docs.
|
|
114
|
-
- [ ] AC-02: Adds warning about not disabling core features unless required.
|
|
115
|
-
- [ ] AC-03: Describes verification commands post-install.
|
|
116
|
-
|
|
117
|
-
**Boundaries:**
|
|
118
|
-
- Do not duplicate entire Oh My OpenCode README—only relevant sections.
|
|
119
|
-
|
|
120
|
-
---
|
|
121
|
-
|
|
122
|
-
## File Impact
|
|
123
|
-
|
|
124
|
-
**Files to CREATE:**
|
|
125
|
-
- `.opencode/memory/research/2026-02-16-opencode-plugin-alignment.md` — research note from Task 1
|
|
126
|
-
- `script/install.ts` (or equivalent CLI entry) — new installer command logic
|
|
127
|
-
|
|
128
|
-
**Files to MODIFY:**
|
|
129
|
-
- `package.json` — add bin entry & dependencies for installer
|
|
130
|
-
- `.opencode/README.md` — refreshed installation instructions
|
|
131
|
-
- `README.md` — high-level install overview referencing CLI
|
|
132
|
-
- `.opencode/src/config.ts` — ensure config loader supports templates/merging if needed by installer
|
|
133
|
-
- `.opencode/script/` helpers (if reused) — support CLI utilities
|
|
134
|
-
|
|
135
|
-
**Files to DELETE:**
|
|
136
|
-
- (none)
|
|
137
|
-
|
|
138
|
-
---
|
|
139
|
-
|
|
140
|
-
## Dependencies
|
|
141
|
-
|
|
142
|
-
```mermaid
|
|
143
|
-
graph TD
|
|
144
|
-
T001[T-001: Capture Target Installation Workflow] --> T002[T-002: Implement CliKit Installer CLI]
|
|
145
|
-
T002 --> T003[T-003: Update Documentation and Verification Guide]
|
|
146
|
-
```
|
|
147
|
-
|
|
148
|
-
---
|
|
149
|
-
|
|
150
|
-
## Effort Summary
|
|
151
|
-
|
|
152
|
-
| Task | Effort | Priority |
|
|
153
|
-
|------|--------|----------|
|
|
154
|
-
| T-001 | S | P1 |
|
|
155
|
-
| T-002 | M | P0 |
|
|
156
|
-
| T-003 | S | P1 |
|
|
157
|
-
|
|
158
|
-
**Total Estimated Effort:** ~3-4 days (including testing & docs)
|
|
159
|
-
|
|
160
|
-
---
|
|
161
|
-
|
|
162
|
-
## Risk Assessment
|
|
163
|
-
|
|
164
|
-
| Risk | Probability | Impact | Mitigation |
|
|
165
|
-
|------|-------------|--------|------------|
|
|
166
|
-
| Installer overwrites user config | M | M | Implement merge logic with backups + prompts |
|
|
167
|
-
| CLI divergence from OpenCode expectations | M | H | Validate against official plugin docs; add tests for load order |
|
|
168
|
-
| Users skip auth steps leading to failures | H | M | Add prominent warnings & post-install checklist |
|
|
169
|
-
|
|
170
|
-
---
|
|
171
|
-
|
|
172
|
-
## Quick Mode Eligibility
|
|
173
|
-
|
|
174
|
-
Tasks eligible for Quick Mode (no full plan needed):
|
|
175
|
-
- [ ] T-001 (requires research + documentation > 3 files)
|
|
176
|
-
- [ ] T-002 (installer touches multiple files, so not eligible)
|
|
177
|
-
- [ ] T-003 (docs updates only but depends on T-002 completion)
|
|
178
|
-
|
|
179
|
-
---
|
|
180
|
-
|
|
181
|
-
## Rollout Plan
|
|
182
|
-
|
|
183
|
-
| Phase | Tasks | Milestone |
|
|
184
|
-
|-------|-------|-----------|
|
|
185
|
-
| Phase 1 | T-001 | Approved installation blueprint |
|
|
186
|
-
| Phase 2 | T-002 | Installer CLI ready & manually verified |
|
|
187
|
-
| Phase 3 | T-003 | Documentation updated & user walkthrough published |
|
|
188
|
-
|
|
189
|
-
---
|
|
190
|
-
|
|
191
|
-
## Approval
|
|
192
|
-
|
|
193
|
-
- [ ] Plan reviewed
|
|
194
|
-
- [ ] User approved
|
|
195
|
-
- [ ] Ready for implementation
|
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
topic: "Oh My OpenCode Installer Behavior"
|
|
3
|
-
date: 2026-02-16
|
|
4
|
-
confidence: high
|
|
5
|
-
depth: deep
|
|
6
|
-
versions:
|
|
7
|
-
- library: "oh-my-opencode"
|
|
8
|
-
version: "3.5.5"
|
|
9
|
-
bead_id: clikit-plugin
|
|
10
|
-
---
|
|
11
|
-
|
|
12
|
-
# Research: Oh My OpenCode Installer
|
|
13
|
-
|
|
14
|
-
**Question:** How does oh-my-opencode's installer configure OpenCode and what pieces should CliKit replicate?
|
|
15
|
-
|
|
16
|
-
---
|
|
17
|
-
|
|
18
|
-
## Summary
|
|
19
|
-
|
|
20
|
-
Oh My OpenCode's CLI installer (`bunx oh-my-opencode install`) performs a six-step workflow: it validates CLI args, checks for the OpenCode binary/version, ensures the plugin entry exists in `opencode.json`, optionally installs auth/provider configs (Gemini et al.), writes/merges a dedicated `oh-my-opencode` config file, and prints guidance/warnings. Config files live under both the global config dir (`~/.config/opencode`) and per-project `.opencode`. CliKit's installer should mirror the config detection/merge logic and idempotent plugin registration.
|
|
21
|
-
|
|
22
|
-
---
|
|
23
|
-
|
|
24
|
-
## Key Findings
|
|
25
|
-
|
|
26
|
-
### Finding 1: Installer Flow Mirrors Documented Steps
|
|
27
|
-
- `runCliInstaller` (dist/cli/index.js) orchestrates 6 numbered steps: detect OpenCode binary/version, add plugin entry, add auth plugins (conditional), add provider config (conditional), and write final `oh-my-opencode` config before printing summary boxes.
|
|
28
|
-
- Non-interactive mode requires explicit provider flags (`--claude`, `--gemini`, `--copilot`, etc.); otherwise TUI handles prompts.
|
|
29
|
-
- Failure at any sub-step aborts with contextual error text (`formatErrorWithSuggestion`).
|
|
30
|
-
|
|
31
|
-
### Finding 2: Plugin Registration Logic is Idempotent
|
|
32
|
-
- `addPluginToOpenCodeConfig(version)` ensures `~/.config/opencode/opencode.json[c]` exists, parses JSON/JSONC, removes prior `oh-my-opencode` entries, and writes the latest pinned version string (e.g., `oh-my-opencode@3.5.5`).
|
|
33
|
-
- JSONC files are updated by regex replacement to preserve comments/formatting; JSON files are re-serialized.
|
|
34
|
-
- This mirrors what CliKit's installer must do for `clikit-plugin`, including detection of config dir via `getOpenCodeConfigDir` semantics.
|
|
35
|
-
|
|
36
|
-
### Finding 3: Config Merge Targets Global + Project Paths
|
|
37
|
-
- `writeOmoConfig` writes `oh-my-opencode.json` (or `.jsonc`) inside `~/.config/opencode/oh-my-opencode.*`, using `deepMergeRecord` against existing JSONC.
|
|
38
|
-
- Loader functions (e.g., `loadPluginConfig`) look at both global config dir and per-project `.opencode/oh-my-opencode.*`, merging project overrides atop global defaults.
|
|
39
|
-
- Ensuring CliKit's installer writes `~/.config/opencode/clikit.config.json` (global) while respecting `.opencode/clikit.config.json` matches OpenCode expectations.
|
|
40
|
-
|
|
41
|
-
### Finding 4: Ancillary Setup (Auth, Providers, bun install)
|
|
42
|
-
- When Gemini support is requested, installer calls `addAuthPlugins` and `addProviderConfig` to inject additional packages/config references.
|
|
43
|
-
- After plugin or binary updates, oh-my-opencode optionally runs `bun install` inside the config dir to ensure dependencies exist (`runBunInstall`).
|
|
44
|
-
- CliKit may not need auth/provider hooks yet but should adopt the same structure for future flags, and consider invoking `bun install` when copying template files that introduce dependencies.
|
|
45
|
-
|
|
46
|
-
---
|
|
47
|
-
|
|
48
|
-
## Comparison
|
|
49
|
-
|
|
50
|
-
| Aspect | Oh My OpenCode | Current CliKit | Gap |
|
|
51
|
-
|--------|----------------|----------------|-----|
|
|
52
|
-
| Plugin registration | Adds/updates versioned entry in `plugin` array with JSONC-safe merge | Adds bare `clikit-plugin` without version, no JSONC handling | Need versioned entry + JSONC-safe edits |
|
|
53
|
-
| Config scaffolding | Writes `oh-my-opencode.json` w/ deep merge fallback | Writes `clikit.config.json` only if missing, no merge | Implement deep merge + JSONC parse guard |
|
|
54
|
-
| Provider/auth flags | Supports `--claude`, `--gemini`, `--copilot`, `--opencode-zen`, etc. | No flags | Evaluate minimal flag set / defaults |
|
|
55
|
-
| Dependency setup | Runs `bun install` when necessary | None | Optional follow-up |
|
|
56
|
-
| Project overrides | Loader merges global + `.opencode/oh-my-opencode.*` | Loader already merges `~/.config` + project `.opencode` | Already aligned |
|
|
57
|
-
|
|
58
|
-
---
|
|
59
|
-
|
|
60
|
-
## Code Examples
|
|
61
|
-
|
|
62
|
-
### Example 1: Adding Plugin Entry (pseudo-extracted)
|
|
63
|
-
```ts
|
|
64
|
-
const pluginEntry = await getPluginNameWithVersion(currentVersion);
|
|
65
|
-
const parseResult = parseOpenCodeConfigFileWithError(path);
|
|
66
|
-
const plugins = (parseResult.config.plugin ?? []).filter(
|
|
67
|
-
(p) => !p.startsWith("oh-my-opencode")
|
|
68
|
-
);
|
|
69
|
-
plugins.push(pluginEntry);
|
|
70
|
-
writeConfigPreservingFormat(path, plugins);
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
### Example 2: Writing Config with Deep Merge
|
|
74
|
-
```ts
|
|
75
|
-
const omoConfigPath = getOmoConfigPath();
|
|
76
|
-
const newConfig = generateOmoConfig(installConfig);
|
|
77
|
-
if (existsSync(omoConfigPath)) {
|
|
78
|
-
const existing = parseJsonc(readFileSync(omoConfigPath, "utf8"));
|
|
79
|
-
const merged = deepMergeRecord(existing, newConfig);
|
|
80
|
-
writeFileSync(omoConfigPath, JSON.stringify(merged, null, 2));
|
|
81
|
-
} else {
|
|
82
|
-
writeFileSync(omoConfigPath, JSON.stringify(newConfig, null, 2));
|
|
83
|
-
}
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
---
|
|
87
|
-
|
|
88
|
-
## Recommendation
|
|
89
|
-
|
|
90
|
-
**Recommended approach:** Reimplement CliKit's installer to follow Oh My OpenCode's structure.
|
|
91
|
-
|
|
92
|
-
**Rationale:**
|
|
93
|
-
1. Users already expect the oh-my-opencode workflow; mirroring it reduces friction.
|
|
94
|
-
2. JSONC-safe merging and versioned plugin entries prevent config corruption and enable updates.
|
|
95
|
-
3. Aligning directories and merge logic ensures compatibility with OpenCode's plugin loader (global + project overrides).
|
|
96
|
-
|
|
97
|
-
---
|
|
98
|
-
|
|
99
|
-
## Verification Steps
|
|
100
|
-
|
|
101
|
-
- [ ] Validate installer on machines with `opencode.json` and `opencode.jsonc` variants.
|
|
102
|
-
- [ ] Confirm repeated `bun x clikit-plugin install` leaves config unchanged and updates version.
|
|
103
|
-
- [ ] Ensure `.opencode/clikit.config.json` overrides global values after install.
|
|
104
|
-
|
|
105
|
-
---
|
|
106
|
-
|
|
107
|
-
## Open Questions
|
|
108
|
-
|
|
109
|
-
- [ ] Which provider flags should CliKit expose initially (Claude-only vs. multi-provider)?
|
|
110
|
-
- [ ] Do we need to run `bun install` inside `~/.config/opencode` after copying CliKit assets?
|
|
111
|
-
|
|
112
|
-
---
|
|
113
|
-
|
|
114
|
-
## Sources
|
|
115
|
-
|
|
116
|
-
| Source | Type | Reliability |
|
|
117
|
-
|--------|------|-------------|
|
|
118
|
-
| `oh-my-opencode@3.5.5` package (`dist/cli/index.js`, `postinstall.mjs`) | Source | High |
|
|
119
|
-
| OpenCode config conventions from oh-my-opencode loader | Source | High |
|
|
120
|
-
|
|
121
|
-
---
|
|
122
|
-
|
|
123
|
-
## Version Notes
|
|
124
|
-
|
|
125
|
-
| Library/Tool | Version Researched | Current Latest | Notes |
|
|
126
|
-
|--------------|-------------------|----------------|-------|
|
|
127
|
-
| oh-my-opencode | 3.5.5 | 3.5.5 | Latest on npm during research |
|
|
128
|
-
| clikit-plugin | 0.2.20 | 0.2.20 | Installer work in progress |
|