@ghackk/multi-claude 1.0.16 → 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 +9 -1
- package/package.json +1 -1
- package/unix/claude-menu.sh +21 -1
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 {
|
|
@@ -544,7 +552,7 @@ function Delete-Account {
|
|
|
544
552
|
Write-Host ""
|
|
545
553
|
$confirm = Read-Host " Type YES to confirm deleting all selected"
|
|
546
554
|
|
|
547
|
-
if ($confirm.Trim() -
|
|
555
|
+
if ($confirm.Trim() -ine "YES" -and $confirm.Trim() -ine "Y") {
|
|
548
556
|
Write-Host " Cancelled." -ForegroundColor Gray
|
|
549
557
|
pause; return
|
|
550
558
|
}
|
package/package.json
CHANGED
package/unix/claude-menu.sh
CHANGED
|
@@ -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" != "
|
|
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 ""
|