mcp-ssh-manager 3.8.7 → 4.0.1

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 (104) hide show
  1. package/.eslintignore +5 -0
  2. package/.gitattributes +5 -0
  3. package/CHANGELOG.md +371 -6
  4. package/CLAUDE.md +6 -0
  5. package/CODE_OF_CONDUCT.md +18 -0
  6. package/CONTRIBUTING.md +30 -0
  7. package/Formula/ssh-manager.rb +60 -0
  8. package/README.md +484 -964
  9. package/ROADMAP-V4.md +451 -0
  10. package/brand/README.md +43 -0
  11. package/brand/icon.svg +32 -0
  12. package/brand/mark.svg +18 -0
  13. package/brand/wordmark.svg +30 -0
  14. package/cli/app.js +230 -0
  15. package/cli/control.js +116 -0
  16. package/cli/lib/colors.sh +15 -0
  17. package/cli/lib/menu.sh +145 -96
  18. package/cli/portability.js +186 -0
  19. package/cli/ssh-manager +197 -91
  20. package/cli/ssh-manager.js +14 -0
  21. package/cli/style.js +17 -0
  22. package/cli/vault.js +411 -0
  23. package/desktop/ControlPlaneApp.swift +219 -0
  24. package/desktop/build.sh +58 -0
  25. package/desktop/electron/after-pack.cjs +39 -0
  26. package/desktop/electron/electron-builder.yml +148 -0
  27. package/desktop/electron/finalize-artifacts.mjs +83 -0
  28. package/desktop/electron/main.js +815 -0
  29. package/desktop/electron/package-lock.json +3656 -0
  30. package/desktop/electron/package.json +30 -0
  31. package/desktop/electron/prepare-engine.mjs +84 -0
  32. package/desktop/electron/resources/entitlements.mac.plist +22 -0
  33. package/desktop/electron/resources/icon.png +0 -0
  34. package/desktop/electron/resources/trayTemplate.png +0 -0
  35. package/desktop/electron/resources/trayTemplate@2x.png +0 -0
  36. package/desktop/electron/smoke-test.mjs +184 -0
  37. package/dist/ui/app.css +1 -0
  38. package/dist/ui/app.js +501 -0
  39. package/dist/ui/assets/Forum-Regular.woff2 +0 -0
  40. package/dist/ui/assets/JetBrainsMono-Bold.woff2 +0 -0
  41. package/dist/ui/assets/JetBrainsMono-Regular.woff2 +0 -0
  42. package/dist/ui/assets/Karla-Variable.woff2 +0 -0
  43. package/dist/ui/index.html +16 -0
  44. package/docs/DISTRIBUTION.md +136 -0
  45. package/docs/FINAL-TEST-V4.md +209 -0
  46. package/docs/MIGRATION.md +334 -0
  47. package/docs/TESTING-V4.md +119 -0
  48. package/docs/superpowers/specs/2026-10-08-desktop-from-npm-and-cli-design.md +187 -0
  49. package/docs/videos/control-plane.mp4 +0 -0
  50. package/package.json +61 -30
  51. package/scripts/build-interface.mjs +73 -0
  52. package/scripts/capture-screenshots.mjs +191 -0
  53. package/scripts/demo-env.mjs +461 -0
  54. package/scripts/frame-screenshots.py +176 -0
  55. package/scripts/macbook-mockup.py +296 -0
  56. package/scripts/make-tray-icon.py +61 -0
  57. package/scripts/preview-candidate.mjs +291 -0
  58. package/scripts/publish-desktop.mjs +46 -0
  59. package/scripts/record-demo.mjs +229 -0
  60. package/scripts/release-version.mjs +32 -0
  61. package/scripts/render-cli-menu.py +157 -0
  62. package/scripts/requirements-dev.in +12 -0
  63. package/scripts/requirements-dev.txt +424 -0
  64. package/scripts/run-ui-regression.mjs +48 -0
  65. package/scripts/setup-hooks.sh +7 -13
  66. package/scripts/smoke-desktop.mjs +80 -0
  67. package/scripts/test-drag-and-drop.mjs +114 -0
  68. package/scripts/test-first-run.mjs +5 -0
  69. package/scripts/test-import-ui.mjs +5 -0
  70. package/scripts/test-preferences-persist.mjs +5 -0
  71. package/scripts/test-upgrade-from-published.mjs +226 -0
  72. package/scripts/verify-mac-build.sh +153 -0
  73. package/scripts/verify-windows-build.ps1 +15 -0
  74. package/server.json +3 -3
  75. package/skills/README.md +42 -0
  76. package/skills/ssh-incident/SKILL.md +55 -0
  77. package/skills/ssh-operations/SKILL.md +62 -0
  78. package/skills/ssh-restricted/SKILL.md +57 -0
  79. package/src/agent-clients.js +482 -0
  80. package/src/approval.js +291 -0
  81. package/src/audit.js +11 -1
  82. package/src/command-log.js +162 -0
  83. package/src/config-loader.js +119 -4
  84. package/src/config-paths.js +101 -0
  85. package/src/control-plane.js +2730 -0
  86. package/src/desktop-install.js +747 -0
  87. package/src/index.js +179 -213
  88. package/src/live-stream.js +261 -0
  89. package/src/saved-commands.js +150 -0
  90. package/src/secret-store.js +573 -0
  91. package/src/server-aliases.js +8 -7
  92. package/src/server-config-manager.js +33 -7
  93. package/src/server-export.js +106 -0
  94. package/src/server-groups.js +82 -21
  95. package/src/server-import.js +477 -0
  96. package/src/shell-quote.js +9 -2
  97. package/src/ssh-connection.js +155 -0
  98. package/src/ssh-manager.js +186 -13
  99. package/src/tunnel-manager.js +79 -0
  100. package/src/vault-recovery.js +206 -0
  101. package/src/xlsx.js +322 -0
  102. package/docs/images/social-preview.png +0 -0
  103. package/docs/images/social-preview@2x.png +0 -0
  104. package/docs/images/ssh-manager-cli-menu.png +0 -0
