### Run npm scripts for development and production Source: https://github.com/xenongee/ssh-multiplexer/blob/main/README.md Use these commands to start the application in different environments or to compile the project. ```bash # Development npm run dev # Production npm run server # Build binaries npm run build ``` -------------------------------- ### Project Directory Structure Source: https://github.com/xenongee/ssh-multiplexer/blob/main/ARCH.md The backend is organized into modular components for configuration, SSH client management, session handling, and socket communication. ```text src/ ├── server.js — entry point (40 lines), Express + Socket.IO ├── config/ │ └── ConfigService.js — load sshm.json ├── ssh/ │ ├── SshClient.js — ssh2 client wrapper (85 lines, complexity 10) │ └── SessionManager.js — session management (65 lines) ├── socket/ │ └── SocketController.js — Socket.IO handlers (94 lines, complexity 5) └── utils/ ├── connId.js — generate connId └── logger.js — logging ``` -------------------------------- ### Complete work Source: https://github.com/xenongee/ssh-multiplexer/blob/main/AGENTS.md Closes an issue with a specified reason in JSON format. ```bash bd close bd-42 --reason "Completed" --json ``` -------------------------------- ### Project Directory Structure Source: https://github.com/xenongee/ssh-multiplexer/blob/main/README.md Overview of the source code organization, including server-side logic, frontend modules, and build artifacts. ```text ssh-multiplexer/ ├── src/ │ ├── server.js # Entry point (Express + Socket.IO, ~50 lines) │ ├── config/ │ │ └── ConfigService.js # Load and validate sshm.json │ ├── ssh/ │ │ ├── SshClient.js # Wrapper over ssh2.Client (no socket.io) │ │ └── SessionManager.js # SSH session management (no socket.io) │ ├── socket/ │ │ └── SocketController.js # Socket.IO event handlers (no ssh2) │ ├── utils/ │ │ ├── connId.js # Generate unique connection IDs │ │ └── logger.js # Logging │ └── public/ # Frontend (ES modules) │ ├── client.js # Entry point (initialization) │ ├── index.html # Main page │ ├── style.css # Styles (dark theme, grid, statuses) │ └── modules/ │ ├── state.js # Global state + DOM references │ ├── render.js # Render functions (terminals, controls, status) │ ├── terminal.js # Terminals (create, fit, fullscreen) │ ├── input.js # Keyboard/paste handling │ ├── socket.js # Socket.IO handlers │ └── ui.js # DOM event listeners, help modal ├── package.json # Dependencies, scripts, pkg configuration ├── sshm.json # Application config (host groups, port, terminal) ├── gendoc.sh # Script to generate project_list.md ├── .gitignore └── dist/ # Built binaries (npm run build) ├── ssh-multiplexer-linux # Linux x64 executable ├── ssh-multiplexer-win.exe # Windows x64 executable └── sshm.json # Config copy for dist ``` -------------------------------- ### Check for ready work Source: https://github.com/xenongee/ssh-multiplexer/blob/main/AGENTS.md Retrieves a list of unblocked issues ready for processing in JSON format. ```bash bd ready --json ``` -------------------------------- ### Application Configuration Schema Source: https://github.com/xenongee/ssh-multiplexer/blob/main/README.md The sshm.json file defines runtime settings including server host/port, terminal defaults, and host group definitions. ```json { "app_port": 3333, // optional, default 3333 "app_host": "127.0.0.1", // optional, default 127.0.0.1 "terminal_defaults": { // optional, xterm.js props "fontFamily": "'Fira Code', monospace", "fontSize": 11, "minWidth": 600 }, "groups": [ { "group": "Name", // unique group name "hosts": [ { "label": "PC-01", // display name in terminal "user": "root", "host": "192.168.1.1", "port": 22, // optional, default 22 "password": "secret" // plaintext (see Security) } ] } ] } ``` -------------------------------- ### Create new issues Source: https://github.com/xenongee/ssh-multiplexer/blob/main/AGENTS.md Creates new tasks, bugs, or features with optional descriptions, priorities, and dependency links. ```bash bd create "Issue title" --description="Detailed context" -t bug|feature|task -p 0-4 --json bd create "Issue title" --description="What this issue is about" -p 1 --deps discovered-from:bd-123 --json ``` -------------------------------- ### Claim and update issues Source: https://github.com/xenongee/ssh-multiplexer/blob/main/AGENTS.md Updates an issue's status, such as claiming it for work or changing its priority. ```bash bd update --claim --json bd update bd-42 --priority 1 --json ``` -------------------------------- ### SSH Multiplexer Data Flow Source: https://github.com/xenongee/ssh-multiplexer/blob/main/ARCH.md Visual representation of the communication sequence between the browser client, the server's controllers, and the target SSH hosts. ```text Browser Server SSH Hosts │ │ │ │──selectGroup──────────────► SocketController │ │ │──SessionManager.connect()──► SshClient.connect() │ │ │──ssh2 shell() │◄──term.create─────────────── │ │ │◄──term.shell.ready────────── │◄──cb.onReady() │ │◄──term.data(data)─────────── │◄──stream.on('data') ◄─────────┤ │──term.input.specific───────► │──SshClient.write() ──────────►│ │ (loops per unlocked) │ │ │──term.resize───────────────► │──SshClient.resize() ─────────►│ │ │ │ │◄──term.close──────────────── │◄──cb.onClose() ◄──────────────┤ │◄──term.error──────────────── │◄──cb.onError() ◄──────────────┤ ``` -------------------------------- ### Update Terminal Lock State Source: https://github.com/xenongee/ssh-multiplexer/blob/main/ARCH.md Updates the lock status of a specific terminal in the global state and triggers a UI re-render. ```js function setTerminalLock(connId, isLocked) { state.terminals[connId].isLocked = isLocked; renderTerminals(); } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.