@ghackk/multi-claude 1.0.15 → 1.0.17

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
@@ -95,6 +95,14 @@ Ensure-ClaudeInstalled
95
95
  if (!(Test-Path $ACCOUNTS_DIR)) { New-Item -ItemType Directory -Path $ACCOUNTS_DIR | Out-Null }
96
96
  if (!(Test-Path $BACKUP_DIR)) { New-Item -ItemType Directory -Path $BACKUP_DIR | Out-Null }
97
97
 
98
+ # ─── ENSURE ACCOUNTS DIR IS ON PATH ──────────────────────────────────────────
99
+
100
+ $userPath = [Environment]::GetEnvironmentVariable("PATH", "User")
101
+ if ($userPath -notlike "*claude-accounts*") {
102
+ [Environment]::SetEnvironmentVariable("PATH", "$ACCOUNTS_DIR;$userPath", "User")
103
+ $env:PATH = "$ACCOUNTS_DIR;$env:PATH"
104
+ }
105
+
98
106
  # ─── DISPLAY ─────────────────────────────────────────────────────────────────
99
107
 
100
108
  function Show-Header {
@@ -454,6 +462,11 @@ function Create-Account {
454
462
  pause; return
455
463
  }
456
464
 
465
+ if ($name -notmatch '^[a-zA-Z0-9_-]+$') {
466
+ Write-Host " Name can only contain letters, numbers, hyphens, and underscores." -ForegroundColor Red
467
+ pause; return
468
+ }
469
+
457
470
  $batFile = "$ACCOUNTS_DIR\claude-$name.bat"
458
471
  if (Test-Path $batFile) {
459
472
  Write-Host " Account 'claude-$name' already exists!" -ForegroundColor Yellow
@@ -539,7 +552,7 @@ function Delete-Account {
539
552
  Write-Host ""
540
553
  $confirm = Read-Host " Type YES to confirm deleting all selected"
541
554
 
542
- if ($confirm.Trim() -ne "YES") {
555
+ if ($confirm.Trim() -ine "YES" -and $confirm.Trim() -ine "Y") {
543
556
  Write-Host " Cancelled." -ForegroundColor Gray
544
557
  pause; return
545
558
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ghackk/multi-claude",
3
- "version": "1.0.15",
3
+ "version": "1.0.17",
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"
@@ -10,6 +10,21 @@ SHARED_PLUGINS_DIR="$SHARED_DIR/plugins"
10
10
  SHARED_MARKETPLACES_DIR="$SHARED_PLUGINS_DIR/marketplaces"
11
11
  PAIR_SERVER="https://pair.ghackk.com"
12
12
 
13
+ # ─── LAUNCHER SYMLINK HELPERS ─────────────────────────────────────────────
14
+
15
+ register_launcher() {
16
+ local name="$1" # e.g. "claude-zf"
17
+ local bin_dir="$HOME/.local/bin"
18
+ mkdir -p "$bin_dir"
19
+ ln -sf "$ACCOUNTS_DIR/$name.sh" "$bin_dir/$name"
20
+ }
21
+
22
+ unregister_launcher() {
23
+ local name="$1"
24
+ local link="$HOME/.local/bin/$name"
25
+ [ -L "$link" ] && rm -f "$link"
26
+ }
27
+
13
28
  # ─── ENSURE CLAUDE CLI INSTALLED ──────────────────────────────────────────
14
29
 
15
30
  ensure_claude_installed() {
@@ -433,6 +448,7 @@ export CLAUDE_CONFIG_DIR="\$HOME/.claude-$name"
433
448
  claude "\$@"
434
449
  ENDSH
435
450
  chmod +x "$shFile"
451
+ register_launcher "claude-$name"
436
452
 
437
453
  # Auto-apply shared settings
438
454
  if command -v jq &>/dev/null; then
@@ -507,6 +523,8 @@ rename_account() {
507
523
  # Rename launcher
508
524
  mv "$ACCOUNTS_DIR/$selected.sh" "$newSh"
509
525
  sed -i "s/$selected/$newName/g" "$newSh" 2>/dev/null || sed -i '' "s/$selected/$newName/g" "$newSh"
526
+ unregister_launcher "$selected"
527
+ register_launcher "$newName"
510
528
 
511
529
  # Rename config dir
512
530
  local oldConfig="$HOME/.$selected"
@@ -540,13 +558,14 @@ delete_account() {
540
558
  echo -e " \033[33mAccount selected for deletion: $selected\033[0m"
541
559
  read -p " Type YES to confirm: " confirm
542
560
 
543
- if [ "$confirm" != "YES" ]; then
561
+ if [[ "${confirm,,}" != "yes" && "${confirm,,}" != "y" ]]; then
544
562
  echo -e " \033[90mCancelled.\033[0m"
545
563
  read -p " Press Enter..." _
546
564
  return
547
565
  fi
548
566
 
549
567
  rm -f "$ACCOUNTS_DIR/$selected.sh"
568
+ unregister_launcher "$selected"
550
569
  local configDir="$HOME/.$selected"
551
570
  if [ -d "$configDir" ]; then
552
571
  rm -rf "$configDir"
@@ -796,6 +815,7 @@ sys.stdout.write(data.decode('utf-8').strip())
796
815
  printf '#!/bin/bash\nexport CLAUDE_CONFIG_DIR="$HOME/.%s"\nclaude "$@"\n' "$name" > "$ACCOUNTS_DIR/$name.sh"
797
816
  chmod +x "$ACCOUNTS_DIR/$name.sh"
798
817
  fi
818
+ register_launcher "$name"
799
819
  echo -e " \033[32mLauncher created\033[0m"
800
820
 
801
821
  echo ""