package/cli/ssh-manager CHANGED
@@ -47,91 +47,84 @@ show_version() {
47
47
  }
48
48
 
49
49
  # Show help
50
+ #
51
+ # In sections, with the commands aligned. Every command this help has ever
52
+ # listed is still here; `app` is new.
50
53
  show_help() {
54
+ local H="${ACCENT}${BOLD}" N="$NC"
51
55
  cat <<EOF
52
- ${BOLD}SSH Manager CLI${NC} - Simple and powerful SSH server management
53
56
 
54
- ${BOLD}USAGE:${NC}
55
- ssh-manager # Interactive mode (menu)
56
- ssh-manager -i # Interactive mode (menu)
57
- ssh-manager <command> # Direct command mode
57
+ ${H}▲ SSH Manager ${VERSION}${N} ${GRAY}servers, files and agent approvals${N}
58
58
 
59
- ${BOLD}COMMANDS:${NC}
60
- ${CYAN}server${NC} Server management
61
- add Add a new server
62
- list List all servers
63
- test Test server connection
64
- remove Remove a server
65
- edit Edit server configuration
66
- show Show server details
67
-
68
- ${CYAN}sync${NC} File synchronization (rsync)
69
- push Push files to server
70
- pull Pull files from server
71
-
72
- ${CYAN}tunnel${NC} SSH tunnel management
73
- create Create a new tunnel
74
- list List active tunnels
75
- close Close a tunnel
76
-
77
- ${CYAN}monitor${NC} System monitoring
78
- cpu Monitor CPU usage
79
- memory Monitor memory usage
80
- disk Monitor disk usage
81
- network Monitor network
82
-
83
- ${CYAN}session${NC} SSH session management
84
- start Start interactive session
85
- list List active sessions
86
- close Close a session
87
-
88
- ${CYAN}exec${NC} Execute commands
89
- run Run command on server
90
- group Run on server group
91
-
92
- ${CYAN}config${NC} Configuration
93
- edit Edit configuration
94
- show Show configuration
95
- init Initialize configuration
59
+ ${H}USAGE${N}
60
+ ssh-manager The menu (also: -i, --interactive)
61
+ ssh-manager <command> ... One command, for scripts and pipes
62
+
63
+ ${H}SERVERS${N}
64
+ server add Add a server, step by step
65
+ server list List configured servers
66
+ server test <name> Test a connection
67
+ server show <name> Show a server's settings
68
+ server edit <name> Edit a server
69
+ server remove <name> Remove a server
70
+ ssh <name> Open an SSH session (also: connect)
71
+ exec <name> <command> Run a command on a server
72
+ exec group <group> <command> Run it on a server group
73
+ monitor <name> <what> cpu · memory · disk · network
74
+ session start|list|close SSH sessions
75
+
76
+ ${H}FILES${N}
77
+ sync push <name> <src> <dest> Send files with rsync
78
+ sync pull <name> <src> <dest> Fetch files with rsync
79
+ tunnel create <name> <type> <ports>
80
+ <type>: local, remote or dynamic (SOCKS)
81
+ tunnel list Active tunnels
82
+ tunnel close Close a tunnel
96
83
 
97
- ${CYAN}tools${NC} Tool activation/deactivation
98
- list Show all tools and their status
99
- configure Interactive configuration wizard
100
- enable Enable a tool group
101
- disable Disable a tool group
102
- reset Reset to default (all tools enabled)
103
- export Export Claude Code auto-approval config
84
+ ${H}AGENTS AND THE INTERFACE${N}
85
+ control Watch what your agents run, and decide
86
+ before it runs, in your browser
87
+ app The desktop app: installs it if needed
88
+ (checked against the release), then opens it
89
+ app --status Whether it is installed, in one line
104
90
 
105
- ${BOLD}OPTIONS:${NC}
106
- -h, --help Show this help message
107
- -v, --version Show version
108
- -q, --quiet Quiet mode
109
- -d, --debug Debug mode
91
+ ${H}SETTINGS${N}
92
+ config edit|show|init The CLI's own settings
93
+ tools list|configure Which MCP tools your agents see
94
+ tools enable|disable <group> Turn a tool group on or off
95
+ tools reset Every tool back on
96
+ tools export Claude Code auto-approval config
97
+ vault import Take the servers in .env / TOML, encrypted
98
+ vault list What it holds, never a secret
99
+ vault status Where it and its key live
100
+ vault add|remove <name> One server in or out
101
+ vault backup|restore <file> A recovery file, under a passphrase
102
+ import <file> A spreadsheet, CSV, ~/.ssh/config, FileZilla,
103
+ PuTTY, Termius or MobaXterm export (detected)
104
+ import --from <tool> ssh-config · filezilla · transmit
105
+ import --template A spreadsheet to fill in and import back
106
+ export <file> .xlsx, .csv, .env or .toml
107
+ (never with passwords)
110
108
 
111
- ${BOLD}EXAMPLES:${NC}
112
- # Add a new server
109
+ ${H}OPTIONS${N}
110
+ -h, --help Show this help
111
+ -v, --version Show the version
112
+ -q, --quiet Quiet mode
113
+ -d, --debug Debug mode
114
+
115
+ ${H}EXAMPLES${N}
113
116
  ssh-manager server add
114
-
115
- # List all servers
116
- ssh-manager server list
117
-
118
- # Test connection to prod1
119
117
  ssh-manager server test prod1
120
-
121
- # Sync files to server
122
118
  ssh-manager sync push prod1 ./app /var/www/app
123
-
124
- # Create SSH tunnel
125
119
  ssh-manager tunnel create prod1 local 3307:localhost:3306
126
-
127
- # Monitor server
128
- ssh-manager monitor prod1 cpu
120
+ ssh-manager control
121
+ ssh-manager app
129
122
 
130
- ${BOLD}CONFIGURATION:${NC}
131
- Config directory: ${SSH_MANAGER_HOME:-~/.ssh-manager}
132
- Server config: ${SSH_MANAGER_ENV:-.env}
123
+ ${H}CONFIGURATION${N}
124
+ Config directory ${SSH_MANAGER_HOME:-~/.ssh-manager}
125
+ Server config ${SSH_MANAGER_ENV:-.env}
133
126
 
134
- ${BOLD}DOCUMENTATION:${NC}
127
+ ${H}DOCUMENTATION${N}
135
128
  https://github.com/bvisible/mcp-ssh-manager
136
129
 
137
130
  EOF
@@ -373,6 +366,28 @@ main() {
373
366
  tools)
374
367
  cmd_tools "$@"
375
368
  ;;
369
+ control)
370
+ # v4 control plane: approval socket + local page.
371
+ node "$SCRIPT_DIR/control.js" "$@"
372
+ ;;
373
+ app)
374
+ # The desktop application: installed if needed, checked against
375
+ # the release, then opened. Node, like control, so it shares the
376
+ # engine's code and works the same without Bash.
377
+ node "$SCRIPT_DIR/app.js" "$@"
378
+ ;;
379
+ import|export)
380
+ # Bringing servers in from other tools, and taking them out again.
381
+ # Node, because it writes through the same SecretStore the engine
382
+ # reads — one code path, so the two cannot disagree.
383
+ node "$SCRIPT_DIR/portability.js" "$command" "$@"
384
+ ;;
385
+ vault)
386
+ # v4 encrypted credential store. Implemented in Node because it uses
387
+ # the same SecretStore the MCP server reads from — one code path for
388
+ # writing and reading, so the CLI and the server can never disagree.
389
+ node "$SCRIPT_DIR/vault.js" "$@"
390
+ ;;
376
391
  config)
