How blinksh/blink works
Main components
• User Interface & Terminal Layer: Represented by the “Blink” folder that contains the AppDelegate, scene and view controllers, UI components (SmartKeys, LayoutManager, StatusBar, etc.), storyboards, and resources (Media.xcassets).
• Command & Shell Processing Engine: This layer abstracts the commands (including cd, ls, curl, ssh, sftp, etc.), which come from the ios_system.framework integrated into the project. These are implemented in many of the source files under directories such as “Commands”, “BlinkCode”, and “NonStdIO”.
• Session & Connection Management: This includes components found in “Sessions”, “SSH”, and “Mosh” sections within the project. They handle establishing secure SSH/Mosh connections, managing session states, and re-establishing connections according to the always-on philosophy.
• Configuration & Customization: Encompassing directories like “BlinkConfig”, “Settings”, and resources for fonts/themes, this layer manages user settings, key management (from the “SSH/” and “Settings/ViewControllers/BKPubKey” directories), and environment variable definitions (as noted in MCPSession.m).
• Testing & Build Infrastructure: Represent test targets (e.g., BlinkTests, BlinkCodeTests, SSHTests, etc.) and the CI/CD pipelines (referenced in the README and the .github directory) to indicate quality control and automated builds.
• Link the Command Engine to the Session Management layer to show that commands related to SSH/Mosh sessions require establishing and maintaining connections.
• Configuration layer with both the UI and Command Processing layers (for theme settings, key management, and environment variable adjustments).
• External libraries as supporting modules that are utilized by the Command engine and session management modules.
• Interactions between the Logging/Telemetry, FileProvider, and Migrator submodules (as seen in directories like BlinkLogging, BlinkFileProvider, and Migrator) to cover troubleshooting and history tracking.
Architectural Patterns & Design Principles
• Model-View-Controller (MVC) or similar component separation: UI (Views/Controllers), a processing layer (model/business logic for sessions and commands) and configuration management.
• Dependencies on low-level libraries (C/Swift integration) for performance-critical functionality.