heyvm 1.0.0

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 (112) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +621 -0
  3. package/bin/file-browser +0 -0
  4. package/bin/heyvm +0 -0
  5. package/bin/heyvm-core +0 -0
  6. package/bin/heyvm.js +61 -0
  7. package/core/README.md +51 -0
  8. package/core/cmd/heyvm-core/main.go +73 -0
  9. package/core/go.mod +25 -0
  10. package/core/go.sum +47 -0
  11. package/core/internal/auth/errors.go +29 -0
  12. package/core/internal/auth/password.go +187 -0
  13. package/core/internal/auth/provider.go +33 -0
  14. package/core/internal/auth/ssh_key.go +142 -0
  15. package/core/internal/config/config.go +111 -0
  16. package/core/internal/ipc/actions.go +738 -0
  17. package/core/internal/ipc/handler.go +281 -0
  18. package/core/internal/ipc/protocol.go +126 -0
  19. package/core/internal/sftp/errors.go +29 -0
  20. package/core/internal/sftp/manager.go +303 -0
  21. package/core/internal/sftp/types.go +30 -0
  22. package/core/internal/ssh/errors.go +23 -0
  23. package/core/internal/ssh/manager.go +226 -0
  24. package/core/internal/ssh/session.go +105 -0
  25. package/core/internal/vm/errors.go +35 -0
  26. package/core/internal/vm/models.go +84 -0
  27. package/core/internal/vm/registry.go +240 -0
  28. package/package.json +59 -0
  29. package/scripts/install.js +100 -0
  30. package/ui/README.md +43 -0
  31. package/ui/dist/App.d.ts +3 -0
  32. package/ui/dist/App.d.ts.map +1 -0
  33. package/ui/dist/App.js +142 -0
  34. package/ui/dist/App.js.map +1 -0
  35. package/ui/dist/components/ConfirmDialog.d.ts +9 -0
  36. package/ui/dist/components/ConfirmDialog.d.ts.map +1 -0
  37. package/ui/dist/components/ConfirmDialog.js +22 -0
  38. package/ui/dist/components/ConfirmDialog.js.map +1 -0
  39. package/ui/dist/components/ErrorMessage.d.ts +8 -0
  40. package/ui/dist/components/ErrorMessage.d.ts.map +1 -0
  41. package/ui/dist/components/ErrorMessage.js +10 -0
  42. package/ui/dist/components/ErrorMessage.js.map +1 -0
  43. package/ui/dist/components/Header.d.ts +8 -0
  44. package/ui/dist/components/Header.d.ts.map +1 -0
  45. package/ui/dist/components/Header.js +10 -0
  46. package/ui/dist/components/Header.js.map +1 -0
  47. package/ui/dist/components/LoadingSpinner.d.ts +7 -0
  48. package/ui/dist/components/LoadingSpinner.d.ts.map +1 -0
  49. package/ui/dist/components/LoadingSpinner.js +7 -0
  50. package/ui/dist/components/LoadingSpinner.js.map +1 -0
  51. package/ui/dist/components/StatusBar.d.ts +11 -0
  52. package/ui/dist/components/StatusBar.d.ts.map +1 -0
  53. package/ui/dist/components/StatusBar.js +11 -0
  54. package/ui/dist/components/StatusBar.js.map +1 -0
  55. package/ui/dist/core/ipc.d.ts +96 -0
  56. package/ui/dist/core/ipc.d.ts.map +1 -0
  57. package/ui/dist/core/ipc.js +310 -0
  58. package/ui/dist/core/ipc.js.map +1 -0
  59. package/ui/dist/core/types.d.ts +45 -0
  60. package/ui/dist/core/types.d.ts.map +1 -0
  61. package/ui/dist/core/types.js +3 -0
  62. package/ui/dist/core/types.js.map +1 -0
  63. package/ui/dist/hooks/useFiles.d.ts +14 -0
  64. package/ui/dist/hooks/useFiles.d.ts.map +1 -0
  65. package/ui/dist/hooks/useFiles.js +102 -0
  66. package/ui/dist/hooks/useFiles.js.map +1 -0
  67. package/ui/dist/hooks/useVM.d.ts +10 -0
  68. package/ui/dist/hooks/useVM.d.ts.map +1 -0
  69. package/ui/dist/hooks/useVM.js +54 -0
  70. package/ui/dist/hooks/useVM.js.map +1 -0
  71. package/ui/dist/hooks/useVMList.d.ts +10 -0
  72. package/ui/dist/hooks/useVMList.d.ts.map +1 -0
  73. package/ui/dist/hooks/useVMList.js +56 -0
  74. package/ui/dist/hooks/useVMList.js.map +1 -0
  75. package/ui/dist/index.d.ts +3 -0
  76. package/ui/dist/index.d.ts.map +1 -0
  77. package/ui/dist/index.js +7488 -0
  78. package/ui/dist/index.js.map +1 -0
  79. package/ui/dist/keybindings.d.ts +146 -0
  80. package/ui/dist/keybindings.d.ts.map +1 -0
  81. package/ui/dist/keybindings.js +96 -0
  82. package/ui/dist/keybindings.js.map +1 -0
  83. package/ui/dist/screens/AddVMScreen.d.ts +9 -0
  84. package/ui/dist/screens/AddVMScreen.d.ts.map +1 -0
  85. package/ui/dist/screens/AddVMScreen.js +163 -0
  86. package/ui/dist/screens/AddVMScreen.js.map +1 -0
  87. package/ui/dist/screens/VMDetailScreen.d.ts +12 -0
  88. package/ui/dist/screens/VMDetailScreen.d.ts.map +1 -0
  89. package/ui/dist/screens/VMDetailScreen.js +96 -0
  90. package/ui/dist/screens/VMDetailScreen.js.map +1 -0
  91. package/ui/dist/screens/VMListScreen.d.ts +12 -0
  92. package/ui/dist/screens/VMListScreen.d.ts.map +1 -0
  93. package/ui/dist/screens/VMListScreen.js +158 -0
  94. package/ui/dist/screens/VMListScreen.js.map +1 -0
  95. package/ui/dist/screens/tabs/FilesTab.d.ts +9 -0
  96. package/ui/dist/screens/tabs/FilesTab.d.ts.map +1 -0
  97. package/ui/dist/screens/tabs/FilesTab.js +374 -0
  98. package/ui/dist/screens/tabs/FilesTab.js.map +1 -0
  99. package/ui/dist/screens/tabs/OverviewTab.d.ts +10 -0
  100. package/ui/dist/screens/tabs/OverviewTab.d.ts.map +1 -0
  101. package/ui/dist/screens/tabs/OverviewTab.js +110 -0
  102. package/ui/dist/screens/tabs/OverviewTab.js.map +1 -0
  103. package/ui/dist/screens/tabs/TerminalTab.d.ts +9 -0
  104. package/ui/dist/screens/tabs/TerminalTab.d.ts.map +1 -0
  105. package/ui/dist/screens/tabs/TerminalTab.js +270 -0
  106. package/ui/dist/screens/tabs/TerminalTab.js.map +1 -0
  107. package/ui/dist/utils/terminalEmulator.d.ts +49 -0
  108. package/ui/dist/utils/terminalEmulator.d.ts.map +1 -0
  109. package/ui/dist/utils/terminalEmulator.js +88 -0
  110. package/ui/dist/utils/terminalEmulator.js.map +1 -0
  111. package/ui/package.json +34 -0
  112. package/ui/scripts/start-with-core.js +81 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Adish M
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,621 @@
1
+ # heyvm
2
+
3
+ [![npm version](https://img.shields.io/npm/v/heyvm.svg)](https://www.npmjs.com/package/heyvm)
4
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
5
+
6
+ > A zero-config, interactive terminal UI to connect, manage, and transfer files to VMs over SSH
7
+
8
+ ## Overview
9
+
10
+ **heyvm** is a lazygit-style TUI (Terminal User Interface) for managing VMs via SSH. It eliminates the need to remember SSH/SCP syntax, manually track IPs and credentials, or juggle multiple tools for terminal access and file transfer.
11
+
12
+ ### Key Features
13
+
14
+ - **Split-Pane Interface**: View your VM list and details side-by-side
15
+ - **Interactive TUI**: Fully keyboard-driven navigation with intuitive controls
16
+ - **Full Terminal Emulator**: Complete SSH terminal with xterm.js - vim, nano, htop all work
17
+ - **Terminal Scrollback**: 1000 lines of history with smooth scrolling
18
+ - **File Browser**: Dual-pane file manager for easy local ↔ remote file transfers
19
+ - **Secure Credentials**: Password and SSH key storage via OS keychain
20
+ - **Multiple Auth Methods**: Support for SSH keys and password authentication
21
+ - **Zero Config**: No configuration files to write - just add a VM and go
22
+
23
+ ## Architecture
24
+
25
+ heyvm uses a modern two-tier architecture with clean separation of concerns:
26
+
27
+ 1. **UI Layer** (TypeScript + Ink) - Interactive terminal interface
28
+ 2. **Core Backend** (Go) - SSH/SFTP operations, VM management, and credential storage
29
+
30
+ These components communicate via **JSON-RPC over stdio**, providing process isolation, clear API boundaries, and easy debugging.
31
+
32
+ ```
33
+ ┌──────────────────────────────┐
34
+ │ Ink TUI (TypeScript) │
35
+ │ - Split-pane interface │
36
+ │ - VM list & detail screens │
37
+ │ - File browser │
38
+ │ - Terminal view │
39
+ │ - Forms & dialogs │
40
+ └──────────────┬───────────────┘
41
+ │ JSON-RPC (stdio)
42
+ ┌──────────────▼───────────────┐
43
+ │ heyvm-core (Go Backend) │
44
+ │ - SSH session manager │
45
+ │ - SFTP file operations │
46
+ │ - VM registry & config │
47
+ │ - Secure auth handling │
48
+ │ - OS keychain integration │
49
+ └──────────────┬───────────────┘
50
+ │ SSH/SFTP
51
+ ┌─────▼──────┐
52
+ │ Remote VMs │
53
+ └────────────┘
54
+ ```
55
+
56
+ ## Quick Start
57
+
58
+ ### Prerequisites
59
+
60
+ - **Node.js** >= 18.0.0
61
+ - **Go** >= 1.21
62
+ - SSH access to at least one VM (for testing)
63
+
64
+ ### Installation (Global - Recommended)
65
+
66
+ Install heyvm globally via npm:
67
+
68
+ ```bash
69
+ npm install -g heyvm
70
+ ```
71
+
72
+ Then run from anywhere:
73
+
74
+ ```bash
75
+ heyvm
76
+ ```
77
+
78
+ ### Installation (From Source)
79
+
80
+ For development or contributing:
81
+
82
+ ```bash
83
+ # Clone the repository
84
+ git clone https://github.com/adishm/heyvm.git
85
+ cd heyvm
86
+
87
+ # Install dependencies for both UI and Core backend
88
+ make install
89
+
90
+ # Build the complete application
91
+ make build-all
92
+ ```
93
+
94
+ ### Running heyvm
95
+
96
+ ```bash
97
+ # If installed globally
98
+ heyvm
99
+
100
+ # From source - development mode (with hot reload)
101
+ make dev
102
+
103
+ # From source - production build
104
+ make run
105
+ ```
106
+
107
+ The UI will start in your terminal, and the Go backend will run as a background process communicating via stdio.
108
+
109
+ ## Usage
110
+
111
+ ### Interface Layout
112
+
113
+ heyvm uses a **split-pane interface** with three main screens:
114
+
115
+ #### 1. VM List & Overview Screen
116
+
117
+ ```
118
+ ┌─────────────────────────────┐┌────────────────────────────────────────────────────────┐
119
+ │ ││ │
120
+ │ VMs (3) ││ ▶ Overview Terminal Files │
121
+ │ ││ │
122
+ │ ▶ ● production-web ││ VM: production-web │
123
+ │ ubuntu@192.168.1.100 ││ Status: ● Connected │
124
+ │ ││ Host: 192.168.1.100:22 │
125
+ │ ○ staging-api ││ User: ubuntu │
126
+ │ admin@10.0.0.50 ││ Auth: SSH Key (~/.ssh/id_rsa) │
127
+ │ ││ │
128
+ │ ○ dev-database ││ Last Connected: 2 minutes ago │
129
+ │ root@172.16.0.10 ││ │
130
+ │ ││ Actions: │
131
+ │ ● connected ○ ││ [c] Connect [x] Disconnect [t] Test │
132
+ │ disconnected ◐ connecting ││ │
133
+ │ ││ System Info: │
134
+ │ ┌─────────────────────────┐ ││ Loading... │
135
+ │ │ j/k navigate • Enter │ ││ │
136
+ │ │ select • a add • d │ ││ │
137
+ │ │ delete • r refresh │ ││ │
138
+ │ └─────────────────────────┘ ││ │
139
+ │ ││ │
140
+ └─────────────────────────────┘└────────────────────────────────────────────────────────┘
141
+ [Esc] VM List • [1] Overview • [2] Terminal • [3] Files • [q] Quit
142
+ ```
143
+
144
+ #### 2. Terminal Tab (Full SSH Terminal)
145
+
146
+ ```
147
+ ┌─────────────────────────────┐┌────────────────────────────────────────────────────────┐
148
+ │ ││ │
149
+ │ VMs (3) ││ Overview ▶ Terminal Files │
150
+ │ ││ │
151
+ │ ▶ ● production-web ││ ubuntu@production-web:~$ htop │
152
+ │ ubuntu@192.168.1.100 ││ │
153
+ │ ││ 1 [||||||||||||||||100.0%] Tasks: 89, 147 thr │
154
+ │ ○ staging-api ││ 2 [|||||||||| 45.3%] Load average: 0.52 │
155
+ │ admin@10.0.0.50 ││ Mem[|||||||||||||2.1G/4.0G] Uptime: 14 days │
156
+ │ ││ Swp[ 0K/2.0G] │
157
+ │ ○ dev-database ││ │
158
+ │ root@172.16.0.10 ││ PID USER PRI NI VIRT RES SHR S CPU% MEM% │
159
+ │ ││ 1234 ubuntu 20 0 123M 45M 12M S 5.2 1.1 │
160
+ │ ● connected ○ ││ 5678 ubuntu 20 0 456M 89M 23M R 15.7 2.2 │
161
+ │ disconnected ◐ connecting ││ 9012 root 20 0 1024M 234M 34M S 0.0 5.8 │
162
+ │ ││ │
163
+ │ ││ ubuntu@production-web:~$ vim /etc/nginx/nginx.conf │
164
+ │ ││ │
165
+ │ ││ Full terminal emulator - vim, nano, htop all work! │
166
+ │ ││ Scroll history: PgUp/PgDn or Shift+↑/↓ (1000 lines) │
167
+ └─────────────────────────────┘└────────────────────────────────────────────────────────┘
168
+ [Ctrl+O] Overview • [Esc] VM List • Interactive terminal (all keys work)
169
+ ```
170
+
171
+ #### 3. Files Tab (Dual-Pane File Browser with Progress)
172
+
173
+ ```
174
+ ┌──────────────────────────────┐ ┌──────────────────────────────────────────────────────────┐
175
+ │ │ │ │
176
+ │ VMs (3) │ │ Overview Terminal ▶ Files │
177
+ │ │ │ │
178
+ │ ▶ ● production-web │ │ ┌─ ↑ Uploading: application.tar.gz ──────────────────┐ │
179
+ │ ubuntu@192.168.1.100 │ │ │ ████████████████████████████░░░░░░░░░ 68.4% │ │
180
+ │ │ │ │ 137.2M / 200.5M │ │
181
+ │ ○ staging-api │ │ └────────────────────────────────────────────────────┘ │
182
+ │ admin@10.0.0.50 │ │ │
183
+ │ │ │ ┌──────────────────────────┬────────────────────────┐ │
184
+ │ ○ dev-database │ │ │ ▶ Local: ~/projects/app │ Remote: /var/www/app │ │
185
+ │ root@172.16.0.10 │ │ ├──────────────────────────┼────────────────────────┤ │
186
+ │ │ │ │ 📁 .. │ 📁 .. │ │
187
+ │ ● connected │ │ │ 📁 src 45K │ 📁 public 12K │ │
188
+ │ ○ disconnected │ │ │ 📁 dist 3.2M │ 📁 logs 456K │ │
189
+ │ ◐ connecting │ │ │ ▶ 📄 package.json 2.3K │ 📄 app.js 89K │ │
190
+ │ │ │ │ 📄 tsconfig.json 1.1K │ 📄 config.yml 1.2K │ │
191
+ │ │ │ │ 📄 README.md 8.9K │ 📁 node_modules │ │
192
+ │ │ │ │ 📄 .gitignore 456B │ 📄 .env 512B │ │
193
+ │ │ │ │ │ │ │
194
+ │ │ │ └──────────────────────────┴────────────────────────┘ │
195
+ └──────────────────────────────┘ └─────────────────────────────────────────────────────────┘
196
+
197
+ [Tab] Switch pane • [j/k] Navigate • [Enter] Open • [p] Push • [g] Get • [/] Search
198
+
199
+ ```
200
+
201
+ Navigate between panes using keyboard shortcuts to efficiently manage your VMs.
202
+
203
+ ### Keyboard Shortcuts
204
+
205
+ #### VM List (Left Pane)
206
+ - **`j`/`k`** or **`↑`/`↓`** - Navigate through VMs
207
+ - **`Enter`** - Select VM (switches focus to right pane)
208
+ - **`a`** - Add new VM
209
+ - **`d`** - Delete selected VM
210
+ - **`r`** - Refresh VM list
211
+ - **`q`** - Quit application
212
+
213
+ #### VM Detail (Right Pane)
214
+ - **`1`** - Switch to Overview tab
215
+ - **`2`** - Switch to Terminal tab
216
+ - **`3`** - Switch to Files tab
217
+ - **`c`** - Connect to VM (establish SSH session)
218
+ - **`x`** - Disconnect from VM
219
+ - **`Esc`** - Return focus to VM list (left pane)
220
+
221
+ #### Terminal Tab
222
+ - **All keys** - Sent directly to remote shell (complete terminal liberty)
223
+ - **`PgUp`/`PgDn`** or **`Shift+↑`/`↓`** - Scroll through terminal history (1000 lines)
224
+ - **`Ctrl+O`** - Switch to Overview tab (keeps session alive)
225
+ - **`Esc`** - Return to VM list
226
+ - **Interactive programs**: vim, nano, htop, sudo all work perfectly
227
+
228
+ #### File Browser
229
+ - **`Tab`** - Switch between local (left) and remote (right) file panes
230
+ - **`j`/`k`** or **`↑`/`↓`** - Navigate through files/directories
231
+ - **`Enter`** - Enter selected directory
232
+ - **`Backspace`** or **`h`** - Go to parent directory
233
+ - **`p`** - Push file (copy from local → remote)
234
+ - **`g`** - Get file (copy from remote → local)
235
+ - **`d`** - Delete selected file
236
+ - **`r`** - Refresh current directory
237
+ - **`Esc`** - Return to VM detail view
238
+
239
+ ### Adding a VM
240
+
241
+ 1. Press **`a`** in the VM list screen
242
+ 2. Select authentication method:
243
+ - **SSH Key** - Use existing SSH key file
244
+ - **Password** - Store password securely in OS keychain
245
+ 3. Enter connection details:
246
+ - **Name** - Friendly identifier for the VM
247
+ - **Host** - IP address or hostname
248
+ - **Port** - SSH port (default: 22)
249
+ - **Username** - SSH user account
250
+ - **SSH Key Path** (if using key auth) - Path to private key file (e.g., `~/.ssh/id_rsa`)
251
+ 4. Press **`Enter`** to save
252
+
253
+ heyvm will automatically validate the connection and persist the VM configuration to `~/.heyvm/config.yaml`.
254
+
255
+ ### Connecting to a VM
256
+
257
+ 1. Select a VM from the list with **`Enter`**
258
+ 2. Press **`c`** to establish SSH connection
259
+ 3. Switch to Terminal tab (**`2`**) for full interactive shell:
260
+ - Complete terminal emulator with ANSI support
261
+ - Works with vim, nano, htop, sudo, and all interactive programs
262
+ - Scroll through history with **`PgUp`/`PgDn`** or **`Shift+↑`/`↓`**
263
+ - Press **`Ctrl+O`** to switch to Overview without closing terminal
264
+ 4. Or switch to Files tab (**`3`**) to browse and transfer files
265
+
266
+ ## Development
267
+
268
+ ### Project Structure
269
+
270
+ ```
271
+ heyvm/
272
+ ├── ui/ # Frontend - TypeScript/Ink TUI
273
+ │ ├── src/
274
+ │ │ ├── components/ # Reusable UI components
275
+ │ │ │ ├── Header.tsx
276
+ │ │ │ ├── StatusBar.tsx
277
+ │ │ │ ├── LoadingSpinner.tsx
278
+ │ │ │ ├── ErrorMessage.tsx
279
+ │ │ │ └── ConfirmDialog.tsx
280
+ │ │ ├── screens/ # Main screen components
281
+ │ │ │ ├── VMListScreen.tsx
282
+ │ │ │ ├── AddVMScreen.tsx
283
+ │ │ │ ├── VMDetailScreen.tsx
284
+ │ │ │ └── tabs/
285
+ │ │ │ ├── OverviewTab.tsx
286
+ │ │ │ ├── TerminalTab.tsx
287
+ │ │ │ └── FilesTab.tsx
288
+ │ │ ├── hooks/ # Custom React hooks
289
+ │ │ │ ├── useVM.ts
290
+ │ │ │ ├── useVMList.ts
291
+ │ │ │ └── useFiles.ts
292
+ │ │ ├── utils/ # Utility functions
293
+ │ │ │ └── terminalEmulator.ts # xterm.js wrapper
294
+ │ │ ├── core/ # IPC client and type definitions
295
+ │ │ │ ├── ipc.ts
296
+ │ │ │ └── types.ts
297
+ │ │ ├── keybindings.ts # Keyboard shortcut definitions
298
+ │ │ ├── App.tsx # Main application component
299
+ │ │ └── index.tsx # Entry point
300
+ │ ├── scripts/
301
+ │ │ └── start-with-core.js # Development launcher
302
+ │ ├── package.json
303
+ │ └── tsconfig.json
304
+ ├── core/ # Backend - Go
305
+ │ ├── cmd/
306
+ │ │ ├── heyvm-core/ # Main backend entry point
307
+ │ │ ├── heyvm/ # CLI wrapper
308
+ │ │ └── file-browser/ # Standalone file browser
309
+ │ ├── internal/
310
+ │ │ ├── auth/ # Authentication providers
311
+ │ │ │ ├── provider.go
312
+ │ │ │ ├── ssh_key.go
313
+ │ │ │ └── password.go
314
+ │ │ ├── config/ # Configuration management
315
+ │ │ ├── ipc/ # JSON-RPC protocol handler
316
+ │ │ │ ├── handler.go
317
+ │ │ │ ├── protocol.go
318
+ │ │ │ └── actions.go
319
+ │ │ ├── sftp/ # File transfer operations
320
+ │ │ │ ├── manager.go
321
+ │ │ │ ├── types.go
322
+ │ │ │ └── errors.go
323
+ │ │ ├── ssh/ # SSH session management
324
+ │ │ │ ├── manager.go
325
+ │ │ │ ├── session.go
326
+ │ │ │ └── errors.go
327
+ │ │ ├── vm/ # VM models and registry
328
+ │ │ │ ├── registry.go
329
+ │ │ │ ├── models.go
330
+ │ │ │ └── errors.go
331
+ │ │ └── tui/ # Terminal UI utilities
332
+ │ └── go.mod
333
+ ├── docs/ # Documentation
334
+ │ ├── PRD.md # Product requirements
335
+ │ ├── architecture.md # System architecture
336
+ │ ├── development.md # Development guide
337
+ │ └── exploration/ # Development notes
338
+ ├── bin/ # Compiled binaries (generated)
339
+ │ ├── heyvm-core
340
+ │ ├── heyvm
341
+ │ └── file-browser
342
+ ├── build/ # Build artifacts (generated)
343
+ ├── Makefile # Build automation
344
+ ├── README.md # This file
345
+ └── LICENSE
346
+ ```
347
+
348
+ ### Technology Stack
349
+
350
+ #### UI Layer
351
+ - **Framework**: [Ink](https://github.com/vadimdemedes/ink) - React for interactive CLIs
352
+ - **Language**: TypeScript
353
+ - **Build Tool**: esbuild
354
+ - **Terminal Emulator**: [@xterm/headless](https://www.npmjs.com/package/@xterm/headless) - Full ANSI/VT100 support
355
+ - **Key Libraries**:
356
+ - `ink-select-input` - Interactive selection lists
357
+ - `ink-text-input` - Text input components
358
+
359
+ #### Core Backend
360
+ - **Language**: Go 1.24+
361
+ - **SSH/SFTP**: `golang.org/x/crypto/ssh` + `pkg/sftp`
362
+ - **Credential Storage**: `99designs/keyring` (OS keychain integration)
363
+ - **Configuration**: YAML (`gopkg.in/yaml.v3`)
364
+ - **IPC Protocol**: JSON-RPC over stdin/stdout
365
+
366
+ ### Build Commands
367
+
368
+ ```bash
369
+ # Install all dependencies (UI + Core)
370
+ make install
371
+
372
+ # Build individual components
373
+ make build-ui # Build TypeScript UI only
374
+ make build-core # Build Go backend only
375
+ make build-all # Build everything
376
+
377
+ # Development
378
+ make dev # Run with hot reload
379
+ make run # Run production build
380
+
381
+ # Testing
382
+ make test # Run all tests
383
+
384
+ # Cleanup
385
+ make clean # Remove build artifacts
386
+
387
+ # Help
388
+ make help # Show all available commands
389
+ ```
390
+
391
+ ### Development Workflow
392
+
393
+ 1. **Start development mode**:
394
+ ```bash
395
+ make dev
396
+ ```
397
+ This builds the Go backend and runs the UI with TypeScript compilation.
398
+
399
+ 2. **Make changes** to either UI (TypeScript) or Core (Go) code
400
+
401
+ 3. **Test changes**:
402
+ - For UI changes: The dev mode supports hot reload
403
+ - For Core changes: Rebuild with `make build-core` and restart
404
+
405
+ 4. **Run tests**:
406
+ ```bash
407
+ make test
408
+ ```
409
+
410
+ ### Adding New Features
411
+
412
+ #### UI Components
413
+ Add new components in `ui/src/components/` and import them in your screens.
414
+
415
+ #### Backend Functionality
416
+ 1. Add new methods in `core/internal/ipc/actions.go`
417
+ 2. Register them in the IPC handler
418
+ 3. Add corresponding TypeScript types in `ui/src/core/types.ts`
419
+ 4. Call from UI using `ipcClient` in `ui/src/core/ipc.ts`
420
+
421
+ ## Security
422
+
423
+ heyvm takes security seriously and implements multiple layers of protection:
424
+
425
+ ### Credential Storage
426
+ - **Passwords**: Securely stored in OS-native keychain:
427
+ - macOS: Keychain
428
+ - Linux: Secret Service (GNOME Keyring, KWallet)
429
+ - Windows: Credential Manager
430
+ - **SSH Keys**: Never copied or stored - referenced by file path only
431
+ - **Access**: Credentials are only accessed when establishing connections
432
+
433
+ ### Data Protection
434
+ - **Passwords**: Never logged or written to disk in plaintext
435
+ - **Config Files**: Stored with `0600` permissions (owner read/write only) in `~/.heyvm/`
436
+ - **Logs**: Sanitized to prevent credential leakage
437
+ - **Memory**: Sensitive data cleared from memory after use
438
+
439
+ ### SSH Security
440
+ - **Host Key Verification**: Verified on first connection
441
+ - **Known Hosts**: Tracked to prevent man-in-the-middle attacks
442
+ - **Connection Isolation**: Each VM connection is independent
443
+
444
+ ### Process Isolation
445
+ - UI and Core backend run as separate processes
446
+ - Communication only via controlled JSON-RPC interface
447
+ - No shared memory or state
448
+
449
+ ## Configuration
450
+
451
+ heyvm stores all configuration and state in `~/.heyvm/`:
452
+
453
+ ```
454
+ ~/.heyvm/
455
+ ├── config.yaml # VM definitions and settings
456
+ ├── state.json # Runtime state (connections, sessions)
457
+ ├── known_hosts # SSH host key verification
458
+ └── logs/
459
+ └── heyvm-core.log # Backend logs
460
+ ```
461
+
462
+ ### Configuration File Format
463
+
464
+ Example `config.yaml`:
465
+
466
+ ```yaml
467
+ vms:
468
+ - id: "vm-001"
469
+ name: "Production API Server"
470
+ host: "api.example.com"
471
+ port: 22
472
+ user: "deploy"
473
+ auth:
474
+ type: "key"
475
+ key_path: "~/.ssh/production.pem"
476
+
477
+ - id: "vm-002"
478
+ name: "Development Database"
479
+ host: "10.0.1.50"
480
+ port: 22
481
+ user: "ubuntu"
482
+ auth:
483
+ type: "password"
484
+ # Password stored securely in OS keychain
485
+ ```
486
+
487
+ ### Manual Configuration
488
+
489
+ While heyvm is designed to work without manual configuration, you can directly edit `~/.heyvm/config.yaml` if needed. The file is automatically created when you add your first VM.
490
+
491
+ **Note**: When using password authentication, passwords are stored in the OS keychain, not in the YAML file.
492
+
493
+ ## Troubleshooting
494
+
495
+ ### Connection Issues
496
+
497
+ **Problem**: Cannot connect to VM
498
+ **Solutions**:
499
+ - Verify SSH access works manually: `ssh user@host`
500
+ - Check firewall rules allow SSH (port 22 or custom port)
501
+ - Ensure SSH key has correct permissions: `chmod 600 ~/.ssh/your_key`
502
+ - Check if the host key has changed (remove from `~/.heyvm/known_hosts`)
503
+
504
+ **Problem**: "Permission denied" error
505
+ **Solutions**:
506
+ - Verify username is correct
507
+ - For SSH keys: Ensure the key is authorized on the remote VM (`~/.ssh/authorized_keys`)
508
+ - For passwords: Re-enter the password (it may have changed)
509
+
510
+ ### File Transfer Issues
511
+
512
+ **Problem**: File transfer fails
513
+ **Solutions**:
514
+ - Ensure you have write permissions on the target directory
515
+ - Check available disk space on remote VM
516
+ - Verify SFTP is enabled on the SSH server
517
+
518
+ ### Application Issues
519
+
520
+ **Problem**: UI not responding
521
+ **Solutions**:
522
+ - Check logs: `~/.heyvm/logs/heyvm-core.log`
523
+ - Restart the application: `q` to quit, then restart
524
+ - Clear build artifacts and rebuild: `make clean && make build-all`
525
+
526
+ **Problem**: Backend process crashes
527
+ **Solutions**:
528
+ - Review logs in `~/.heyvm/logs/heyvm-core.log`
529
+ - Ensure Go backend was built correctly: `make build-core`
530
+ - Check for port conflicts or permission issues
531
+
532
+ ### Getting Help
533
+
534
+ If you encounter issues:
535
+
536
+ 1. Check the logs: `cat ~/.heyvm/logs/heyvm-core.log`
537
+ 2. Review existing [GitHub Issues](https://github.com/adishm/heyvm/issues)
538
+ 3. Open a new issue with:
539
+ - heyvm version
540
+ - Operating system
541
+ - Error messages
542
+ - Steps to reproduce
543
+
544
+ ## Roadmap
545
+
546
+ ### Current Features (Phase 1)
547
+ - ✅ VM management and storage
548
+ - ✅ SSH key and password authentication
549
+ - ✅ Split-pane TUI interface
550
+ - ✅ Full terminal emulator (xterm.js with ANSI/VT100 support)
551
+ - ✅ Terminal scrollback (1000 lines)
552
+ - ✅ Interactive programs support (vim, nano, htop, sudo)
553
+ - ✅ File browser with dual-pane view
554
+ - ✅ Secure credential storage
555
+
556
+ ### Planned Features (Future Phases)
557
+ - 🔄 Cloud provider integration (AWS, Azure, GCP)
558
+ - 🔄 Bastion/jump host support
559
+ - 🔄 VM lifecycle management (start/stop/restart)
560
+ - 🔄 Port forwarding
561
+ - 🔄 Tunnel management
562
+ - 🔄 Session recording and playback
563
+ - 🔄 Multi-VM command execution
564
+ - 🔄 SSH config import
565
+
566
+ ## Contributing
567
+
568
+ Contributions are welcome! Here's how you can help:
569
+
570
+ ### Reporting Bugs
571
+ 1. Check if the issue already exists
572
+ 2. Create a detailed bug report with:
573
+ - Steps to reproduce
574
+ - Expected vs actual behavior
575
+ - Environment details (OS, versions)
576
+ - Relevant logs
577
+
578
+ ### Submitting Changes
579
+ 1. Fork the repository
580
+ 2. Create a feature branch: `git checkout -b feature/amazing-feature`
581
+ 3. Make your changes
582
+ 4. Write/update tests if applicable
583
+ 5. Ensure code builds: `make build-all`
584
+ 6. Run tests: `make test`
585
+ 7. Commit with clear messages: `git commit -m 'Add amazing feature'`
586
+ 8. Push to your fork: `git push origin feature/amazing-feature`
587
+ 9. Open a Pull Request
588
+
589
+ ### Development Guidelines
590
+ - Follow existing code style
591
+ - Add comments for complex logic
592
+ - Update documentation for user-facing changes
593
+ - Keep commits focused and atomic
594
+ - Write meaningful commit messages
595
+
596
+ ## License
597
+
598
+ MIT License - see [LICENSE](LICENSE) file for details.
599
+
600
+ ## Inspiration & Credits
601
+
602
+ heyvm draws inspiration from excellent tools in the terminal UI ecosystem:
603
+
604
+ - **[lazygit](https://github.com/jesseduffield/lazygit)** - TUI UX patterns and keyboard navigation
605
+ - **[k9s](https://github.com/derailed/k9s)** - Architecture design and command abstraction
606
+ - **[Ink](https://github.com/vadimdemedes/ink)** - React-based terminal UI framework
607
+
608
+ Built with:
609
+ - [Ink](https://github.com/vadimdemedes/ink) - Terminal UI framework
610
+ - [Go SSH](https://pkg.go.dev/golang.org/x/crypto/ssh) - SSH client implementation
611
+ - [99designs/keyring](https://github.com/99designs/keyring) - Secure credential storage
612
+
613
+ ## Support & Community
614
+
615
+ - **Issues**: [GitHub Issues](https://github.com/adishm/heyvm/issues)
616
+ - **Discussions**: [GitHub Discussions](https://github.com/adishm/heyvm/discussions)
617
+ - **Documentation**: [docs/](docs/)
618
+
619
+ ---
620
+
621
+ Made with ❤️ for developers who manage VMs
Binary file
package/bin/heyvm ADDED
Binary file
package/bin/heyvm-core ADDED
Binary file