@ghackk/multi-claude 1.0.6 → 1.0.8

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/claude-menu.ps1 CHANGED
@@ -7,6 +7,11 @@ $SHARED_PLUGINS_DIR = "$SHARED_DIR\plugins"
7
7
  $SHARED_MARKETPLACES_DIR = "$SHARED_PLUGINS_DIR\marketplaces"
8
8
  $PAIR_SERVER = "https://pair.ghackk.com"
9
9
 
10
+ # ─── ENSURE DIRECTORIES EXIST ───────────────────────────────────────────────
11
+
12
+ if (!(Test-Path $ACCOUNTS_DIR)) { New-Item -ItemType Directory -Path $ACCOUNTS_DIR | Out-Null }
13
+ if (!(Test-Path $BACKUP_DIR)) { New-Item -ItemType Directory -Path $BACKUP_DIR | Out-Null }
14
+
10
15
  # ─── DISPLAY ─────────────────────────────────────────────────────────────────
11
16
 
12
17
  function Show-Header {
@@ -691,6 +696,7 @@ function Apply-ImportToken($token) {
691
696
  $launcherSrc = "$extractDir\launcher.bat"
692
697
  $launcherDest = "$ACCOUNTS_DIR\$name.bat"
693
698
  if (Test-Path $launcherSrc) {
699
+ if (!(Test-Path $ACCOUNTS_DIR)) { New-Item -ItemType Directory -Path $ACCOUNTS_DIR | Out-Null }
694
700
  Copy-Item $launcherSrc $launcherDest -Force
695
701
  Write-Host " Launcher created" -ForegroundColor Green
696
702
  }
@@ -787,12 +793,17 @@ function Pair-Export {
787
793
 
788
794
  try {
789
795
  $raw = Invoke-RestMethod -Uri "$PAIR_SERVER/client/pair-export.ps1" -ErrorAction Stop
796
+ } catch {
797
+ Write-Host " Failed to fetch pairing script: $_" -ForegroundColor Red
798
+ Write-Host " Is the pairing server online? Check $PAIR_SERVER/api/health" -ForegroundColor Gray
799
+ pause; return
800
+ }
801
+ try {
790
802
  $reversed = -join ($raw.ToCharArray() | ForEach-Object -Begin { $a = @() } -Process { $a += $_ } -End { [array]::Reverse($a); $a })
791
803
  $decoded = [System.Text.Encoding]::UTF8.GetString([Convert]::FromBase64String($reversed))
792
804
  Invoke-Expression $decoded
793
805
  } catch {
794
- Write-Host " Failed to fetch pairing script: $_" -ForegroundColor Red
795
- Write-Host " Is the pairing server online? Check $PAIR_SERVER/api/health" -ForegroundColor Gray
806
+ Write-Host " Pairing export failed: $_" -ForegroundColor Red
796
807
  pause
797
808
  }
798
809
  }
@@ -805,12 +816,17 @@ function Pair-Import {
805
816
 
806
817
  try {
807
818
  $raw = Invoke-RestMethod -Uri "$PAIR_SERVER/client/pair-import.ps1" -ErrorAction Stop
819
+ } catch {
820
+ Write-Host " Failed to fetch pairing script: $_" -ForegroundColor Red
821
+ Write-Host " Is the pairing server online? Check $PAIR_SERVER/api/health" -ForegroundColor Gray
822
+ pause; return
823
+ }
824
+ try {
808
825
  $reversed = -join ($raw.ToCharArray() | ForEach-Object -Begin { $a = @() } -Process { $a += $_ } -End { [array]::Reverse($a); $a })
809
826
  $decoded = [System.Text.Encoding]::UTF8.GetString([Convert]::FromBase64String($reversed))
810
827
  Invoke-Expression $decoded
811
828
  } catch {
812
- Write-Host " Failed to fetch pairing script: $_" -ForegroundColor Red
813
- Write-Host " Is the pairing server online? Check $PAIR_SERVER/api/health" -ForegroundColor Gray
829
+ Write-Host " Pairing import failed: $_" -ForegroundColor Red
814
830
  pause
815
831
  }
816
832
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ghackk/multi-claude",
3
- "version": "1.0.6",
3
+ "version": "1.0.8",
4
4
  "description": "Run multiple Claude CLI accounts with shared settings, plugins, marketplace sync, and backup/restore",
5
5
  "bin": {
6
6
  "multi-claude": "bin/claude-multi.js"
@@ -7,6 +7,11 @@ $SHARED_PLUGINS_DIR = "$SHARED_DIR\plugins"
7
7
  $SHARED_MARKETPLACES_DIR = "$SHARED_PLUGINS_DIR\marketplaces"
8
8
  $PAIR_SERVER = "https://pair.ghackk.com"
9
9
 
10
+ # ─── ENSURE DIRECTORIES EXIST ───────────────────────────────────────────────
11
+
12
+ if (!(Test-Path $ACCOUNTS_DIR)) { New-Item -ItemType Directory -Path $ACCOUNTS_DIR | Out-Null }
13
+ if (!(Test-Path $BACKUP_DIR)) { New-Item -ItemType Directory -Path $BACKUP_DIR | Out-Null }
14
+
10
15
  # ─── DISPLAY ─────────────────────────────────────────────────────────────────
11
16
 
12
17
  function Show-Header {
@@ -691,6 +696,7 @@ function Apply-ImportToken($token) {
691
696
  $launcherSrc = "$extractDir\launcher.bat"
692
697
  $launcherDest = "$ACCOUNTS_DIR\$name.bat"
693
698
  if (Test-Path $launcherSrc) {
699
+ if (!(Test-Path $ACCOUNTS_DIR)) { New-Item -ItemType Directory -Path $ACCOUNTS_DIR | Out-Null }
694
700
  Copy-Item $launcherSrc $launcherDest -Force
695
701
  Write-Host " Launcher created" -ForegroundColor Green
696
702
  }
@@ -787,12 +793,17 @@ function Pair-Export {
787
793
 
788
794
  try {
789
795
  $raw = Invoke-RestMethod -Uri "$PAIR_SERVER/client/pair-export.ps1" -ErrorAction Stop
796
+ } catch {
797
+ Write-Host " Failed to fetch pairing script: $_" -ForegroundColor Red
798
+ Write-Host " Is the pairing server online? Check $PAIR_SERVER/api/health" -ForegroundColor Gray
799
+ pause; return
800
+ }
801
+ try {
790
802
  $reversed = -join ($raw.ToCharArray() | ForEach-Object -Begin { $a = @() } -Process { $a += $_ } -End { [array]::Reverse($a); $a })
791
803
  $decoded = [System.Text.Encoding]::UTF8.GetString([Convert]::FromBase64String($reversed))
792
804
  Invoke-Expression $decoded
793
805
  } catch {
794
- Write-Host " Failed to fetch pairing script: $_" -ForegroundColor Red
795
- Write-Host " Is the pairing server online? Check $PAIR_SERVER/api/health" -ForegroundColor Gray
806
+ Write-Host " Pairing export failed: $_" -ForegroundColor Red
796
807
  pause
797
808
  }
798
809
  }
@@ -805,12 +816,17 @@ function Pair-Import {
805
816
 
806
817
  try {
807
818
  $raw = Invoke-RestMethod -Uri "$PAIR_SERVER/client/pair-import.ps1" -ErrorAction Stop
819
+ } catch {
820
+ Write-Host " Failed to fetch pairing script: $_" -ForegroundColor Red
821
+ Write-Host " Is the pairing server online? Check $PAIR_SERVER/api/health" -ForegroundColor Gray
822
+ pause; return
823
+ }
824
+ try {
808
825
  $reversed = -join ($raw.ToCharArray() | ForEach-Object -Begin { $a = @() } -Process { $a += $_ } -End { [array]::Reverse($a); $a })
809
826
  $decoded = [System.Text.Encoding]::UTF8.GetString([Convert]::FromBase64String($reversed))
810
827
  Invoke-Expression $decoded
811
828
  } catch {
812
- Write-Host " Failed to fetch pairing script: $_" -ForegroundColor Red
813
- Write-Host " Is the pairing server online? Check $PAIR_SERVER/api/health" -ForegroundColor Gray
829
+ Write-Host " Pairing import failed: $_" -ForegroundColor Red
814
830
  pause
815
831
  }
816
832
  }