Skip to content

Scaffold Electron app and add single-device SSH connect (Phases 0–1) - #1

Merged
RileyBeenders merged 4 commits into
mainfrom
phase-0-scaffold
Oct 18, 2026
Merged

RileyBeenders merged 4 commits into
mainfrom
phase-0-scaffold

Conversation

@RileyBeenders

Copy link
Copy Markdown
Owner

What

The first two phases of the project plan:

Phase 0: scaffold

  • Electron + React + TypeScript app, built with electron-vite; Vitest for tests; electron-builder for a Windows installer and portable exe
  • Secure window defaults: context isolation, sandbox, no Node in the renderer, CSP, and navigation and new windows blocked
  • .claude/launch.json with a single dev preview config (the old file came from an unrelated project and held plaintext passwords; it was never committed)
  • CLAUDE.md and the project plan

Phase 1: single-device SSH connect

  • Transport interface plus SshTransport (ssh2), so telnet, serial and SFTP can be added later without touching the UI
  • Auth: password, keyboard-interactive (common on network gear), and private keys, including encrypted keys with a passphrase prompt
  • Host keys use trust-on-first-use. Unknown and changed keys both show a native main-process dialog that the renderer can't answer, and trusted keys are saved in known_hosts.json.
  • Device list with add/edit/delete, a password prompt, and an xterm.js terminal that fits its pane and forwards resizes to the device
  • npm run dev:ssh: a local SSH server with a fake shell for manual testing (no Docker or sshd needed)

Why

This sets up the base that the later phases build on: multi-device grid and paging, mirrored keystrokes, focus mode.

For reviewers

  • Secrets: passwords and passphrases go straight through to the connection. They are never written to disk or kept in UI state, and devices.json stores only host, port, username and the key's file path.
  • IPC: src/main/ipc.ts validates every argument and rejects messages from any sender other than the app window.
  • Flaky-test fix: ssh2's generateKeyPairSync('ed25519') produces a malformed key about 1 time in 200; OpenSSH's ssh-keygen rejects these keys too. The test helper and the dev server retry key generation. Keys made with ssh-keygen are unaffected.
  • Dependencies: they are on new majors (Electron 44, Vite 8, TypeScript 7). npm install reports 8 moderate-severity advisories in dev dependencies; I haven't looked into them yet.

Testing

  • npm run typecheck is clean.
  • npm test: 34 tests, including the session manager against an in-process ssh2 server (password, keyboard-interactive, unencrypted and encrypted keys, wrong secrets, unknown/changed/rejected host keys, refused connections, resize). 30 consecutive runs passed after the key-generation fix.
  • End to end in the built Electron app against npm run dev:ssh, driven over the DevTools protocol: form validation, save, wrong password re-prompt, connect, typed commands, terminal resize (server saw 43 → 17 rows), and disconnect.
  • Not tested: the host-key dialogs themselves (the end-to-end run used a pre-trusted key; the decision logic is covered by unit tests), a real hardware device, and npm run dist.

🤖 Generated with Claude Code

- Electron + React + TypeScript app built with electron-vite
- Secure window: context isolation, sandbox, no Node in renderer, CSP
- Preload bridge exposed as window.bulkssh (app version over IPC)
- Placeholder layout: device list, grid area, broadcast bar
- Shared paging helpers (default 6 devices per page) with Vitest tests
- electron-builder config for Windows NSIS installer and portable exe
- .gitignore keeps device lists, settings and SSH keys out of git
- Project plan in .projectPlan/PLAN.md, CLAUDE.md, project skills
- .claude/launch.json: single "dev" config running npm run dev on port 5173
- Pin the electron-vite renderer dev server to 5173 with strictPort
- Make window.bulkssh optional so the renderer loads in a plain browser
- Document the preview setup in CLAUDE.md
- Transport interface with an ssh2-based SshTransport (password,
  keyboard-interactive and private key auth, encrypted key passphrases)
- Session manager: one session per device, readable connection errors,
  re-prompts on wrong password or passphrase
- Host key trust-on-first-use: native dialog for unknown and changed keys,
  trusted keys stored in known_hosts.json
- Device store (devices.json in userData) with shared validation; secrets
  are never written to disk
- IPC handlers validate every argument and reject unknown senders
- Renderer: device list, add/edit form, password prompt, xterm.js terminal
  with fit-to-size and resize forwarding
- npm run dev:ssh: local SSH server with a fake shell for manual testing
- Tests: device validation, stores, and session manager against an
  in-process ssh2 server (34 tests)
- Update CLAUDE.md and the project plan
Runs npm ci --ignore-scripts, typecheck and Vitest on windows-latest (Node 24) for pull requests and pushes to main.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant