ccsini 0.1.1 → 0.1.2

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 (2) hide show
  1. package/dist/index.js +66 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -25884,7 +25884,7 @@ var {
25884
25884
  } = import__.default;
25885
25885
 
25886
25886
  // src/version.ts
25887
- var VERSION = "0.1.0";
25887
+ var VERSION = "0.1.2";
25888
25888
 
25889
25889
  // ../../node_modules/.bun/chalk@5.6.2/node_modules/chalk/source/vendor/ansi-styles/index.js
25890
25890
  var ANSI_BACKGROUND_OFFSET = 10;
@@ -28822,12 +28822,77 @@ function registerDoctorCommand(program2) {
28822
28822
  });
28823
28823
  }
28824
28824
 
28825
+ // src/commands/self.ts
28826
+ import { execSync } from "child_process";
28827
+ function detectPackageManager() {
28828
+ try {
28829
+ execSync("bun --version", { stdio: "ignore" });
28830
+ return "bun";
28831
+ } catch {
28832
+ return "npm";
28833
+ }
28834
+ }
28835
+ function getLatestVersion() {
28836
+ try {
28837
+ const result = execSync("npm view ccsini version", { encoding: "utf-8" }).trim();
28838
+ return result;
28839
+ } catch {
28840
+ return null;
28841
+ }
28842
+ }
28843
+ function registerSelfCommands(program2) {
28844
+ program2.command("update").description("Update ccsini to the latest version").action(async () => {
28845
+ console.log(`Current version: ${VERSION}`);
28846
+ const latest = getLatestVersion();
28847
+ if (!latest) {
28848
+ console.error("Failed to check latest version. Check your internet connection.");
28849
+ process.exit(1);
28850
+ }
28851
+ if (latest === VERSION) {
28852
+ console.log(`Already on the latest version (${VERSION})`);
28853
+ return;
28854
+ }
28855
+ console.log(`New version available: ${latest}`);
28856
+ console.log(`Updating...
28857
+ `);
28858
+ const pm = detectPackageManager();
28859
+ const cmd = pm === "bun" ? "bun add -g ccsini@latest" : "npm install -g ccsini@latest";
28860
+ try {
28861
+ execSync(cmd, { stdio: "inherit" });
28862
+ console.log(`
28863
+ Updated to v${latest}`);
28864
+ } catch {
28865
+ console.error(`
28866
+ Update failed. Try manually:`);
28867
+ console.error(` ${cmd}`);
28868
+ process.exit(1);
28869
+ }
28870
+ });
28871
+ program2.command("uninstall").description("Uninstall ccsini from this machine").action(async () => {
28872
+ const pm = detectPackageManager();
28873
+ const cmd = pm === "bun" ? "bun remove -g ccsini" : "npm uninstall -g ccsini";
28874
+ console.log(`Uninstalling ccsini...
28875
+ `);
28876
+ try {
28877
+ execSync(cmd, { stdio: "inherit" });
28878
+ console.log(`
28879
+ ccsini has been uninstalled. Bye!`);
28880
+ } catch {
28881
+ console.error(`
28882
+ Uninstall failed. Try manually:`);
28883
+ console.error(` ${cmd}`);
28884
+ process.exit(1);
28885
+ }
28886
+ });
28887
+ }
28888
+
28825
28889
  // src/index.ts
28826
28890
  var program2 = new Command;
28827
28891
  program2.name("ccsini").description("Claude Code seamless sync across devices").version(VERSION);
28828
28892
  registerInitCommand(program2);
28829
28893
  registerAutoCommands(program2);
28830
28894
  registerDoctorCommand(program2);
28895
+ registerSelfCommands(program2);
28831
28896
  var syncCmd = program2.command("sync").description("Sync management commands");
28832
28897
  syncCmd.command("push").description("Force push changes to cloud").action(async () => {
28833
28898
  console.log("ccsini sync push - coming soon");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ccsini",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Claude Code seamless sync across devices",
5
5
  "type": "module",
6
6
  "bin": {