# nova-terminal **Repository Path**: nova-native/nova-terminal ## Basic Information - **Project Name**: nova-terminal - **Description**: No description available - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-10-26 - **Last Updated**: 2026-10-26 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # NovaTerminal for macOS A native SSH + SFTP client for **macOS 27+**, built around the original Quay prototype interface in the sibling `quay/` folder. This is a **working MVP**: it connects to real SSH servers over SwiftNIO, browses real SFTP directories in a native dual-pane window, transfers files, verifies host keys, and runs an interactive terminal rendered by SwiftTerm's Metal glyph pipeline. **Author:** jiay · **License:** MIT > **Status:** functional, locally built and tested MVP — not a store-ready 1.0. The remaining product work is listed under [Known limitations / roadmap](#known-limitations--roadmap). ![NovaTerminal — SFTP workspace](Screenshots/01-files-dark.png) --- ## Highlights - **Native macOS 27 app** — SwiftUI shell with AppKit window/control integration, traffic lights, full-size content view, draggable title bar, native menus and Settings window. - **Real SSH / SFTP** — a vendored [Citadel](https://github.com/orlandos-nl/Citadel) on top of a patched SwiftNIO SSH; direct `NIOSSH` integration for interactive host-key verification. No shelling out to `ssh` or `sftp`. - **SMS / OTP two-factor login** — RFC 4256 keyboard-interactive support, including public-key or password primary authentication followed by a server-driven SMS/OTP challenge. Codes are sent only to the server and never stored. - **Swift 6 language mode** — first-party targets compile with Swift 6 strict concurrency. - **Bilingual UI** — English and Simplified Chinese string catalogs, with a per-app language picker in Settings. Dates, counts, alerts and common SSH/SFTP errors are localized; the default follows the macOS preferred language. - **Custom typography** — choose an interface font and 10–15 pt base size, plus a separate fixed-pitch terminal font at 9–24 pt. Previews update live, the workspace reflows immediately, and open terminal sessions recalculate their PTY grid without reconnecting. - **Terminal history controls** — choose a 1,000–100,000 line scrollback limit in Settings → Terminal. The setting persists and updates live terminal sessions in place. - **Custom connection groups** — create a group directly from the New Connection group menu; custom groups persist with their saved connections and appear with their own colors in the sidebar, file header, welcome screen and command palette. - **Resizable file panes** — drag the divider between local and remote files to change the split; the ratio persists across launches. Double-click the divider to reset it to 42%. - **Permission editor** — right-click a remote file or folder and choose **Change Permissions…** to edit owner/group/other read, write and execute bits, optionally recursively for directories. - **Metal terminal** — terminal uses [SwiftTerm](https://github.com/migueldeicaza/SwiftTerm) 1.99.1's Metal renderer (`setUseMetal(true)`); the UI shows a live `METAL 3` badge and renderer state. A CoreGraphics path is kept as a fallback. - **Security by default** — first connect requires an explicit SHA-256 fingerprint confirmation, accepted keys are written to `~/.ssh/known_hosts`, changed keys fail closed, and passwords/passphrases live in the macOS Keychain. - **Real file workflows** — remote listing, breadcrumbs, upload, download, new blank file, new folder, rename, delete, hidden files, multi-select and Finder drag-and-drop uploads. Right-clicking empty space in the remote pane offers the selected item's actions plus file/folder creation and refresh. - **Explicit local folder access** — first launch does not scan the home directory. A folder chooser avoids macOS Desktop/Documents/Downloads prompts until the user picks a folder; the selection is remembered for later launches. - **Real terminal** — Citadel PTY channel bridged into SwiftTerm; ANSI output, resize events, Ctrl/⌘ shortcuts, and a snippets palette. - **Command palette** — `⌘K` over saved connections, recent paths and session actions. - **Titlebar search** — a magnifier button in the titlebar opens the command palette directly; the permanent search field has been removed. - **Quit / disconnect confirmation** — quitting the app and closing or disconnecting an active session ask for confirmation first; reconnects and saved-profile deletion use their existing flows without double prompts. - **App bundle pipeline** — `Scripts/build-app.sh` produces a self-contained `dist/NovaTerminal.app` with icon and Info.plist. | | | |---|---| | ![Terminal](Screenshots/06-terminal.png) | ![Command palette](Screenshots/03-command-palette.png) | | ![New connection](Screenshots/04-new-connection.png) | ![Host key verification](Screenshots/05-host-key.png) | | ![Light appearance](Screenshots/02-files-light.png) | ![Simplified Chinese](Screenshots/07-files-chinese.png) | | ![Language settings](Screenshots/08-language-settings.png) | ![Font settings](Screenshots/09-font-settings.png) | | ![SMS/OTP prompt](Screenshots/10-mfa-prompt.png) | ![MFA connected](Screenshots/11-mfa-connected.png) | | ![Custom connection groups](Screenshots/12-custom-groups.png) | ![Resizable file panes](Screenshots/13-resizable-panes.png) | | ![Permission editor](Screenshots/14-permissions.png) | ![Local folder chooser](Screenshots/15-local-folder.png) | --- ## Requirements - macOS **27.0** or newer - Xcode **27.1** / Swift **6.4** (the package uses `.macOS(.v27)` and Swift tools 6.4) - Network access on first build so SwiftPM can fetch SwiftNIO, Swift Crypto, BigInt and Swift Log Citadel and SwiftNIO SSH are vendored in `Vendor/Citadel` and `Vendor/swift-nio-ssh`; the latter carries NovaTerminal's RFC 4256 client keyboard-interactive extension. SwiftTerm 1.99.1 is vendored in `Vendor/SwiftTerm` with a trimmed manifest. Licenses are included alongside each vendor. ## Build & run ```bash cd quay-native # Unit + optional live SSH tests swift test # Build an app bundle ./Scripts/build-app.sh release # Run it open dist/NovaTerminal.app ``` For development, `./Scripts/build-app.sh debug` is faster. The app is ad-hoc signed for local use. For distribution, sign with a Developer ID certificate, notarize, and staple the ticket; see “Distribution” below. The display name, executable and application bundle are **NovaTerminal**. The bundle identifier intentionally remains `com.zaoangod.quay` so macOS keeps treating this as an upgrade of the existing app (and retains its preferences and permissions). Legacy `~/Library/Application Support/Quay` profiles are moved to `NovaTerminal` on first launch, and legacy Keychain items are read as a fallback before the new service name is used. The first launch shows an empty workspace. Create a connection with `⌘N` or the **New Connection** button. Supported authentication: - **Password** — stored in the macOS Keychain. - **SSH private key** — ed25519 or RSA OpenSSH keys, with optional passphrase stored in the Keychain. - **SMS / OTP MFA** — choose **MFA** for keyboard-interactive-only servers, or enable **Use SMS/OTP (keyboard-interactive)** on a password/key profile for a primary login followed by a second factor. - **SSH agent** — shown in the design, **not implemented yet**; the connection editor deliberately omits it. Host keys are checked against `~/.ssh/known_hosts`. On first contact NovaTerminal shows the SHA-256 fingerprint and asks for explicit trust. Hashed known-hosts entries and non-default ports are supported. Changed or revoked keys are rejected. ## Screenshots Screenshots in [`Screenshots/`](Screenshots/) were taken from the running app connected to a local OpenSSH server. They are produced by NovaTerminal's built-in diagnostic capture (environment variables below), because the session has no Screen Recording permission. GPU-drawn terminal content is composited from SwiftTerm's PDF output for the terminal screenshot; the surrounding chrome is the live window capture. The set includes English screenshots plus the same workspace in Simplified Chinese (`07-files-chinese.png`), the language picker in Settings (`08-language-settings.png`), the typography controls (`09-font-settings.png`), a live SMS/OTP challenge after public-key authentication (`10-mfa-prompt.png`), the authenticated SFTP session (`11-mfa-connected.png`), user-created groups (`12-custom-groups.png`), a widened local pane (`13-resizable-panes.png`), the permission editor (`14-permissions.png`), and the first-launch local folder chooser (`15-local-folder.png`). The language capture shows the restart-to-apply state after choosing English while the current UI is still Chinese. The app was verified in both languages, including the command palette, connection sheet, host-key prompt, snippets, settings and welcome screen. ## Localization NovaTerminal is localized in **English** and **Simplified Chinese (`zh-Hans`)**. On launch it follows the macOS preferred language; **Settings → Language** can override the language for NovaTerminal only: - **Follow System** — default; uses the macOS preferred language. - **English** / **简体中文** — explicit override. Changing the language requires reopening NovaTerminal; the Settings pane shows a **Restart NovaTerminal** button when a restart is needed. This is deliberate: the app uses per-app `AppleLanguages` so AppKit controls, SwiftUI text and the menus all switch together rather than partially updating. Localization is split across these pieces: | Layer | Location | | --- | --- | | English source keys | `Support/en.lproj/Localizable.strings` | | Simplified Chinese translations | `Support/zh-Hans.lproj/Localizable.strings` | | App localization facade, language model | `Sources/QuayShared/Localization/Localization.swift` | | Core/error localization and locale-aware date formatting | `Sources/QuayKit/Utilities/QuayLocalization.swift` | `Scripts/build-app.sh` copies every `Support/*.lproj` folder into `NovaTerminal.app/Contents/Resources`. SwiftUI literal labels localize automatically; dynamic labels, alerts, panels, format strings and core errors go through `L10n` / `QuayLocalization`. Placeholders are kept identical between languages (`%@`, `%lld`, `%1$lld`). Validate the catalogs at any time with: ```bash ./Scripts/validate-localization.sh ``` The script runs `plutil`, checks placeholder parity, verifies that every `L10n`/`QuayLocalization` key exists in the Chinese catalog, and confirms the assembled app contains both `.lproj` directories. To add a language: 1. Create `Support/.lproj/Localizable.strings` using the English keys from the existing catalog. 2. Add a case to `AppLanguage` and its `appleLanguageCode` / `displayName`. 3. Add the language code to `CFBundleLocalizations` in `Support/Info.plist`. 4. Rebuild and select it under Settings → Language. Technical connection errors from the remote server or Citadel may still include untranslated detail text; the surrounding title and context are localized. ## File panes The local and remote file lists share a draggable divider: - Drag the divider left or right; both panes keep a minimum width and the workspace uses the remaining space. - The split is stored in `UserDefaults` (`quay.files.splitFraction`) and restored on the next launch. - Double-click the divider to return to the default 42% split. - A resize cursor appears over the divider, and an accessibility adjust action changes the split in 5% steps. ## Remote context menu Right-clicking empty space in the **remote** file pane opens a native context menu: - If one item is selected, the menu starts with the same actions as right-clicking that item (download/open folder, rename, copy path, delete). - With multiple items selected, it offers download-selected and delete. - **Refresh** is the first menu item, followed by the selected item's actions and then **New File…** and **New Folder…**. - Right-clicking a file or folder row also offers **Refresh** and **Change Permissions…**. - With nothing selected, the menu shows **Refresh**, **New File…** and **New Folder…**. **New File…** creates a zero-byte file in the current remote directory without overwriting an existing file; duplicate names are rejected. The file is selected after the directory refreshes. The same action is available from the Session menu (`⇧⌘F`), the toolbar’s “…” menu and the command palette. ## Change permissions Right-click any remote file or folder and choose **Change Permissions…**. The compact editor shows separate owner, group and other columns with read, write and execute toggles, matching the current POSIX mode. It also displays the item type, size and modification time, the full path, and a live comparison of the current and proposed permission values in both octal (`644`) and symbolic (`-rw-r--r--`) form. For directories, **Include subdirectories** applies the same mode recursively. The operation uses SFTP `SETSTAT` and preserves setuid/setgid/sticky bits. When recursing, children are updated before their parent directory so removing search bits cannot make descendants unreachable; symbolic links are skipped. A failure is reported inline in the dialog without closing it. ## Connection groups NovaTerminal ships with **Production**, **Staging** and **Personal**. A group can also be created while adding or editing a connection: 1. Open **New Connection** (or edit an existing connection). 2. Click the **Group** field. 3. Choose **New group…**, enter a name, and press **Create**. 4. The new **Group** section exposes **Indicator color** swatches so the group color can be changed at any time. The new group is stored as part of the saved connection and appears in the sidebar with its own stable color. Groups are matched case-insensitively; creating a name that already exists selects the existing group. The same group list is used by the file header, the welcome screen, and the command palette. Deleting the last connection in a custom group removes the empty group from the sidebar. ## SMS / OTP two-factor authentication SMS/TOTP gateways commonly use the SSH **keyboard-interactive** method (RFC 4256) after the normal login. NovaTerminal now implements this flow natively: 1. **Primary authentication + MFA** — choose Password or SSH Key and fill in the normal credentials. NovaTerminal tries the primary method and automatically falls back to keyboard-interactive when the server offers it, so the legacy **Use SMS/OTP** checkbox is optional. If the server sends a challenge, NovaTerminal shows the MFA dialog. 2. **Keyboard-interactive only** — choose the **MFA** authentication mode. NovaTerminal starts with keyboard-interactive and renders every server prompt (password, SMS code, TOTP, etc.). An optional password can be saved for servers that verify the password as a separate first method before requesting the OTP. The dialog is generated from the server's prompts and supports multiple prompts, multiple challenge rounds, and keyboard-interactive-only servers. No-echo prompts use secure fields. Responses are sent only to the SSH server and are never written to disk or Keychain. The host-key verification flow is unchanged and still happens before authentication. Implementation details: - `Vendor/swift-nio-ssh` now implements the client side of RFC 4256: the `keyboard-interactive` method, INFO_REQUEST/INFO_RESPONSE messages, server info-request routing and the shared message-id 60 disambiguation. This is an additive patch to the Apache-2.0 fork already used by Citadel. - `Vendor/Citadel` adds a small authenticated-connection entry point that accepts a raw NIO SSH user-auth delegate while preserving Citadel's SFTP and PTY support. - `Sources/QuayKit/Networking/SSH/MFA.swift` contains the NIO auth delegate and the async `MFAHandler` bridge; `Sources/QuayUI/Views/Auth/MFAPromptView.swift` renders the challenge. Verified locally against a Paramiko RFC 4256 test server: - **Public key → SMS second factor**: public-key authentication succeeded, the server sent a single `Please Input Mfa Code (OTP,SMS):` challenge, the code was accepted and the SFTP session opened. See screenshots `10` and `11`. - **Password → SMS second factor**: password authentication partially succeeded and the server then requested the OTP; the SFTP session opened. - **Keyboard-interactive only**: the MFA-only mode accepted the prompt and reached SFTP. - **Automatic fallback**: a Password profile with no MFA checkbox still fell back to keyboard-interactive and reached SFTP. - **Multi-round challenge**: separate password and OTP rounds both completed and reached SFTP. This verifies the SSH protocol path, not a particular carrier's SMS gateway. The server must expose keyboard-interactive; proprietary post-login MFA menus and OTP-by-password-concatenation are not handled by this flow. ## Typography **Settings → Interface** and **Settings → Terminal** control the two typography systems independently. | Control | Options | Default | Scope | | --- | --- | --- | --- | | Interface font | System (SF Pro) or any installed family | System | Workspace chrome and text | | Interface text size | 10–15 pt in 0.5 pt steps | 12 pt | Scales every `.qfont` / `.qmono` size relative to 12 pt | | Terminal font | System Monospaced or any installed fixed-pitch family | System Monospaced | SwiftTerm shell content | | Terminal font size | 9–24 pt in 1 pt steps | 12 pt | SwiftTerm cell size; PTY grid follows | Both sections include a live preview and a **Reset** button. Changes apply immediately without relaunching. When the terminal font changes, `TerminalView.font` recalculates cell dimensions and NovaTerminal sends the new column/row count over the PTY; existing scrollback is preserved. The selected values are stored in `UserDefaults` (`quay.font.*`), so they survive restarts. Implementation: - `Sources/QuayShared/Typography/FontSettings.swift` — persisted `@Observable` font choices, installed-font catalogs, terminal font resolver, and the `.qfont` / `.qmono` SwiftUI wrappers that observe the singleton directly. - `Sources/QuayShared/Terminal/TerminalSettings.swift` — persisted terminal scrollback limit; `TerminalHostView` applies it with SwiftTerm's `changeScrollback`. - `Sources/QuayBusiness/Terminal/TerminalModel.swift` — terminal/session lifecycle and PTY bridge; `Sources/QuayUI/Views/Terminal/TerminalHostView.swift` applies terminal font changes in `updateNSView`. - `Sources/QuayUI/Views/Settings/SettingsView.swift` — interface/terminal controls, previews, and reset buttons. Native macOS controls themselves (menu bar, Settings form rows, system dialogs) continue to use the system font; the customizable interface family applies to NovaTerminal's workspace text. Terminal families are restricted to fixed-pitch fonts so column alignment remains correct. ## Keyboard shortcuts | Shortcut | Action | | --- | --- | | `⌘K` | Command palette | | `⌘N` | New connection | | `⌘B` | Toggle sidebar | | `⌘1` / `⌘2` | Files / Terminal | | `⌘R` | Refresh remote directory | | `⇧⌘U` | Upload files | | `⇧⌘D` | Download selected files | | `⇧⌘N` | New remote folder | | `⇧⌘F` | New remote blank file | | `⌘J` | Terminal snippets | | `⌥⌘A` | Toggle dark / light appearance | | `⌘,` | Settings | Local file list context menus also expose Open, Reveal in Finder, Copy Path, and Upload to the active session. Remote file rows expose Download, Rename, Copy Remote Path, Delete and folder navigation. ## Architecture The app is a layered SwiftPM package. The reference Xcode-app folder layout is adapted into the existing module boundaries, with feature folders inside each target. This keeps the business/UI/design-system dependencies enforceable while making the source tree read like a conventional macOS app. ``` Sources/ ├── NovaTerminal/ # executable shell │ ├── NovaTerminalApp.swift # Window, Settings, menu-scene composition │ └── App/Commands/TerminalCommands.swift ├── QuayUI/ # SwiftUI feature views │ ├── Views/ │ │ ├── Root/RootView.swift │ │ ├── Workspace/{Titlebar,Sidebar,TabBar,Toolbar}View.swift │ │ ├── Files/{FilesWorkspace,TransferTray}View.swift │ │ ├── Terminal/{TerminalWorkspace,TerminalHost}View.swift │ │ ├── Hosts/NewConnectionView.swift │ │ ├── Auth/{HostKeyPrompt,MFA}View.swift │ │ ├── Settings/SettingsView.swift │ │ ├── Commands/CommandPaletteView.swift │ │ └── Permissions/PermissionsEditorView.swift │ └── Utilities/{DebugSupport,SessionModel+Presentation}.swift ├── QuayBusiness/ # observable app/business layer │ ├── App/AppState.swift │ ├── Models/ │ │ ├── WorkspaceModels.swift # appearance/mode │ │ ├── LocalBrowserModel.swift │ │ ├── SessionModel.swift │ │ ├── TransferItem.swift │ │ └── AppDialogs.swift │ └── Terminal/TerminalModel.swift # PTY lifecycle, no AppKit/SwiftUI view ├── QuayDesignSystem/ # shared visual language │ ├── Theme/Theme.swift # QColor, QMetrics, typography, buttons │ └── Components/Components.swift # brand mark, glyphs, tags, banners ├── QuayShared/ # cross-cutting foundations │ ├── Localization/Localization.swift │ ├── Typography/FontSettings.swift │ └── Models/SessionStatus.swift ├── QuayKit/ # core kit; no SwiftUI │ ├── Models/{ConnectionProfile,FileModels}.swift │ ├── Networking/SSH/{SSHSession,MFA}.swift │ ├── Services/ │ │ ├── HostKeys.swift │ │ ├── LocalFileService.swift │ │ ├── Persistence/ConnectionRepository.swift │ │ └── Security/SecretStore.swift │ └── Utilities/{FileFormatting,PathTool,QuayLocalization}.swift ├── Support/ # app resources + Info.plist + .lproj ├── Tests/QuayKitTests/ ├── Vendor/{Citadel,swift-nio-ssh,SwiftTerm} └── Scripts/{build-app,validate-localization}.sh ``` Dependency direction: ``` NovaTerminal (executable) ├── QuayUI ──┬── QuayBusiness ──> QuayKit · QuayShared · SwiftTerm │ ├── QuayDesignSystem ──> QuayKit · QuayShared │ └── QuayShared ├── QuayBusiness └── QuayDesignSystem ``` Cross-layer API is `package`-scoped, so the layers share implementation details without exporting a public SDK. `QuayKit` remains the only module with no SwiftUI/AppKit view code. The package exposes library products for each layer in `Package.swift`. ### Adaptations from the reference layout - `AppState` lives in `QuayBusiness/App` rather than the executable: `QuayUI` injects it through the SwiftUI environment, and UI targets cannot import an executable module. - Menu commands are extracted to `NovaTerminal/App/Commands/TerminalCommands.swift` and composed by `NovaTerminalApp`; this matches the reference's Commands folder. - The reference's single app target is split into SwiftPM libraries so the UI, business, design-system and SSH/SFTP kit cannot depend on each other in a cycle. - **Rendering:** there is no local `Rendering/` target because SwiftTerm owns the Metal renderer and glyph atlas. `TerminalHostView` only configures the NSView, Metal renderer, fonts and focus. - **Networking/Shell:** SSH and SFTP live in `QuayKit/Networking/SSH`; the PTY lifecycle lives in `QuayBusiness/Terminal/TerminalModel.swift`. There is no separate local-shell service yet. - **Managers / DependencyContainer:** session reuse and application state are coordinated by `AppState` and `SessionModel`; adding a DI container or separate session manager would be a behavioral refactor, not a file move. - **Keys:** SSH key selection is part of `NewConnectionView`, with secrets in `SecretStore`; there is no standalone Keys browser yet. - **Resources / entitlements:** `Info.plist`, the app icon and `.lproj` catalogs stay in `Support/`. The app is intentionally unsandboxed, so no entitlements file is shipped; Metal is provided by SwiftTerm. ### Concurrency and lifecycle - `AppState` is `@MainActor @Observable`; sessions are explicit `SessionModel` objects. - `SSHSession` is an actor that owns the Citadel `SSHClient`, its SFTP channel and the PTY writer. Citadel's non-Sendable handles are isolated behind documented `@unchecked Sendable` boxes at the networking boundary. - Each connection creates its own `MultiThreadedEventLoopGroup`; it is shut down when the session closes. - Host-key validation runs asynchronously while the SSH handshake waits. The UI presents the prompt and resolves a continuation; known keys succeed without UI. - Transfers update their `@MainActor` `TransferItem` from scoped progress closures; tasks are cancelled through `Task` handles. ## Verification performed - `swift test` — **18 tests passed, 1 opt-in live MFA test skipped** (16 unit/model/known-host/MFA-profile/custom-group tests + 2 live OpenSSH integration tests + 1 gated Paramiko RFC 4256 test) against a local OpenSSH `sshd` on port 2222. - Live test coverage: - SSH public-key connect and command execution. - SFTP home resolution, directory listing, file upload, download and byte-for-byte verification, deletion. - Interactive PTY shell with command output. - UI verified end-to-end against the same local server: real SSH connection, real SFTP listing and selection, host-key prompt, palette, light/dark appearance, and a live terminal with the Metal renderer enabled. - Localization verified live in **English** and **Simplified Chinese**: main workspace, command palette, connection sheet, host-key prompt, terminal chrome, snippets, welcome screen and Settings. Dates switch between `Today, 12:15 AM` and `今天 0:15`; counted strings and footer labels are localized. The language override path writes both the app preference and `AppleLanguages`; the Settings restart hint is shown in `08-language-settings.png`. - `./Scripts/validate-localization.sh` passes: 428 Chinese keys, matching format placeholders, all dynamic localization keys covered, and both catalogs present in the assembled app. - Typography verified live: interface changed from system 12 pt to Georgia 15 pt, terminal from system monospaced 12 pt to Courier New 18 pt while a shell was running. The terminal grid changed from 161×47 to 110×33, the PTY was resized, and existing output remained visible. The same sheet and palette were checked at the maximum interface size for clipping. - Custom groups verified with built-in and user-named profiles; the sidebar, welcome screen, file header and command palette resolve the same group name and color. Profile JSON round-trip and legacy profiles without a custom group were tested. - File-pane split verified at 25% and 68% local fractions, including the 320 pt minimum pane width and persisted `quay.files.splitFraction`. - Remote blank-file creation verified over SFTP: zero-byte file appears in the listing, duplicate creation is rejected, and the file is deleted in the integration test. - Permission changes verified over SFTP: a file is changed to `600`; a directory and its child are changed recursively to `700` and read back via `getAttributes`. - SMS/OTP MFA verified against a local Paramiko RFC 4256 server: - publickey → one OTP prompt → success → SFTP opened; - password partial success → OTP prompt → success → SFTP opened; - keyboard-interactive-only login → SFTP opened. - Release `.app` build verified with icon, Info.plist, and ad-hoc signature. - Verified with Xcode 27.1, Swift 6.4, macOS 27.0.1 on Apple M5 (Metal-capable), against OpenSSH running locally. The checked-in screenshots use the app's diagnostic capture environment because this machine does not grant Screen Recording access to the shell. The window chrome is a live capture; the Metal terminal area is composited from SwiftTerm's PDF output (the GPU drawable cannot be read back by `NSView.cacheDisplay`). To reproduce the live test: ```bash # one-time local test server setup (requires /usr/sbin/sshd; runs unprivileged on port 2222) # see the manual steps used for development; then: QUAY_TEST_SSH_KEY=/path/to/client_key \ QUAY_TEST_SSH_PORT=2222 \ QUAY_TEST_SSH_USER="$(whoami)" \ swift test ``` The test suite is skipped automatically when `QUAY_TEST_SSH_KEY` is absent. ## Configuration and QA environment variables The app reads these optional environment variables (useful for automated UI verification; not required for normal use): | Variable | Purpose | | --- | --- | | `QUAY_SUPPORT_DIR` | Override the Application Support directory (normally `~/Library/Application Support/NovaTerminal`; legacy `Quay` data is migrated on first launch) | | `QUAY_KNOWN_HOSTS` | Override the known_hosts path | | `QUAY_LOCAL_PATH` | Starting local directory for the file pane | | `QUAY_APPEARANCE` | `dark` or `light` | | `QUAY_AUTO_CONNECT` | `1` to open the first saved connection on launch | | `QUAY_DEBUG_SNAPSHOT` | Write a PNG snapshot of the window after launch | | `QUAY_DEBUG_EXIT` | `1` to terminate after the snapshot | | `QUAY_DEBUG_PALETTE`, `QUAY_DEBUG_SHEET`, `QUAY_DEBUG_TERMINAL`, `QUAY_DEBUG_LIGHT` | Open a specific UI state for screenshots | | `QUAY_DEBUG_SETTINGS`, `QUAY_DEBUG_SNIPPETS` | Open the settings pop-out / snippets palette for verification | | `QUAY_DEBUG_TRUST_HOST_KEY` | `1` to auto-accept the pending host key (test harness only) | | `QUAY_DEBUG_MFA_RESPONSES` | Comma-separated MFA responses for automated UI verification (never for production) | | `QUAY_DEBUG_UI_FONT`, `QUAY_DEBUG_UI_SIZE` | Set an interface font family / base point size for typography QA | | `QUAY_DEBUG_TERMINAL_FONT`, `QUAY_DEBUG_TERMINAL_SIZE` | Set a terminal font family / size for typography QA | | `QUAY_DEBUG_TERMINAL_COMMAND` | Send a command after the PTY opens (used for the terminal screenshot) | | `QUAY_TERMINAL_COREGRAPHICS` | `1` disables Metal for deterministic terminal capture | ## Security notes - **Host keys:** TOFU with explicit confirmation. A changed or revoked key is rejected with an error. To deliberately replace a key, remove the old entry from `~/.ssh/known_hosts` and reconnect. There is intentionally no "trust anyway" shortcut in this MVP. - **Secrets:** passwords and key passphrases are stored as `kSecClassGenericPassword` items under service `com.zaoangod.novaterminal`; legacy `com.zaoangod.quay` items are read as a fallback. Connection JSON contains no secrets. - **Known hosts:** accepted keys are appended to `~/.ssh/known_hosts` with `0600` permissions; the parent directory is created with `0700`. - **Local folder access:** NovaTerminal does not enumerate the home directory on launch. The local pane starts with a folder chooser; macOS folder permissions are requested only for the folder the user explicitly selects. The chosen path is stored in `quay.local.lastFolder`. - **No sandbox:** the current bundle is not sandboxed, allowing direct access to `~/.ssh` and arbitrary local paths. This is appropriate for a locally distributed developer tool but **not** for Mac App Store distribution. A sandboxed build needs security-scoped bookmarks and a different key-import flow. - The app has no telemetry and makes no network requests other than the SSH connection you initiate. ## Known limitations / roadmap MVP intentionally stops short of the original Quay prototype design: - SSH agent authentication, agent forwarding, ProxyJump / jump hosts, port forwarding. - SMS/OTP MFA requires the SSH server to offer standard **keyboard-interactive** (RFC 4256). Proprietary MFA menus, challenge methods outside keyboard-interactive, and servers that expect the OTP appended to the password without a prompt are not covered. - SSH agent + MFA, and MFA on top of agent forwarding, are not supported because SSH agent authentication itself is not implemented. - NovaTerminal does not generate TOTP codes; every SSH MFA code is requested from and validated by the server. - Recursive folder upload/download; symlink-aware directory operations. - Remote editing, folder comparison/sync, Quick Look. - Multiple terminal splits/sessions per host (one interactive shell per session today); snippets are built in, not user-editable. - Conflict sheets for transfers (same-name uploads currently overwrite; downloads choose a unique local filename). - Host-key “key changed” UI to replace a revoked/changed key; it currently fails closed and points to `known_hosts`. - Password-auth automated coverage (key auth is covered end-to-end; password uses the same Citadel path). - Language switching currently requires relaunch; only English and Simplified Chinese catalogs ship today. Adding a language is documented above. - Technical error details returned by the remote server or Citadel may remain in English; high-level errors, buttons and context are localized. - Interface typography applies to NovaTerminal's workspace, not the native menu bar, Settings form rows or system dialogs. - Custom groups are derived from saved connections; an empty group is not persisted after its last connection is removed. - App Store sandboxing, automatic updates, crash reporting. - Large-directory virtualization is implemented with `LazyVStack`, but SFTP listing is loaded in one batch; 100k+ entry directories need paging. ### Distribution For a signed, notarized build: ```bash codesign --deep --force --options runtime --sign "Developer ID Application: …" dist/NovaTerminal.app xcrun notarytool submit dist/NovaTerminal.zip --keychain-profile … --wait xcrun stapler staple dist/NovaTerminal.app ``` Don’t ship the ad-hoc signed binary as a production release. ## License MIT © 2026 jiay. See [`LICENSE`](LICENSE). ## Third-party See [`THIRD_PARTY_NOTICES.md`](THIRD_PARTY_NOTICES.md). SwiftTerm is vendored under [`Vendor/SwiftTerm/LICENSE`](Vendor/SwiftTerm/LICENSE). ## Design reference The original high-fidelity HTML prototype and Chinese design specification live in the sibling folder [`../quay`](../quay). This native implementation follows that visual system while adapting it to real AppKit controls, native traffic lights, and a functional streaming terminal.