opencode-cliproxyapi-sync 1.0.0 → 1.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 CHANGED
@@ -24,14 +24,13 @@ npx opencode install opencode-cliproxyapi-sync
24
24
 
25
25
  ### Option 2: Manual Configuration
26
26
 
27
- Add to your `~/.config/opencode/opencode.json` plugins array:
27
+ Add to your `opencode.jsonc` plugin array:
28
28
 
29
29
  ```json
30
30
  {
31
31
  "plugin": [
32
- "opencode-cliproxyapi-sync",
33
- "oh-my-opencode@latest",
34
- "..."
32
+ "opencode-cliproxyapi-sync@latest",
33
+ "oh-my-opencode@latest"
35
34
  ]
36
35
  }
37
36
  ```
@@ -99,6 +98,16 @@ If only `oh-my-opencode.json` changes, no notification is shown (those changes a
99
98
 
100
99
  (Respects `XDG_CONFIG_HOME` environment variable if set)
101
100
 
101
+ ## OCX Profile Support
102
+
103
+ When using [OCX](https://github.com/kdcokenny/ocx) profiles, the plugin automatically detects the profile directory via the `OPENCODE_CONFIG_DIR` environment variable that OCX sets.
104
+
105
+ This means configs are synced to the correct profile location:
106
+ - **Without profile**: `~/.config/opencode/opencode.json`
107
+ - **With profile**: `~/.config/opencode/profiles/<name>/opencode.json`
108
+
109
+ No additional configuration needed - just use `ocx oc -p myprofile` as usual.
110
+
102
111
  ## Troubleshooting
103
112
 
104
113
  ### Plugin doesn't sync
package/dist/index.js CHANGED
@@ -128,6 +128,10 @@ import { createHash } from "crypto";
128
128
  import { homedir as homedir2 } from "os";
129
129
  import { join as join2 } from "path";
130
130
  function getOpenCodeConfigDir() {
131
+ const ocxConfigDir = process.env.OPENCODE_CONFIG_DIR;
132
+ if (ocxConfigDir) {
133
+ return ocxConfigDir;
134
+ }
131
135
  const xdgConfigHome = process.env.XDG_CONFIG_HOME;
132
136
  if (xdgConfigHome) {
133
137
  return join2(xdgConfigHome, "opencode");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-cliproxyapi-sync",
3
- "version": "1.0.0",
3
+ "version": "1.1.1",
4
4
  "description": "Auto-sync OpenCode configs from CLIProxyAPI Dashboard",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",