377
392
  case "$1" in
378
393
  edit)
@@ -411,6 +426,8 @@ interactive_mode() {
411
426
  exit 1
412
427
  fi
413
428
 
429
+ refresh_desktop_status
430
+
414
431
  while true; do
415
432
  show_main_menu
416
433
  read choice
@@ -489,15 +506,15 @@ interactive_mode() {
489
506
  5)
490
507
  # System Monitoring
491
508
  if select_server_menu "System Monitoring"; then
492
- echo
493
- print_subheader "Monitor Type"
494
- echo " 1) Overview"
495
- echo " 2) CPU"
496
- echo " 3) Memory"
497
- echo " 4) Disk"
498
- echo " 5) Network"
499
- echo
500
- read -p "Choose [1-5]: " monitor_type
509
+ clear
510
+ print_menu_header "Health of $selected_server"
511
+ menu_item 1 "Overview"
512
+ menu_item 2 "CPU"
513
+ menu_item 3 "Memory"
514
+ menu_item 4 "Disk"
515
+ menu_item 5 "Network"
516
+ menu_prompt "Choose [1-5]:"
517
+ read monitor_type
501
518
 
502
519
  case "$monitor_type" in
503
520
  1) cmd_exec "$selected_server" "uptime && free -h && df -h" ;;
