ccsini 0.1.26 → 0.1.28

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.
Files changed (3) hide show
  1. package/README.md +13 -0
  2. package/dist/index.js +62 -1
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -46,6 +46,7 @@ ccsini init --token <your-token>
46
46
  | `ccsini update` | Update ccsini to the latest version |
47
47
  | `ccsini version` | Show current version |
48
48
  | `ccsini doctor` | Diagnose configuration issues |
49
+ | `ccsini reset` | Wipe all server data and local config |
49
50
 
50
51
  ### Cleanup
51
52
 
@@ -59,6 +60,18 @@ ccsini sync cleanup --dry-run
59
60
  ccsini sync cleanup
60
61
  ```
61
62
 
63
+ ### Reset
64
+
65
+ If you need to start completely fresh (e.g. deleted devices from dashboard, stuck on old salt), reset wipes everything:
66
+
67
+ ```bash
68
+ ccsini reset
69
+ # Then re-initialize
70
+ ccsini init --token <your-token>
71
+ ```
72
+
73
+ This deletes all server-side data (salt, manifest, blobs) and your local `~/.ccsini/` config.
74
+
62
75
  ## What Gets Synced
63
76
 
64
77
  Only the files that matter for cross-device coding context:
package/dist/index.js CHANGED
@@ -27996,7 +27996,7 @@ var {
27996
27996
  } = import__.default;
27997
27997
 
27998
27998
  // src/version.ts
27999
- var VERSION = "0.1.26";
27999
+ var VERSION = "0.1.28";
28000
28000
 
28001
28001
  // src/commands/init.ts
28002
28002
  init_source();
@@ -29001,6 +29001,15 @@ class CcsiniClient {
29001
29001
  throw new Error("Failed to delete blobs");
29002
29002
  return res.json();
29003
29003
  }
29004
+ async resetAll() {
29005
+ const res = await fetch(`${this.apiUrl}/api/sync/reset`, {
29006
+ method: "DELETE",
29007
+ headers: this.getHeaders()
29008
+ });
29009
+ if (!res.ok)
29010
+ throw new Error("Failed to reset account data");
29011
+ return res.json();
29012
+ }
29004
29013
  async logSyncEvent(event) {
29005
29014
  await fetch(`${this.apiUrl}/api/sync/log`, {
29006
29015
  method: "POST",
@@ -30029,6 +30038,57 @@ function registerHooksCommands(program2) {
30029
30038
  });
30030
30039
  }
30031
30040
 
30041
+ // src/commands/reset.ts
30042
+ init_auth();
30043
+ import { rm } from "fs/promises";
30044
+ function registerResetCommand(program2) {
30045
+ program2.command("reset").description("Wipe all server data and local config (full account reset)").action(async () => {
30046
+ const configDir = getConfigDir();
30047
+ if (!await configExists(configDir)) {
30048
+ console.error("Not initialized. Nothing to reset.");
30049
+ process.exit(1);
30050
+ }
30051
+ const chalk2 = (await Promise.resolve().then(() => (init_source(), exports_source))).default;
30052
+ const inquirer2 = await Promise.resolve().then(() => (init_dist16(), exports_dist));
30053
+ console.log(chalk2.red.bold(`
30054
+ WARNING: This will permanently delete:`));
30055
+ console.log(chalk2.red(" - All encrypted files on the server"));
30056
+ console.log(chalk2.red(" - Your encryption salt"));
30057
+ console.log(chalk2.red(` - Your local config (~/.ccsini/)
30058
+ `));
30059
+ const { confirm } = await inquirer2.default.prompt([
30060
+ {
30061
+ type: "confirm",
30062
+ name: "confirm",
30063
+ message: "Are you sure you want to wipe everything?",
30064
+ default: false
30065
+ }
30066
+ ]);
30067
+ if (!confirm) {
30068
+ console.log("Cancelled.");
30069
+ return;
30070
+ }
30071
+ const ora2 = (await Promise.resolve().then(() => (init_ora(), exports_ora))).default;
30072
+ try {
30073
+ const config = await loadKeys(configDir);
30074
+ const privateKey = await importPrivateKey(config.devicePrivateKey);
30075
+ const jwt = await createDeviceJWT(privateKey, config.deviceId);
30076
+ const client = new CcsiniClient(config.apiUrl, jwt);
30077
+ const spinner = ora2("Wiping server data...").start();
30078
+ const { blobsDeleted } = await client.resetAll();
30079
+ spinner.succeed(`Server data wiped (${blobsDeleted} blob${blobsDeleted !== 1 ? "s" : ""} deleted)`);
30080
+ const localSpinner = ora2("Removing local config...").start();
30081
+ await rm(configDir, { recursive: true, force: true });
30082
+ localSpinner.succeed("Local config removed");
30083
+ console.log(chalk2.green(`
30084
+ Account fully reset. Run 'ccsini init --token <token>' to start fresh.`));
30085
+ } catch (e) {
30086
+ console.error(`Reset failed: ${e.message}`);
30087
+ process.exit(1);
30088
+ }
30089
+ });
30090
+ }
30091
+
30032
30092
  // src/index.ts
30033
30093
  var program2 = new Command;
30034
30094
  program2.name("ccsini").description("Claude Code seamless sync across devices").version(VERSION);
@@ -30038,6 +30098,7 @@ registerDoctorCommand(program2);
30038
30098
  registerSelfCommands(program2);
30039
30099
  registerSyncCommands(program2);
30040
30100
  registerHooksCommands(program2);
30101
+ registerResetCommand(program2);
30041
30102
  program2.command("version").description("Show current version").action(() => {
30042
30103
  console.log(VERSION);
30043
30104
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ccsini",
3
- "version": "0.1.26",
3
+ "version": "0.1.28",
4
4
  "description": "Claude Code seamless sync across devices",
5
5
  "type": "module",
6
6
  "bin": {