opencode-sync-plugin 0.2.1 → 0.2.3

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.
@@ -9,8 +9,8 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
9
9
  function getConfigPaths() {
10
10
  const { homedir } = __require("os");
11
11
  const { join } = __require("path");
12
- const configDir = join(homedir(), ".config", "opencode-sync");
13
- const configFile = join(configDir, "config.json");
12
+ const configDir = join(homedir(), ".opensync");
13
+ const configFile = join(configDir, "credentials.json");
14
14
  return { configDir, configFile };
15
15
  }
16
16
  function getConfig() {
@@ -49,7 +49,6 @@ function clearConfig() {
49
49
  }
50
50
 
51
51
  export {
52
- __require,
53
52
  getConfig,
54
53
  setConfig,
55
54
  clearConfig
package/dist/cli.js CHANGED
@@ -1,15 +1,27 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
- __require,
4
3
  clearConfig,
5
4
  getConfig,
6
5
  setConfig
7
- } from "./chunk-QO5Y7TD5.js";
6
+ } from "./chunk-SFEFUAIN.js";
8
7
 
9
8
  // src/cli.ts
10
9
  import { readFileSync, existsSync } from "fs";
11
10
  import { homedir } from "os";
12
- import { join } from "path";
11
+ import { join, dirname } from "path";
12
+ import { createInterface } from "readline";
13
+ import { fileURLToPath } from "url";
14
+ function getVersion() {
15
+ try {
16
+ const __filename = fileURLToPath(import.meta.url);
17
+ const __dirname = dirname(__filename);
18
+ const pkgPath = join(__dirname, "..", "package.json");
19
+ const pkg = JSON.parse(readFileSync(pkgPath, "utf8"));
20
+ return pkg.version || "unknown";
21
+ } catch {
22
+ return "unknown";
23
+ }
24
+ }
13
25
  var args = process.argv.slice(2);
14
26
  var command = args[0];
15
27
  async function main() {
@@ -29,6 +41,16 @@ async function main() {
29
41
  case "config":
30
42
  showConfig();
31
43
  break;
44
+ case "version":
45
+ case "-v":
46
+ case "--version":
47
+ console.log(`opencode-sync-plugin v${getVersion()}`);
48
+ break;
49
+ case "help":
50
+ case "-h":
51
+ case "--help":
52
+ help();
53
+ break;
32
54
  default:
33
55
  help();
34
56
  }
@@ -178,17 +200,20 @@ function showConfig() {
178
200
  console.log();
179
201
  }
180
202
  function help() {
203
+ const version = getVersion();
181
204
  console.log(`
182
- OpenSync CLI
205
+ OpenSync CLI v${version}
183
206
 
184
207
  Usage: opencode-sync <command>
185
208
 
186
209
  Commands:
187
- login Configure with Convex URL and API Key
188
- verify Verify credentials and OpenCode config
189
- logout Clear stored credentials
190
- status Show current authentication status
191
- config Show current configuration
210
+ login Configure with Convex URL and API Key
211
+ verify Verify credentials and OpenCode config
212
+ logout Clear stored credentials
213
+ status Show current authentication status
214
+ config Show current configuration
215
+ version Show version number
216
+ help Show this help message
192
217
 
193
218
  Setup:
194
219
  1. Go to your OpenSync dashboard Settings page
@@ -201,8 +226,7 @@ function help() {
201
226
  }
202
227
  function prompt(question) {
203
228
  return new Promise((resolve) => {
204
- const readline = __require("readline");
205
- const rl = readline.createInterface({
229
+ const rl = createInterface({
206
230
  input: process.stdin,
207
231
  output: process.stdout
208
232
  });
package/dist/config.js CHANGED
@@ -2,7 +2,7 @@ import {
2
2
  clearConfig,
3
3
  getConfig,
4
4
  setConfig
5
- } from "./chunk-QO5Y7TD5.js";
5
+ } from "./chunk-SFEFUAIN.js";
6
6
  export {
7
7
  clearConfig,
8
8
  getConfig,
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getConfig
3
- } from "./chunk-QO5Y7TD5.js";
3
+ } from "./chunk-SFEFUAIN.js";
4
4
 
5
5
  // src/index.ts
6
6
  var syncedMessages = /* @__PURE__ */ new Set();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-sync-plugin",
3
- "version": "0.2.1",
3
+ "version": "0.2.3",
4
4
  "description": "Sync your OpenCode sessions to the cloud",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",