@@ -525,13 +542,13 @@ interactive_mode() {
525
542
  7)
526
543
  # Configuration
527
544
  clear
528
- print_header "Configuration"
529
- echo " 1) Edit CLI config"
530
- echo " 2) Show CLI config"
531
- echo " 3) Edit server config (.env)"
532
- echo " 0) Back"
533
- echo
534
- read -p "Choose [0-3]: " config_choice
545
+ print_menu_header "Configuration"
546
+ menu_item 1 "Edit CLI config"
547
+ menu_item 2 "Show CLI config"
548
+ menu_item 3 "Edit server config (.env)"
549
+ menu_item 0 "Back"
550
+ menu_prompt "Choose [0-3]:"
551
+ read config_choice
535
552
 
536
553
  case "$config_choice" in
537
554
  1) ${EDITOR:-nano} "$SSH_MANAGER_CONFIG" ;;
@@ -539,9 +556,98 @@ interactive_mode() {
539
556
  3) cmd_server_edit ;;
540
557
  esac
541
558
  ;;
542
- 8)
543
- # Help
544
- show_help | less
559
+ 8|'?')
560
+ # Help. 8 since 3.1; the home screen shows ?. -R keeps the
561
+ # palette instead of printing its escape codes.
562
+ show_help | less -R
563
+ ;;
564
+ 9)
565
+ # The control plane runs in the foreground and holds the approval
566
+ # socket, so it takes over this terminal until Ctrl-C. Say so
567
+ # first: a menu entry that appears to hang is a menu entry people
568
+ # kill and never try again.
569
+ echo
570
+ print_info "The control plane runs here until you stop it with Ctrl-C."
571
+ echo "It opens a local page showing what your agents are doing on"
572
+ echo "your servers, and lets you approve or refuse a command before"
573
+ echo "it runs. Closing it puts everything back the way it was."
574
+ echo
575
+ read -p "Start it? [Y/n] " start_control
576
+ case "$start_control" in
577
+ n|N) ;;
578
+ *) node "$SCRIPT_DIR/control.js" ;;
579
+ esac
580
+ ;;
581
+ a|A)
582
+ # The desktop application. Downloads only now, on this key,
583
+ # and only after the release has vouched for the file.
584
+ node "$SCRIPT_DIR/app.js" || true
585
+ refresh_desktop_status
586
+ read -p "Press Enter to continue..."
587
+ ;;
588
+ t|T)
589
+ # MCP tools: which of them agents see.
590
+ clear
591
+ print_menu_header "MCP tools"
592
+ menu_item 1 "Show what is enabled" "ssh-manager tools list"
593
+ menu_item 2 "Choose which tools agents see" "ssh-manager tools configure"
594
+ menu_item 0 "Back"
595
+ menu_prompt "Choose [0-2]:"
596
+ read tools_choice
597
+ case "$tools_choice" in
598
+ 1) cmd_tools list || true; echo; read -p "Press Enter to continue..." ;;
599
+ 2) cmd_tools configure || true ;;
600
+ esac
601
+ ;;
602
+ v|V)
603
+ # The encrypted vault, through the same Node command as
604
+ # `ssh-manager vault`.
605
+ clear
606
+ print_menu_header "Encrypted vault"
607
+ menu_item 1 "What it holds" "ssh-manager vault list (never prints a secret)"
608
+ menu_item 2 "Where it and its key live" "ssh-manager vault status"
609
+ menu_item 3 "Take the servers in .env / TOML" "ssh-manager vault import"
610
+ menu_item 0 "Back"
611
+ echo
612
+ echo " ${GRAY}More, including recovery files: ssh-manager vault --help${NC}"
613
+ menu_prompt "Choose [0-3]:"
614
+ read vault_choice
615
+ case "$vault_choice" in
616
+ 1) node "$SCRIPT_DIR/vault.js" list || true ;;
617
+ 2) node "$SCRIPT_DIR/vault.js" status || true ;;
618
+ 3) node "$SCRIPT_DIR/vault.js" import || true ;;
619
+ esac
620
+ case "$vault_choice" in
621
+ 1|2|3) echo; read -p "Press Enter to continue..." ;;
622
+ esac
623
+ ;;
624
+ i|I)
625
+ # Servers from somewhere else, through `ssh-manager import`.
626
+ clear
627
+ print_menu_header "Import servers"
628
+ menu_item 1 "From ~/.ssh/config"
629
+ menu_item 2 "From FileZilla"
630
+ menu_item 3 "From Transmit"
631
+ menu_item 4 "From a file" "A spreadsheet, CSV, PuTTY, Termius or MobaXterm export"
632
+ menu_item 5 "Write a spreadsheet to fill in"
633
+ menu_item 0 "Back"
634
+ menu_prompt "Choose [0-5]:"
635
+ read import_choice
636
+ case "$import_choice" in
637
+ 1) node "$SCRIPT_DIR/portability.js" import --from ssh-config || true ;;
638
+ 2) node "$SCRIPT_DIR/portability.js" import --from filezilla || true ;;
639
+ 3) node "$SCRIPT_DIR/portability.js" import --from transmit || true ;;
640
+ 4)
641
+ read -r -p " File to import: " import_file
642
+ if [ -n "$import_file" ]; then
643
+ node "$SCRIPT_DIR/portability.js" import "${import_file/#\~/$HOME}" || true
644
+ fi
645
+ ;;
646
+ 5) node "$SCRIPT_DIR/portability.js" import --template || true ;;
647
+ esac
648
+ case "$import_choice" in
649
+ 1|2|3|4|5) echo; read -p "Press Enter to continue..." ;;
650
+ esac
545
651
  ;;
