Architecture

How decli is structured so Mac desk excellence comes first, and the platform grows without losing the plot.

Wedge

Instant value = Mac-only desk backup & restore that is great. Platform APIs, agents, and integrations expand the ecosystem after that trust is earned.

System map

┌─────────────────────────────────────────────────────────────┐
│  Humans                                                      │
│  MacBook / mini / iPad  ·  Workspace sign-in  ·  1Password   │
└───────────────┬─────────────────────────────┬───────────────┘
                │ CLI / menu bar              │ Web console
                ▼                             ▼
┌──────────────────────────┐    ┌──────────────────────────────┐
│  decli CLI (Typer)       │    │  Next.js web (43100)         │
│  desk · google · ai · …  │◄──►│  Settings · Integrations     │
└───────────┬──────────────┘    │  docs.decli.dev              │
            │                   └──────────────┬───────────────┘
            │ bridge 43105                     │ BFF / rewrites
            ▼                                  ▼
┌──────────────────────────┐    ┌──────────────────────────────┐
│  FastAPI apps/api 43101  │    │  Google Cloud (project decli)│
│  REST · GraphQL · OAuth  │    │  Auth · Drive · Maps · AQI   │
└───────────┬──────────────┘    │  Agents · Observability ·    │
            │                   │  IAM · Storage · Telemetry   │
            ▼                   └──────────────────────────────┘
┌──────────────────────────┐
│  Local desk              │
│  Caddy · Postgres@15     │
│  iTerm · ~/dev · uv/pnpm │
└──────────────────────────┘

Layers

  1. Desk (local) — Caddy one-instance, Homebrew Postgres, iTerm, repos. Pack/recover is the product.
  2. CLI — Natural language + typed commands; writes session environment.
  3. Bridge — Local API for menu bar and web permission grants.
  4. Web platform — Auth, settings, integrations hub, docs, playground.
  5. Google product APIs — Workspace, Drive, Docs suite, Maps, Air Quality.
  6. Google platform APIs — Agents, App Hub/Topology/Lifecycle, observability, IAM/IAP/SCC, storage, telemetry, model armor — operate and improve the system.

Data flows

Pack

Components → snapshot under ~/.decli/backups/desk/ → encrypt → destination (iCloud / AWS / GCS / Drive / S3-compatible / Tailscale peer).

Recover

Decrypt → bootstrap phases → restore components → deps install → soft Docker → AI key pull → doctor.

Session meta

Active device + optional browser geo → Air Quality → ~/.decli/session/environment.json and Magenta properties on web.

Settings vs integrations

See overview: settings = behavior; integrations = connections. New capabilities should register a capability id, connection health, CLI mirror, and docs page.

Recursive improvement

  1. Use desk pack/recover daily
  2. Emit telemetry (Magenta + GCP Logging/Monitoring/Trace)
  3. Agents and notebooks consume signals
  4. Playbook defaults and doctor checks get better
  5. Repeat

Related guides