zX is a high-performance, local-first cross-platform desktop application designed for the parametric exploration of CLI applications over both local and remote SSH environments. By decoupling high-speed presentation from core computation, zX provides a premium, responsive IDE-like interface for managing complex engineering workflows, running iterative optimization tasks, and visualizing structured outcomes.
zX implements a clean separation of concerns using a Client-Sidecar architectural pattern:
- Frontend (Electron + React + Vite): Pure presentation layer. Includes dynamic data grids, a Monaco-based hook editor with inline syntax verification, interactive Plotly visualization dashboards, a split-view terminal emulator (
xterm.js), and a VS Code-style file browser. - Backend (FastAPI Sidecar): Robust Python server packaged as a wheel. Handles SSH config parsing (
~/.ssh/config), token-based secure API endpoints, background execution queues, thread/subprocess orchestration, and sequential/iterative parametric loops. - Communication: Secured locally or via SSH tunnels using token-based authentication over high-speed REST endpoints and real-time WebSockets.
graph TD
subgraph Electron [Electron Desktop App]
Renderer["React UI (Vite)<br>β’ Monaco Hook Editor<br>β’ Plotly Dashboard<br>β’ Project Grid & File Browser"]
Main["Electron Main Process<br>β’ Process Lifecycle<br>β’ SSH Tunnel Manager<br>β’ App Settings (userData)"]
Renderer -- "IPC / IPC-Renderer" --> Main
end
subgraph Communication [Communication Layer]
API["REST API & WebSockets<br>(Token Authenticated)"]
end
subgraph Backend [FastAPI Sidecar Backend]
App["FastAPI Server (Python)<br>β’ REST Routes & WebSocket Channels"]
Engine["Exploration Engine<br>β’ Subprocess Orchestration<br>β’ CSV Database I/O (File Locks)<br>β’ Hook Execution Framework"]
App --> Engine
end
subgraph Environment [Target Systems]
Local["Local Subprocesses"]
Remote["Remote SSH Host<br>β’ Tailored 'uv' Environment<br>β’ Copied Backend Wheel (.whl)"]
end
Main -- "Spawns Local Sidecar / Establishes SSH Tunnel" --> App
Renderer -- "REST / WebSockets" --> API
API --> App
Engine -- "Runs Hooks & Jobs" --> Local
Engine -- "Runs Hooks & Jobs over SSH" --> Remote
The local development lifecycle is managed via the helper script develop.sh. This script automates bootstrapping Python virtual environments, resolving Node dependencies, compiling the FastAPI backend wheel, and launching hot-reloaded development processes.
Simply run the following script from the root of the repository:
./develop.sh- Node Dependency Verification: Checks if
node_modulesexists. If not, runsnpm installautomatically to fetch frontend and packaging packages. - Python Virtual Environment Setup: Detects and verifies the local virtual environment folder (
.venv). If found, it activates the environment to ensure Python dependencies (fastapi,uvicorn,pandas,paramiko, etc.) are in scope. - Port Allocation Safety: Scans for active processes listening on port
8000(the default FastAPI sidecar port). If a stray backend process is detected, it is gracefully or forcibly terminated (kill -9) to prevent binding collision. - Stale Build Cleanup: Removes old compilation targets and distribution assets:
rm -rf dist-electron dist
- FastAPI Backend Package Build: Navigates to the
backend/directory and compiles the Python FastAPI sidecar into a wheel package (.whl).- Prefers:
uv build --wheelfor lightning-fast compilation. - Fallback: Installs standard
buildviapipand compiles withpython3 -m build --wheel.
- Prefers:
- Concurrent Dev Server Launch: Starts both the Vite development server (with hot-reloading) and the Electron dev shell concurrently:
This script runs
npm run dev:all
concurrently -k "npm run dev" "npm run electron:dev", ensuring that stopping the terminal cancels both services cleanly.
To compile and package the desktop application locally for production use, the repository provides the package.sh script.
Execute the production packager script:
./package.sh- Code Signing Configuration: Automatically sets up system environment variables to support Apple macOS signing and notarization:
APPLE_ID:jamil.appa@zenotech.comAPPLE_TEAM_ID:HDDG45ZM4GAPPLE_APP_SPECIFIC_PASSWORD: uedy-sedx-xfji-hslxDEBUG&DEBUG_DMGflags are activated to provide deep diagnostics fromelectron-builder,electron-osx-sign, andelectron-notarize.
- Node Modules Check: Verifies that all dependencies are installed, running
npm installif required. - Clean Stale Outputs: Wipes previous packaging artifacts to guarantee a clean build state:
rm -rf dist dist-electron release
- Backend Distributable Compiling: Activates the Python
.venvand packages the current FastAPI source code into a wheel package. This wheel is copied inside the Electron package resources, allowing Electron to deploy it on remote servers automatically. - Application Packaging: Runs the packaging sequence:
This scripts invokes:
npm run package
electron:buildto compile main process TypeScript files (tsconfig.electron.json) todist-electron.build:rendererto check TypeScript files in the frontend and build optimized production chunks via Vite intodist.electron-builderto bundle the app, sign binary packages, and generate native installers inside thereleasedirectory.
The continuous integration and delivery system is configured via build-linux.yml inside .github/workflows/.
This automated workflow compiles and packages zX for Linux platforms (AppImage and debian packages) and registers a new GitHub Release.
The pipeline runs under two conditions:
- Tag Pushes: When a git tag matching the pattern
v*(e.g.v0.2.0,v1.0.0-beta.1) is pushed. - Manual Trigger (
workflow_dispatch): Allows maintainers to trigger builds manually via the GitHub Actions dashboard. It takes a version input parameter (defaults to0.2.0).
graph TD
A[Trigger Tag / Manual] --> B[Checkout Code]
B --> C[Determine Version]
C --> D[Synchronize Codebase Versions]
D --> E[Install System Build Dependencies]
E --> F[Set up Python & uv]
F --> G[Build Backend Wheel]
G --> H[Set up Node & npm ci]
H --> I[Compile & Package AppImage/deb]
I --> J[Tar Example Projects]
J --> K[Create GitHub Release & Upload Assets]
- Checkout Repository: Pulls the source code using
actions/checkout@v6. - Determine Version: Reads the target version from either the
workflow_dispatchtext input or the git tag (stripping thevprefix). Saves it as aVERSIONenvironment variable. - Synchronize Codebase Versions: Automates consistency by rewriting versions across the entire stack:
- Node: Updates
package.json&package-lock.jsonusingnpm version. - Backend config: Rewrites the
versionfield in pyproject.toml. - Backend entrypoint: Updates
__version__in init.py. - Frontend UI: Replaces references to the zX Engine version displayed in the React interface (App.tsx).
- Main Process: Adjusts the wheel package name pattern queried during remote bootstrap inside main.ts.
- Node: Updates
- Install System Build Dependencies: Installs Linux system libraries (
libgl1,libegl1,libxrender1,libxt6,libxxf86vm1, andbuild-essential) needed for headless graphic bindings during Vite builds and Electron packaging. - Set Up Python Environment: Provisions Python
3.14and installs theastral-sh/setup-uv@v8.1.0action. - Build Python Backend Wheel: Navigates to the backend directory and builds the wheel package:
uv build --wheel
- Set Up Node Environment: Installs Node.js
24. - Install Node Dependencies: Uses
npm ci(clean install) for quick, deterministic dependency resolution. - Compile & Package Application: Triggers
npm run packageunder the environment variableCSC_IDENTITY_AUTO_DISCOVERY: falseto build AppImage and deb packages without requiring developer certificates on the runner. - Example Projects Archiving: Creates a gzip tarball containing standard engineering project templates:
tar -czf zx-example-projects.tar.gz projects
- GitHub Release Creation: Authenticates via the workspace
GITHUB_TOKENand runssoftprops/action-gh-release@v3to create a release. It publishes:- Linux native desktop package:
release/*.AppImage - Debian desktop package:
release/*.deb - Example templates package:
zx-example-projects.tar.gz - Python backend library:
backend/dist/*.whl
- Linux native desktop package:
zX/
βββ .github/workflows/
β βββ build-linux.yml # Linux CI/CD release workflow
βββ backend/ # FastAPI Sidecar Python source
β βββ zx_backend/ # Core sidecar server code
β βββ pyproject.toml # Backend package config & dependencies
βββ src/
β βββ main.ts # Electron Main process entrypoint
β βββ preload.ts # Secure IPC context bridge
β βββ renderer/ # React + Vite frontend source
β βββ App.tsx # Main frontend React coordinator
β βββ index.css # Core typography & Tailwind-like CSS variables
βββ projects/ # Example parametric project templates
βββ templates/ # Default custom Python hook templates
βββ develop.sh # Multi-process dev bootstrap script
βββ package.sh # Local production packaging script
βββ tsconfig.json # Frontend TypeScript compiler options
βββ tsconfig.electron.json # Electron TypeScript compiler options
βββ package.json # NPM project scripts & dependencies
βββ vite.config.ts # Vite asset & compiler bundle settings
- Requirements: Node.js (v24+), Python (v3.9+),
uv(highly recommended for performance). - Modifying hooks: Default hook templates are housed in
/templatesand copied to new user projects. - Version bumps: Standard commits should avoid manual version modifications. Version bumps are automatically handled by the build-linux.yml workflow when tagging a new release.
Developed and maintained by Zenotech Ltd.