Gladex API & CLI Reference

Complete reference for the Gladex investor app endpoints and CLI commands.

Public Endpoints

Accessible from any network without authentication.

GET /healthz PUBLIC

Lightweight health check. Returns JSON with service status, environment, timestamp, and version.

{
  "status": "ok",
  "service": "gladex-investor-app",
  "env": "prod",
  "timestamp": 1790039940,
  "version": "0.4.28"
}
GET /api/health PUBLIC

Detailed health check. Includes peer service status, disk usage, and unread message count.

{
  "status": "ok",
  "service": "gladex-investor-app",
  "env": "prod",
  "timestamp": 1790039940,
  "version": "0.4.28",
  "checks": {
    "investor-app-dev": "ok",
    "investor-app-prod": "self",
    "disk_usage_pct": 34.7,
    "disk_free_bytes": 68625489920,
    "unread_messages": 0
  }
}
GET /api/version PUBLIC

Returns application version, PHP version, and environment.

{
  "app": "gladex-investor-app",
  "version": "0.4.28",
  "php": "8.3.6",
  "env": "prod"
}
GET /download/gladex PUBLIC

Downloads the latest gladex CLI binary (Linux amd64). Use curl -O or wget.

curl -O https://gladex.de/download/gladex
chmod +x gladex
./gladex --help

LAN-Only Endpoints

Restricted to private network IPs (127.0.0.0/8, 10.0.0.0/8, 192.168.0.0/16). Returns 403 from public IPs.

GET /investor LAN

Investor chat UI. Threaded message view with agent-investor communication. Supports CMD+Enter send, 6h time filter, dark theme.

GET /api/messages LAN

Returns all messages as JSON array, ordered by timestamp.

{
  "messages": [
    {
      "id": 1,
      "ts": "1726812345",
      "direction": "investor_to_agent",
      "body": "Hello from investor!",
      "read": 1
    }
  ]
}
POST /api/messages LAN

Send a message from investor to agent. Body must be JSON with body field. Also appends to INBOX.md for agent pickup.

curl -X POST http://localhost:8001/api/messages \
  -H "Content-Type: application/json" \
  -d '{"body": "Build the landing page"}'
POST /api/messages/:id/read LAN

Mark a specific message as read by ID.

GET /api/status LAN

Returns unread investor message count.

{ "unread_investor_messages": 0 }
GET /budget LAN

Budget dashboard UI. Shows monthly allowance, spending, allocations, and rules.

GET /api/budget LAN

Returns parsed budget data from BUDGET.md as structured JSON.

{
  "month": "2026-09",
  "allowance": 5.00,
  "spent": 1.50,
  "remaining": 3.50,
  "allocations": ["gladex.de (1.50 EUR/mo)"],
  "rules": "..."
}
GET /trust LAN

Trust Dashboard UI. Shows AI tool confidence scores with summary grid, score list, and record form.

GET /api/trust LAN

Returns trust scores from the Go CLI workspace database.

{
  "scores": [
    {
      "source": "copilot",
      "target": "project-x",
      "score": 0.85,
      "level": "HIGH",
      "updated_at": "2026-09-21T20:00:00Z"
    }
  ],
  "summary": { "total": 3, "high": 1, "medium": 1, "neutral": 0, "low": 1 }
}
POST /api/trust/record LAN

Record a trust outcome via the Go CLI. Body: {"source": "...", "target": "...", "outcome": "accepted|rejected|partial"}

GET /changelog LAN

Changelog page. Renders CHANGELOG.md with dark theme, version tags, and section labels.

CLI Commands (gladex)

Go CLI binary (v0.4.28). Download: curl -O https://gladex.de/download/gladex

Workspace

CommandDescription
gladex initInitialize a new workspace (creates .gladex/ directory with SQLite DB)
gladex statusShow workspace status (contexts, workflows, trust entries)
gladex doctorCheck workspace health and dependencies
gladex configShow/set configuration values
gladex version [--json]Show version info (optionally as JSON)

Context Management

CommandDescription
gladex context push <name> [files...]Store/update named contexts with file content + metadata
gladex context pull <name> [--raw]Retrieve stored contexts (header/footer or raw)
gladex context list [--format json]List all stored contexts
gladex context delete <name>Remove named contexts
gladex context export [--format json]Export all contexts
gladex context import <file>Import contexts from file
gladex context diff <name1> <name2>Compare two contexts

Workflow Engine

CommandDescription
gladex workflow create <name> --from <file>Create workflow from JSON definition
gladex workflow run <name> [--dry-run] [--allow-shell]Execute workflow steps. --allow-shell required for shell steps.
gladex workflow listList all workflows
gladex workflow show <name>Show workflow definition
gladex workflow delete <name>Delete a workflow
gladex workflow validate <file>Validate a workflow JSON file
gladex workflow runs <name>Show run history for a workflow

Workflow Templates

CommandDescription
gladex templates listList all bundled workflow templates (8 templates)
gladex templates show <name>Show template definition and install command
gladex templates install <name> [--as <workflow-name>]Install a template into workspace
gladex templates search <query>Search templates by keyword

Trust Scoring

CommandDescription
gladex trust record <source> <target> <outcome>Record AI suggestion outcome (accepted/rejected/partial)
gladex trust listList all trust scores
gladex trust get <source> <target>Get trust score for a specific pair
gladex trust confidenceShow confidence levels summary

HTTP API Server

CommandDescription
gladex serve [--port 8080]Start HTTP API server (10 endpoints)

MCP Server

CommandDescription
gladex mcp [--port 50052]Start MCP-compliant JSON-RPC 2.0 server (7 tools, schema validation, rate limiting)

Architecture

┌─────────────────────────────────────────────────┐
│                  DNS (PowerDNS API)               │
│  gladex.de ──→ 77.90.15.49 (VPS)                 │
│  dev / git / info / stats subdomains              │
└────────────────────┬────────────────────────────┘
                     │ WireGuard (10.2.3.0/24)
┌────────────────────▼────────────────────────────┐
│                 Apache (TLS)                      │
│  :80 → 301 HTTPS │ :443 → reverse proxy          │
│  Let's Encrypt cert (auto-renewal)               │
└──────┬──────────────────────────┬───────────────┘
       │                          │
  ┌────▼────┐              ┌──────▼──────┐
  │  :8000  │              │    :8001    │
  │  DEV    │              │    PROD     │
  │ PHP 8.3 │              │  PHP 8.3   │
  │ SQLite  │              │  SQLite    │
  └─────────┘              └────────────┘
       │                          │
  ┌────▼──────────────────────────▼──────┐
  │          Go CLI (gladex v0.4.28)       │
  │  Context · Workflow · Trust · MCP     │
  │  130+ unit tests                      │
  └──────────────────────────────────────┘

DNS Records

RecordIPTTLPurpose
gladex.de77.90.15.493600Landing page (public)
dev.gladex.de77.90.15.493600Dev environment (investor app)
git.gladex.de77.90.15.493600Git remote (git daemon :9418)
info.gladex.de77.90.15.493600Product info page (public)
stats.gladex.de77.90.15.493600Container statistics (LAN-only)

TLS Certificate

PropertyValue
IssuerLet's Encrypt
Domainsgladex.de, dev.gladex.de, git.gladex.de, info.gladex.de, stats.gladex.de
Expires2026-12-20
RenewalAutomatic via certbot timer + deploy hook
MethodHTTP-01 webroot challenge