Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cypher0x

A minimal, high-performance terminal emulator for iOS (iPad/iPhone) built for builders and vibe-coders.

Features

  • SSH client with profile management
  • ngrok integration for remote access
  • TTS integration adapted for terminal commands
  • Optimized for coding agents (Claude Code, Codex, Gemini, OpenCode)
  • Native scrolling with HQ text rendering

Architecture

┌─────────────────────────────────────────┐
│  SwiftUI App Shell                      │
│  (Navigation, Settings, SSH Profiles)   │
├─────────────────────────────────────────┤
│  Swift FFI Wrapper                      │
│  - Terminal class with safe Swift API   │
│  - TTSAdapter for command detection     │
│  - Memory-safe cleanup                  │
├─────────────────────────────────────────┤
│  Rust Core (via FFI)                    │
│  - vte (VT escape sequence parsing)     │
│  - russh (SSH2)                         │
│  - Terminal emulation (iOS-compatible)  │
└─────────────────────────────────────────┘

Project Structure

cypher0x/
├── core/                       # Rust core library
│   ├── src/
│   │   ├── lib.rs             # Library entry point
│   │   ├── terminal/mod.rs    # Terminal emulation
│   │   ├── ssh/mod.rs         # SSH client
│   │   ├── tts/mod.rs         # TTS adapter
│   │   └── ffi/mod.rs         # C-compatible FFI
│   ├── Cargo.toml
│   └── cbindgen.toml
├── ios/
│   ├── Cypher0x.xcodeproj/    # Xcode project
│   └── Cypher0x/
│       ├── Cypher0xApp.swift          # App entry point
│       ├── cypher0x_core.h            # Generated C header
│       ├── Cypher0x-Bridging-Header.h # Swift bridge
│       ├── Views/
│       │   ├── ContentView.swift      # Main navigation
│       │   ├── TerminalDemoView.swift # Terminal demo
│       │   └── SSHConnectionView.swift # SSH (placeholder)
│       ├── Services/
│       │   └── Cypher0xCore.swift     # Swift FFI wrapper
│       └── lib/
│           ├── libcypher0x_core_device.a
│           └── libcypher0x_core_sim.a
├── scripts/
│   └── build-ios.sh           # Build script
├── PLAN.md                    # Implementation plan
└── README.md

Building

Prerequisites

  • Xcode 15+ (full installation, not just Command Line Tools)
  • Rust with iOS targets: rustup target add aarch64-apple-ios aarch64-apple-ios-sim
  • cbindgen: cargo install cbindgen

Build Rust Core

./scripts/build-ios.sh

This builds:

  • libcypher0x_core_device.a for iOS devices (arm64)
  • libcypher0x_core_sim.a for iOS Simulator (arm64)
  • cypher0x_core.h C header via cbindgen

Build iOS App

  1. Open ios/Cypher0x.xcodeproj in Xcode
  2. Select your target device or simulator
  3. Build and run (⌘R)

Run Tests

cd core
cargo test

FFI Interface

The Rust core exposes these C functions:

Core:

  • cypher0x_init() - Initialize the library
  • cypher0x_version() - Get version string
  • cypher0x_free_string() - Free Rust-allocated strings

Terminal:

  • terminal_create(cols, rows) - Create terminal
  • terminal_destroy(handle) - Destroy terminal
  • terminal_write(handle, data, len) - Write bytes
  • terminal_write_string(handle, text) - Write string
  • terminal_resize(handle, cols, rows) - Resize
  • terminal_get_screen_content(handle) - Get display text
  • terminal_get_cursor_position(handle, row, col) - Get cursor
  • terminal_get_cell(handle, row, col, cell) - Get cell data

TTS Adapter:

  • tts_create() - Create adapter
  • tts_destroy(handle) - Destroy adapter
  • tts_detect_command(handle, input) - Detect command type
  • tts_adapt_output(handle, output, type) - Adapt for TTS

Current Status

  • ✅ iOS builds working (aarch64-apple-ios + simulator)
  • ✅ Terminal emulation with VT escape sequences
  • ✅ Full FFI interface for Terminal and TTS
  • ✅ Swift wrapper classes with safe API
  • ✅ SwiftUI app scaffolding
  • ⏳ SSH implementation (russh integrated, needs FFI)
  • ⏳ Full terminal UI (Core Text rendering)
  • ⏳ SSH profiles and key management

See PLAN.md for detailed implementation plan.

License

MIT

About

terminal emulator that feels like jarvis

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages