Skip to content

Node-based terminal manager for AI coding agents — tmux-backed terminals and parallel agent sessions as draggable nodes on an infinite pan/zoom canvas. macOS, Linux, and a browser Server Edition.

feat(ssh): Settings — saved SSH servers CRUD

enes3c235dcd5cbd
diff --git a/src/renderer/components/settings/SettingsIcons.tsx b/src/renderer/components/settings/SettingsIcons.tsx
index ec717abd1..0aad14191 100644
--- a/src/renderer/components/settings/SettingsIcons.tsx
+++ b/src/renderer/components/settings/SettingsIcons.tsx
@@ -62,6 +62,12 @@ const PATHS: Record<SettingsSectionId, React.JSX.Element> = {
<path d="M2.5 8h11M8 2.5c1.9 1.7 1.9 9.3 0 11M8 2.5c-1.9 1.7-1.9 9.3 0 11" />
</>
),
+ ssh: (
+ <>
+ <rect x="2" y="3" width="12" height="10" rx="2" />
+ <path d="M4.6 6.2 6.4 8l-1.8 1.8M8 10h3" />
+ </>
+ ),
updates: <path d="M8 2.6v7M5 6.6 8 9.6l3-3M3.6 12.6h8.8" />,
privacy: <path d="M8 2.4 12.4 4.2V8c0 3-2 4.8-4.4 5.6C5.6 12.8 3.6 11 3.6 8V4.2Z" />
}
diff --git a/src/renderer/components/settings/SettingsPage.tsx b/src/renderer/components/settings/SettingsPage.tsx
index 0702e7703..92409279e 100644
--- a/src/renderer/components/settings/SettingsPage.tsx
+++ b/src/renderer/components/settings/SettingsPage.tsx
@@ -15,6 +15,7 @@ import { CommitSection } from './sections/CommitSection'
import { TmuxSection } from './sections/TmuxSection'
import { LicenseSection } from './sections/LicenseSection'
import { RemoteSection } from './sections/RemoteSection'
+import { SshSection } from './sections/SshSection'
import { UpdatesSection } from './sections/UpdatesSection'
import { PrivacySection } from './sections/PrivacySection'
@@ -58,6 +59,7 @@ export function SettingsPage({ onClose }: { onClose: () => void }): React.JSX.El
<TmuxSection isActive={active === 'tmux'} />
<LicenseSection isActive={active === 'license'} />
<RemoteSection isActive={active === 'remote'} onClose={onClose} />
+ <SshSection isActive={active === 'ssh'} />
<UpdatesSection isActive={active === 'updates'} />
<PrivacySection isActive={active === 'privacy'} />
</div>
diff --git a/src/renderer/components/settings/nav.ts b/src/renderer/components/settings/nav.ts
index 84234ad46..3b4a1081e 100644
--- a/src/renderer/components/settings/nav.ts
+++ b/src/renderer/components/settings/nav.ts
@@ -10,6 +10,7 @@ export type SettingsSectionId =
| 'tmux'
| 'license'
| 'remote'
+ | 'ssh'
| 'updates'
| 'privacy'
@@ -50,7 +51,8 @@ export const SETTINGS_GROUPS: SettingsGroup[] = [
title: 'Account',
sections: [
{ id: 'license', title: 'License' },
- { id: 'remote', title: 'Remote access' }
+ { id: 'remote', title: 'Remote access' },
+ { id: 'ssh', title: 'Remote (SSH)' }
]
},
{
diff --git a/src/renderer/components/settings/sections/SshSection.tsx b/src/renderer/components/settings/sections/SshSection.tsx
new file mode 100644
index 000000000..2be394f93
--- /dev/null
+++ b/src/renderer/components/settings/sections/SshSection.tsx
@@ -0,0 +1,182 @@
+import { useEffect, useState } from 'react'
+import { useSshServers } from '../../../state/sshServers'
+import type { SshServer } from '@shared/ssh'
+import { SettingsSection } from '../SettingsSection'
+import { SearchableRow } from '../SearchableRow'
+import { FieldRow } from '../FieldRow'
+import { Button } from '@renderer/ui/Button'
+import { Input } from '@renderer/ui/Input'
+
+const ROWS = {
+ servers: {
+ title: 'Saved SSH servers',
+ keywords: ['ssh', 'remote', 'server', 'host', 'connect', 'identity', 'key']
+ }
+}
+const ENTRIES = Object.values(ROWS)
+
+export function SshSection({ isActive }: { isActive: boolean }): React.JSX.Element {
+ const sshServers = useSshServers((s) => s.servers)
+ const [sshDraft, setSshDraft] = useState<SshServer | null>(null)
+
+ useEffect(() => {
+ void useSshServers.getState().hydrate()
+ }, [])
+
+ const saveDisabled =
+ !sshDraft ||
+ !sshDraft.label.trim() ||
+ !sshDraft.host.trim() ||
+ !sshDraft.user.trim()
+
+ return (
+ <SettingsSection
+ id="ssh"
+ title="Remote (SSH)"
+ description="Saved SSH servers appear under “New remote”. Opening a remote terminal is a Pro feature."
+ isActive={isActive}
+ searchEntries={ENTRIES}
+ >
+ <SearchableRow {...ROWS.servers}>
+ <div className="space-y-4">
+ {sshServers.map((server) => (
+ <div
+ key={server.id}
+ className="flex items-center justify-between gap-4 rounded-md border border-border p-3"
+ >
+ <span className="min-w-0 truncate text-sm text-text">
+ {server.label} — {server.user}@{server.host}
+ {server.port && server.port !== 22 ? `:${server.port}` : ''}
+ </span>
+ <div className="flex shrink-0 gap-2">
+ <Button onClick={() => setSshDraft(server)}>Edit</Button>
+ <Button
+ variant="ghost"
+ onClick={() => void useSshServers.getState().remove(server.id)}
+ >
+ Delete
+ </Button>
+ </div>
+ </div>
+ ))}
+
+ {sshDraft ? (
+ <div className="space-y-2 rounded-md border border-border p-3">
+ <FieldRow
+ label="Label"
+ control={
+ <Input
+ className="w-56"
+ placeholder="e.g. Prod box"
+ value={sshDraft.label}
+ onChange={(e) => setSshDraft({ ...sshDraft, label: e.target.value })}
+ />
+ }
+ />
+ <FieldRow
+ label="Host"
+ control={
+ <Input
+ className="w-56"
+ placeholder="e.g. example.com"
+ value={sshDraft.host}
+ onChange={(e) => setSshDraft({ ...sshDraft, host: e.target.value })}
+ />
+ }
+ />
+ <FieldRow
+ label="User"
+ control={
+ <Input
+ className="w-56"
+ placeholder="e.g. root"
+ value={sshDraft.user}
+ onChange={(e) => setSshDraft({ ...sshDraft, user: e.target.value })}
+ />
+ }
+ />
+ <FieldRow
+ label="Port"
+ control={
+ <Input
+ className="w-24"
+ type="number"
+ value={sshDraft.port ?? 22}
+ onChange={(e) =>
+ setSshDraft({ ...sshDraft, port: Number(e.target.value) || 22 })
+ }
+ />
+ }
+ />
+ <FieldRow
+ label="Identity file"
+ description="Optional private key passed with -i."
+ control={
+ <div className="flex gap-2">
+ <Input
+ className="w-56"
+ placeholder="~/.ssh/id_ed25519"
+ value={sshDraft.identityFile ?? ''}
+ onChange={(e) =>
+ setSshDraft({ ...sshDraft, identityFile: e.target.value })
+ }
+ />
+ <Button
+ onClick={async () => {
+ const file = await window.nodeTerminal.dialog.selectFile()
+ if (file) setSshDraft({ ...sshDraft, identityFile: file })
+ }}
+ >
+ Choose…
+ </Button>
+ </div>
+ }
+ />
+ <FieldRow
+ label="Extra ssh args"
+ description="Optional advanced flags, e.g. -o StrictHostKeyChecking=no."
+ control={
+ <Input
+ className="w-56"
+ placeholder="(optional)"
+ value={sshDraft.extraArgs ?? ''}
+ onChange={(e) => setSshDraft({ ...sshDraft, extraArgs: e.target.value })}
+ />
+ }
+ />
+ <div className="flex justify-end gap-2 pt-1">
+ <Button variant="ghost" onClick={() => setSshDraft(null)}>
+ Cancel
+ </Button>
+ <Button
+ variant="primary"
+ disabled={saveDisabled}
+ onClick={async () => {
+ await useSshServers.getState().save(sshDraft)
+ setSshDraft(null)
+ }}
+ >
+ Save
+ </Button>
+ </div>
+ </div>
+ ) : (
+ <Button
+ onClick={() =>
+ setSshDraft({
+ id: crypto.randomUUID(),
+ label: '',
+ host: '',
+ user: '',
+ port: 22
+ })
+ }
+ >
+ Add server
+ </Button>
+ )}
+ </div>
+ </SearchableRow>
+ </SettingsSection>
+ )
+}