@cubocompany/opengem 0.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.
package/README.md ADDED
@@ -0,0 +1,136 @@
1
+ # Obsidian OpenCode Plugin
2
+
3
+ OpenCode plugin that bundles Obsidian skills metadata and exposes MVP Obsidian CLI-backed tools.
4
+
5
+ ## Requirements
6
+
7
+ - [OpenCode](https://opencode.ai) installed
8
+ - [Obsidian](https://obsidian.md) desktop app running
9
+ - [obsidian CLI](https://github.com/obsidianmd/obsidian-cli) installed and on PATH
10
+
11
+ ## Install
12
+
13
+ ### From npm (recommended)
14
+
15
+ Add the plugin to your `opencode.json`:
16
+
17
+ ```json
18
+ {
19
+ "plugin": ["obsidian-opencode-plugin"]
20
+ }
21
+ ```
22
+
23
+ ### Local development
24
+
25
+ Clone the repository and link it via `.opencode/plugins/`:
26
+
27
+ ```bash
28
+ git clone https://github.com/your-org/obsidian-opencode-plugin
29
+ cd obsidian-opencode-plugin
30
+ bun install
31
+ ```
32
+
33
+ Then add to your `opencode.json`:
34
+
35
+ ```json
36
+ {
37
+ "plugin": ["/absolute/path/to/obsidian-opencode-plugin/src/index.ts"]
38
+ }
39
+ ```
40
+
41
+ ## Configuration
42
+
43
+ Pass options in `opencode.json`:
44
+
45
+ ```json
46
+ {
47
+ "plugin": [
48
+ ["obsidian-opencode-plugin", {
49
+ "defaultVault": "My Vault"
50
+ }]
51
+ ]
52
+ }
53
+ ```
54
+
55
+ | Option | Type | Default | Description |
56
+ |---|---|---|---|
57
+ | `defaultVault` | `string` | `null` | Default vault for write operations |
58
+
59
+ ## Skills
60
+
61
+ The plugin vendors five Obsidian skills into `~/.opencode/skills/obsidian-opencode-plugin-bundled/` (bundled mode) or reads from an existing checkout.
62
+
63
+ To sync bundled skills from upstream:
64
+
65
+ ```bash
66
+ bun run sync:skills
67
+ ```
68
+
69
+ To sync from a local checkout:
70
+
71
+ ```bash
72
+ bun run sync:skills --source=/path/to/obsidian-skills
73
+ ```
74
+
75
+ ## Tools
76
+
77
+ | Tool | Description | Requires CLI | Requires App |
78
+ |---|---|---|---|
79
+ | `obsidian_env_doctor` | Environment diagnostics | no* | no |
80
+ | `obsidian_skills_check` | Validate discoverable skills | no | no |
81
+ | `obsidian_read` | Read a note by name or path | yes | yes |
82
+ | `obsidian_search` | Search vault content | yes | yes |
83
+ | `obsidian_create_note` | Create a new note | yes | yes |
84
+ | `obsidian_append_note` | Append text to a note | yes | yes |
85
+ | `obsidian_set_property` | Set a frontmatter property | yes | yes |
86
+
87
+ \* `obsidian_env_doctor` checks whether the CLI is available but does not require it to run.
88
+
89
+ ### Vault resolution
90
+
91
+ - **Read operations** (`read`, `search`): explicit `vault` arg → `defaultVault` config → active app vault
92
+ - **Write operations** (`create`, `append`, `set_property`): explicit `vault` arg → `defaultVault` config → error
93
+
94
+ ### Degraded mode
95
+
96
+ All tools remain registered when prerequisites are missing. A structured error envelope is returned instead:
97
+
98
+ ```json
99
+ {
100
+ "ok": false,
101
+ "error": {
102
+ "code": "CLI_NOT_FOUND",
103
+ "kind": "capability",
104
+ "message": "obsidian CLI is not installed or not on PATH"
105
+ },
106
+ "hint": "Ask OpenCode to use obsidian_env_doctor"
107
+ }
108
+ ```
109
+
110
+ ### Error codes
111
+
112
+ | Code | Cause |
113
+ |---|---|
114
+ | `CLI_NOT_FOUND` | `obsidian` binary not on PATH |
115
+ | `APP_NOT_RUNNING` | Obsidian desktop app not running |
116
+ | `VAULT_REQUIRED` | Write operation with no vault specified |
117
+ | `VAULT_NOT_FOUND` | Specified vault does not exist |
118
+ | `FILE_OR_PATH_REQUIRED` | Neither `file` nor `path` provided |
119
+ | `MUTUALLY_EXCLUSIVE_TARGET` | Both `file` and `path` provided |
120
+ | `PATH_OUTSIDE_VAULT` | Path traversal attempt rejected |
121
+ | `BUNDLED_SKILLS_OUT_OF_SYNC` | Skills missing from expected path |
122
+
123
+ ## Development
124
+
125
+ ```bash
126
+ bun install # install dependencies
127
+ bun test # run all tests
128
+ bun run check # TypeScript type-check
129
+ bun run sync:skills # sync skills from upstream GitHub
130
+ ```
131
+
132
+ ## Roadmap
133
+
134
+ - **v1** (current): runtime compatibility — env doctor, skills check, read, search, create, append, set-property
135
+ - **v1.5**: vault helpers, wikilink/frontmatter validation, backlinks, tags, dev tooling
136
+ - **v2**: LLM Wiki workflows — source ingestion, page updates, index refresh, answer-with-citations