This document outlines the architecture governing command-line execution in GOAL Backend and the design specification for the upcoming goal-cli remote client executable written in Go.
GOAL is architected around two complementary execution planes:
| Dimension | REST API Layer | CLI / Command-Line Layer |
|---|---|---|
| Primary Audience | Frontend Apps (React, Flutter), External Systems | Sysadmins, DevOps, Automation Crons, Remote Edge Agents |
| Execution Pattern | Synchronous Request-Response (HTTP/JSON) | Asynchronous Batches, Daemons, Long-Running Pipelines |
| Payload Envelope | ActionResult JSON with standard headers |
Standard Streams (stdout, stderr), Exit Codes, JSON Lines |
| Authentication | Bearer JWT (x-app-stage, x-app-uid) |
Machine API Keys, Local Environment Context, SSH Keyrings |
All command routines in GOAL backend inherit from Lumen's Illuminate\Console\Command and execute within isolated container environments:
dev, staging, prod).pgsql-main, timescale-telemetry, couchdb, sb1-hana).App\Domain\...) rather than embedding logic in the command class.goal-cli (Go)To eliminate the need for operators and remote devices to have direct SSH container access or full PHP runtimes, a standalone executable written in Go (goal-cli) is planned.
linux/amd64, linux/arm64, darwin/arm64, and windows/amd64./v1/management/cli/execute) over mTLS or HTTPS with signed API tokens.--output=json) for scripting.# Authenticate remote client
goal-cli auth login --server https://goal-api.dsroma.info --token <api-key>
# Trigger remote database sync
goal-cli sync sap --entity=business-partners --company=1
# Query live queue status
goal-cli queues status --watch
# Ingest or replay telemetry buffer
goal-cli telemetry replay --file=/var/log/offline-gps.json
goal-cli emits a tamper-evident audit record in the audit_logs table containing user identity, IP address, parameters, and execution duration.