{"id":51990701,"url":"https://github.com/wiedymi/swift-et","last_synced_at":"2026-07-31T00:30:57.661Z","repository":{"id":372178032,"uuid":"1305645206","full_name":"wiedymi/swift-et","owner":"wiedymi","description":"Pure Swift Eternal Terminal (ET) protocol client for Apple platforms","archived":false,"fork":false,"pushed_at":"2026-07-19T12:38:44.000Z","size":69,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-07-19T13:15:39.057Z","etag":null,"topics":["eternal-terminal","ios","macos","networking","remote-shell","swift","swift-package","terminal"],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wiedymi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-07-19T11:15:42.000Z","updated_at":"2026-07-19T12:38:51.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/wiedymi/swift-et","commit_stats":null,"previous_names":["wiedymi/swift-et"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/wiedymi/swift-et","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wiedymi%2Fswift-et","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wiedymi%2Fswift-et/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wiedymi%2Fswift-et/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wiedymi%2Fswift-et/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wiedymi","download_url":"https://codeload.github.com/wiedymi/swift-et/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wiedymi%2Fswift-et/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":36097394,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-07-20T02:08:10.276Z","status":"online","status_checked_at":"2026-07-30T02:00:05.956Z","response_time":106,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["eternal-terminal","ios","macos","networking","remote-shell","swift","swift-package","terminal"],"created_at":"2026-07-31T00:30:57.130Z","updated_at":"2026-07-31T00:30:57.650Z","avatar_url":"https://github.com/wiedymi.png","language":"Swift","funding_links":["https://github.com/sponsors/vivy-company"],"categories":[],"sub_categories":[],"readme":"# swift-et\n\n[![GitHub](https://img.shields.io/badge/-GitHub-181717?style=flat-square\u0026logo=github\u0026logoColor=white)](https://github.com/wiedymi)\n[![Twitter](https://img.shields.io/badge/-Twitter-1DA1F2?style=flat-square\u0026logo=twitter\u0026logoColor=white)](https://x.com/wiedymi)\n[![Email](https://img.shields.io/badge/-Email-EA4335?style=flat-square\u0026logo=gmail\u0026logoColor=white)](mailto:contact@wiedymi.com)\n[![Discord](https://img.shields.io/badge/-Discord-5865F2?style=flat-square\u0026logo=discord\u0026logoColor=white)](https://discord.gg/zemMZtrkSb)\n[![Support me](https://img.shields.io/badge/-Support%20me-ff69b4?style=flat-square\u0026logo=githubsponsors\u0026logoColor=white)](https://github.com/sponsors/vivy-company)\n\nPure Swift Eternal Terminal (ET) protocol client for Apple platforms.\n\nThis library implements the client side of the [Eternal Terminal](https://github.com/MisterTea/EternalTerminal) wire protocol (protocol version 6): bootstrap command generation/parsing, encrypted transport, reconnect/resume, terminal I/O, and port forwarding. The server, an SSH implementation, and terminal UI/rendering are intentionally out of scope so consumers can integrate their preferred SSH stack and renderer.\n\n## Features\n\n- Wire-compatible with the C++ `etserver` (verified end-to-end against Eternal Terminal 7.0.0)\n- Pure Swift XSalsa20-Poly1305, byte-compatible with libsodium `crypto_secretbox` — no runtime crypto dependency\n- Seamless reconnection and process relaunch recovery using sequence-numbered ciphertext checkpoints\n- Terminal session API: async/await, `AsyncStream` output, keystroke input, window resize\n- SSH bootstrap adapter with bring-your-own-SSH execution\n- Forward and reverse port tunnels, port ranges, Unix sockets, jumphost support\n- Split modules:\n  - `ETCrypto` — pure Swift XSalsa20-Poly1305 and nonce management\n  - `ETCore` — protobuf messages, packets, framing, and reliable catchup\n  - `ETTransport` — internal transport abstraction and Network.framework implementation\n  - `ETBootstrap` — injected `etterminal` launch command and credential parser\n  - `ETSession` — connection lifecycle, terminal API, forwarding, and jumphost support\n- Real local `etserver` E2E test harness\n- Release-mode benchmarks with a libsodium baseline\n\n## Platforms\n\n- iOS 16+\n- macOS 13+\n- Swift tools 6.0+\n\n## Installation\n\nAdd to `Package.swift`:\n\n```swift\ndependencies: [\n    .package(url: \"https://github.com/wiedymi/swift-et\", from: \"0.1.5\")\n]\n```\n\nThen add `ETSession` and `ETBootstrap` to your app target dependencies:\n\n```swift\n.target(\n    name: \"YourApp\",\n    dependencies: [\n        .product(name: \"ETSession\", package: \"swift-et\"),\n        .product(name: \"ETBootstrap\", package: \"swift-et\")\n    ]\n)\n```\n\n## Usage\n\nApps normally import the session and bootstrap surfaces:\n\n```swift\nimport ETBootstrap\nimport ETSession\n```\n\nYou can supply credentials acquired out of band:\n\n```swift\nlet session = try ETTerminalSession(\n    host: \"example.com\",\n    port: 2022,\n    clientID: clientID,\n    passkey: passkey\n)\n\ntry await session.connect()\n\nTask {\n    for await data in session.output {\n        renderer.feed(data)\n    }\n}\n\ntry await session.send(Data(\"ls -la\\n\".utf8))\ntry await session.resize(\n    rows: 40,\n    cols: 120,\n    pixelWidth: 1440,\n    pixelHeight: 900\n)\n```\n\n## Bootstrap\n\n`ETBootstrap` mirrors the C++ client's `etterminal` command and `IDPASSKEY:` parser. The\nlibrary never opens SSH itself; inject your existing SSH client:\n\n```swift\nstruct AppSSHExecutor: ETBootstrapExecutor {\n    let ssh: MySSHClient\n\n    func run(command: String) async throws -\u003e String {\n        try await ssh.run(command, captureOutput: true)\n    }\n}\n\nlet session = ETTerminalSession(\n    host: \"example.com\",\n    port: 2022,\n    bootstrapExecutor: AppSSHExecutor(ssh: ssh),\n    bootstrapOptions: ETBootstrapOptions(\n        term: \"xterm-256color\",\n        serverFifo: \"/tmp/etserver.fifo\"\n    )\n)\n\ntry await session.connect()\n```\n\nPort forwarding:\n\n```swift\nlet session = try ETTerminalSession(\n    host: \"example.com\",\n    port: 2022,\n    clientID: clientID,\n    passkey: passkey,\n    tunnelSpecification: \"8080:8080\",\n    reverseTunnelSpecification: \"9090:9090\"\n)\n```\n\nThe full lifecycle (`bootstrapping`, `connecting`, `connected`, `disconnected`,\n`reconnecting`, and terminal states) is observable via `session.stateChanges`. If your network\nmonitor reports a meaningful path change, nudge recovery without waiting for the normal retry:\n\n```swift\nawait session.notifyNetworkPathChanged()\n```\n\nTo resume the same server-side session after an app relaunch, persist\n`ETSessionCheckpoint` separately from the passkey, then restore both:\n\n```swift\nlet checkpoint = try await session.prepareForApplicationBackground()\n// Persist checkpoint; keep the passkey in Keychain or another credential store.\n\nlet restored = try ETTerminalSession(\n    host: \"example.com\",\n    clientID: clientID,\n    passkey: passkey,\n    checkpoint: checkpoint\n)\ntry await restored.connect()\n```\n\nIf the process remains alive, call `resumeFromApplicationBackground()` after foregrounding.\n\n## Testing\n\n```sh\nswift test\n```\n\nEnd-to-end tests against a real `etserver` (`brew install MisterTea/et/et`):\n\n```sh\nET_INTEGRATION=1 swift test --filter ETIntegrationTests\n```\n\nBenchmarks:\n\n```sh\nswift run -c release Benchmarks\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwiedymi%2Fswift-et","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwiedymi%2Fswift-et","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwiedymi%2Fswift-et/lists"}