Prerequisites
Before installing TermNode, make sure you have the following:
- Termux — Install from F-Droid or GitHub releases. The Play Store version is outdated.
- Go 1.22+ — Install via
pkg install golangin Termux. - termux-api — Install the package (
pkg install termux-api) and the Termux:API Android app. Grant it permissions in Android settings. - OpenSSH (optional) — For the SSH server feature:
pkg install openssh.
Test that termux-api works:
termux-battery-statusInstallation
Option 1: Download Binary (Recommended)
wget https://github.com/Mr-Dark-debug/termnode/releases/latest/download/termnode
chmod +x termnode
./termnodeOption 2: Build from Source
git clone https://github.com/Mr-Dark-debug/termnode.git
cd termnode
go build -o termnode .
./termnodeOption 3: Go Install
go install github.com/Mr-Dark-debug/termnode@latestQuick Start
Once installed, simply run TermNode. The TUI dashboard launches immediately:
./termnodeUse the function keys or number keys to navigate between screens:
- F1 or 1 — Hardware Dashboard
- F2 or 2 — Service Manager
- F3 or 3 — IoT Event Log
- F4 or ? — Help & Keybindings
Press q or Ctrl+C to quit.
CLI Options
Usage: termnode [options]
Options:
-db string Path to SQLite database (default "$HOME/.termnode/termnode.db")
-port string HTTP webhook listen address (default ":8080")
-debug Enable debug logging to debug.log
-version Print version and exitHardware Dashboard (F1)
The dashboard provides real-time monitoring of your device's critical hardware metrics, powered by termux-api. Data auto-refreshes every 5 seconds.
Displayed information includes:
- Battery percentage, status (charging/discharging), health, and temperature
- Battery current (mA) and charging status
- CPU usage percentage, core count, architecture, and temperature
- WiFi SSID, local IP address, and BSSID
Press r to force a manual refresh.
Service Manager (F2)
One-toggle controls for background services:
| Service | Description | Default Port |
|---|---|---|
| Wake Lock | Prevents Android battery optimization from killing your processes | — |
| SSH Server | Start/stop the OpenSSH daemon for remote access | 8022 |
| HTTP File Server | Go-powered file server serving from your home directory | 8081 |
Use Up/Down or j/k to navigate, Enter to toggle a service.
IoT Bridge (F3)
Turn your Android phone into a data collection hub for microcontrollers and IoT devices.
The IoT bridge starts an HTTP server that accepts POST requests with sensor data:
curl -X POST http://<phone-ip>:8080/webhook/temperature \
-H "Content-Type: application/json" \
-d '{"sensor":"DHT22","value":23.5,"unit":"celsius"}'All events are persisted to a local SQLite database and displayed in a scrollable, real-time event log.
Help Screen (F4)
Full keybinding reference and feature documentation, always one keypress away. Displays all available commands and their shortcuts.
Keybindings
| Key | Action |
|---|---|
F1 or 1 | Dashboard tab |
F2 or 2 | Services tab |
F3 or 3 | IoT Log tab |
F4 or ? | Help tab |
q or Ctrl+C | Quit |
↑ / k | Move up |
↓ / j | Move down |
Enter | Toggle / Activate |
r | Manual refresh (Dashboard) |
IoT Webhook API
POST /webhook/{topic}
Send sensor data to TermNode from any HTTP-capable device. The {topic} parameter is used to categorize the event.
Request:
curl -X POST http://192.168.1.100:8080/webhook/temperature \
-H "Content-Type: application/json" \
-d '{"sensor":"DHT22","value":23.5,"unit":"celsius"}'Response:
{"status":"ok"}GET /health
Health check endpoint for monitoring.
{"status":"ok"}Building from Source
# Default build
go build -o termnode .
# With version info
go build -ldflags="-X main.version=$(git describe --tags)" -o termnode .
# With MQTT support (future)
go build -tags mqtt -o termnode .
# Cross-compile from desktop
GOOS=android GOARCH=arm64 go build -o termnode-android .Make Targets
| Command | Description |
|---|---|
make | Build the binary |
make run | Build and run |
make test | Run tests |
make debug | Build and run with debug logging |
make clean | Remove binary and logs |
Architecture
TermNode uses the Elm Architecture via Bubble Tea. The root model composes screen models, each implementing Init(), Update(), and View().
Project Structure
termnode/
├── main.go # Thin entry point
├── internal/
│ ├── app/ # Root TUI model & routing
│ ├── daemon/ # Wake-lock & process management
│ ├── hardware/ # termux-api polling & parsing
│ ├── iot/ # HTTP webhook server
│ ├── db/ # SQLite repository layer
│ ├── screen/ # Individual TUI screens
│ └── theme/ # Lipgloss styles & colors
├── migrations/ # SQL schema (embedded in binary)
└── plan/ # Development plans & docsAll dependencies are pure Go — zero CGO required. The database auto-migrates on startup via embedded Goose migrations.