546
652
  0|q|Q)
547
653
  print_info "Goodbye!"
@@ -27,6 +27,20 @@ if (!existsSync(bashScript)) {
27
27
  const isWindows = platform() === 'win32';
28
28
  const args = process.argv.slice(2);
29
29
 
30
+ // These commands are native Node and also work on Windows without Git Bash.
31
+ const nativeCommands = { control: 'control.js', vault: 'vault.js', import: 'portability.js', export: 'portability.js', app: 'app.js' };
32
+ if (Object.hasOwn(nativeCommands, args[0])) {
33
+ const commandArgs = ['import', 'export'].includes(args[0]) ? args : args.slice(1);
34
+ const result = spawnSync(process.execPath, [join(__dirname, nativeCommands[args[0]]), ...commandArgs], { stdio: 'inherit' });
35
+ if (result.error) console.error(`[ssh-manager] ${result.error.message}`);
36
+ process.exit(result.status ?? 1);
37
+ }
38
+
39
+ // No "new in v4" invitation, not even once. Someone who uses the CLI and the
40
+ // npm engine as they always have gets exactly that: the interface and the
41
+ // desktop app are one key away in the menu (a) for whoever wants them, and say
42
+ // nothing to whoever does not.
43
+
30
44
  /**
31
45
  * Convert a Windows-style path (C:\foo\bar) into a POSIX-style path
32
46
  * understood by Git Bash / MSYS (/c/foo/bar). Leaves non-Windows paths alone.
package/cli/style.js ADDED
@@ -0,0 +1,17 @@
1
+ // Terminal styles for the Node commands of the CLI.
2
+ //
3
+ // NO_COLOR (https://no-color.org): when set and not empty, no colour. Bold and
4
+ // dim stay, being emphasis rather than colour, and the application's orange
5
+ // falls back to bold — the same rules as cli/lib/colors.sh.
6
+
7
+ const noColor = Boolean(process.env.NO_COLOR);
8
+ const colour = code => (noColor ? '' : code);
9
+
10
+ export const RED = colour('\x1b[31m');
11
+ export const GREEN = colour('\x1b[32m');
12
+ export const YELLOW = colour('\x1b[33m');
13
+ export const BOLD = '\x1b[1m';
14
+ export const DIM = '\x1b[2m';
15
+ export const RESET = '\x1b[0m';
16
+ /** The application's orange, #c04500: 256-colour 166. */
17
+ export const ORANGE = noColor ? BOLD : '\x1b[38;5;166m';