siloos-ops
Handles build, test, lint, and deployment operations for the SiloOS project.
SKILL.md.agent/skills/siloos-ops/SKILL.md
GitHubSiloOS Operations Skill
Environment facts (read first)
- Pi = Raspberry Pi 4, hostname
SiloOS, reachable atsiloos.local(Wi-Fiwlan0; keep ethernet unplugged — seesiloos-pi-recovery). - Two systemd services, both enabled +
Restart=always:scale_bridge— Python bridge, WebSocket:8765.silo-dashboard— Vite dev server (vite --host, dual-stack:5173).
- Access the dashboard at http://siloos.local:5173/.
Commands
Build Dashboard
- Command:
cd dashboard && npm run build - Purpose: Compile TypeScript and build the Vite production bundle.
Lint Dashboard
- Command:
cd dashboard && npm run lint - Purpose: Check for code style and logic errors in the frontend.
Sync to Raspberry Pi
- Command:
./sync-project.ps1 - Purpose: Synchronize local changes to the Raspberry Pi and restart services.
Manual Code Deployment (Pi)
- Copy Bridge:
scp -i siloos_key ble_bridge.py siloos@siloos.local:/home/siloos/ble_bridge.py - Copy Config:
scp -i siloos_key config.json siloos@siloos.local:/home/siloos/config.json - Restart Service:
ssh -i siloos_key siloos@siloos.local "sudo systemctl restart scale_bridge" - Verify Logs:
ssh -i siloos_key siloos@siloos.local "sudo journalctl -u scale_bridge -n 20 --no-pager"
Run Dashboard (Dev)
- Command:
cd dashboard && npm run dev -- --host - Purpose: Start the development server with external access enabled.
Run Python Bridge (Local Debug)
- Command:
python3 ble_bridge.py - Purpose: Start the hardware bridge for local testing (requires BLE hardware).
Managing the services
ssh -i siloos_key siloos@siloos.local "systemctl status scale_bridge silo-dashboard --no-pager"
ssh -i siloos_key siloos@siloos.local "sudo systemctl restart silo-dashboard" # after dashboard changes
ssh -i siloos_key siloos@siloos.local "sudo journalctl -u silo-dashboard -n 30 --no-pager"
If a service is ever missing (is-enabled → not-found), reinstall it with tools/install_bridge_service.sh (bridge) or re-run tools/pi_full_fix.sh (both).
Deploying over a flaky Pi link
Do NOT hand-run multi-step SSH commands when the link drops — they corrupt mid-stream. Push a script and launch it detached so it survives disconnects, then poll its log:
scp -i siloos_key tools/<script>.sh siloos@siloos.local:/home/siloos/
ssh -i siloos_key siloos@siloos.local "sudo systemd-run --unit=job --collect bash /home/siloos/<script>.sh"
# then: ssh ... "cat /home/siloos/<script>.log" # poll for the completion MARKER
Tip: if siloos.local is flapping, SSH to the raw Wi-Fi IP (10.0.124.199) directly — flapping usually means the name is resolving to the dead .5 (eth0).
Deployment Procedure
- Build local assets:
npm run build - Sync to Pi using
sync-project.ps1or manualscp. - Restart the affected service (
scale_bridgeand/orsilo-dashboard). - Verify:
systemctl status scale_bridge silo-dashboardand load http://siloos.local:5173/.