b6a70c4eb2339cee7e220558a86119236a2b7bf4

Author
Pavle <29902467+TheEdgeOfRage@users.noreply.github.com>
Committer
GitHub <noreply@github.com>
Date

Message

Update installation instructions (#4)

* Update installation instructions

* Fix id in export

Diff

 1diff --git a/README.md b/README.md
 2index e2336261112ff30ff5d2b676f149d904e2185792..d99c34b189abdaf98b23c8b041144eeb69136ad5 100644
 3--- a/README.md
 4+++ b/README.md
 5@@ -12,11 +12,25 @@ Also includes desktop notifications for events that need your attention.
 6 
 7 ## Install
 8 
 9-1. Add the plugin to your `opencode.json` config:
10+1. Clone the repo and symlink the plugin into the OpenCode plugins directory:
11+
12+```sh
13+git clone git@github.com:duneanalytics/opencode-policy-engine.git
14+cd opencode-policy-engine && bun install
15+
16+# Linux
17+mkdir -p ~/.config/opencode/plugins
18+ln -s "$(pwd)/src/index.ts" ~/.config/opencode/plugins/policy-engine.ts
19+
20+# macOS
21+mkdir -p ~/Library/Application\ Support/opencode/plugins
22+ln -s "$(pwd)/src/index.ts" ~/Library/Application\ Support/opencode/plugins/policy-engine.ts
23+```
24+
25+2. Set permissions to `"ask"` in your `opencode.json` so the plugin can intercept them:
26 
27 ```json
28 {
29-	"plugin": ["github:duneanalytics/opencode-policy-engine"],
30 	"permission": {
31 		"bash": {
32 			"*": "ask"
33@@ -25,11 +39,7 @@ Also includes desktop notifications for events that need your attention.
34 }
35 ```
36 
37-Config file location: `~/.config/opencode/opencode.json`
38-
39-Or place `opencode.json` in your project root for per-project config. See [config docs](https://opencode.ai/docs/config/) for details.
40-
41-2. Restart OpenCode.
42+3. Restart OpenCode.
43 
44 ## API key
45 
46diff --git a/src/index.ts b/src/index.ts
47index 2d7a8697ea0c5da6643d03e05158f5d672da8d9e..e8df343759e818e230a5679eecfca63061941987 100644
48--- a/src/index.ts
49+++ b/src/index.ts
50@@ -269,5 +269,6 @@ export const PolicyEngine: Plugin = async (ctx, _options) => {
51 }
52 
53 export default {
54+  id: "policy-engine",
55   server: PolicyEngine,
56 } satisfies PluginModule