# spoonnewman/drone-cli architecture

> Architecture diagram of the GitHub repository spoonnewman/drone-cli, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/spoonnewman/drone-cli
- Repository: https://github.com/spoonnewman/drone-cli

## Overview

This is a small drone-control CLI backed by a Rust core library. The main workflow is a user command, handled by the CLI, delegated through the Drone facade and DroneApi abstraction to an HTTP Flight Bridge service; status responses are decoded into telemetry snapshots and displayed. The README is sparse, so the HTTP endpoints and capabilities are evidenced by sampled source. The transport abstraction and fake transport are present but are not wired into the sampled CLI workflow.

Main entry points: [`core/src/http_api.rs`](https://github.com/spoonnewman/drone-cli/blob/main/core/src/http_api.rs) (HTTP Client), [`core/src/drone.rs`](https://github.com/spoonnewman/drone-cli/blob/main/core/src/drone.rs) (Drone Facade), [`cli/src/main.rs`](https://github.com/spoonnewman/drone-cli/blob/main/cli/src/main.rs) (Command CLI), [`core/src/api.rs`](https://github.com/spoonnewman/drone-cli/blob/main/core/src/api.rs) (Drone API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["CLI"]
  node_cli_main["Command CLI<br/>[main.rs]"]
end

subgraph group_control["Control API"]
  node_drone["Drone Facade<br/>[drone.rs]"]
  node_api["Drone API<br/>[api.rs]"]
  node_http["HTTP Client<br/>[http_api.rs]"]
  node_transport["Transport Trait<br/>[transport.rs]"]
  node_fake_transport["Fake Transport<br/>[transport.rs]"]
end

subgraph group_telemetry["Telemetry"]
  node_snapshot["Telemetry Snapshot"]
end

node_user(("Operator"))
node_bridge["Flight Bridge"]

node_user -->|"runs command"| node_cli_main
node_cli_main -->|"invokes commands"| node_drone
node_drone -->|"delegates calls"| node_api
node_api -->|"implemented by"| node_http
node_http -->|"HTTP requests"| node_bridge
node_bridge -->|"status JSON"| node_http
node_http -->|"decodes status"| node_snapshot
node_drone -->|"returns status"| node_cli_main

click node_cli_main "https://github.com/spoonnewman/drone-cli/blob/main/cli/src/main.rs"
click node_drone "https://github.com/spoonnewman/drone-cli/blob/main/core/src/drone.rs"
click node_api "https://github.com/spoonnewman/drone-cli/blob/main/core/src/api.rs"
click node_http "https://github.com/spoonnewman/drone-cli/blob/main/core/src/http_api.rs"
click node_snapshot "https://github.com/spoonnewman/drone-cli/blob/main/core/src/dtos/responses/telemetry_snapshot.rs"
click node_transport "https://github.com/spoonnewman/drone-cli/blob/main/core/src/transport.rs"
click node_fake_transport "https://github.com/spoonnewman/drone-cli/blob/main/core/src/transport.rs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_cli_main toneBlue
class node_drone,node_api,node_http,node_transport,node_fake_transport toneAmber
class node_snapshot toneMint
class node_user,node_bridge toneIndigo
```

## Components

### CLI

- [Command CLI](https://github.com/spoonnewman/drone-cli/blob/main/cli/src/main.rs): `cli/src/main.rs`

### Control API

- [Drone Facade](https://github.com/spoonnewman/drone-cli/blob/main/core/src/drone.rs): `core/src/drone.rs`
- [Drone API](https://github.com/spoonnewman/drone-cli/blob/main/core/src/api.rs): `core/src/api.rs`
- [HTTP Client](https://github.com/spoonnewman/drone-cli/blob/main/core/src/http_api.rs): `core/src/http_api.rs`
- [Transport Trait](https://github.com/spoonnewman/drone-cli/blob/main/core/src/transport.rs): `core/src/transport.rs`
- [Fake Transport](https://github.com/spoonnewman/drone-cli/blob/main/core/src/transport.rs): `core/src/transport.rs`

### Telemetry

- [Telemetry Snapshot](https://github.com/spoonnewman/drone-cli/blob/main/core/src/dtos/responses/telemetry_snapshot.rs): `core/src/dtos/responses/telemetry_snapshot.rs`

### Other components

- **Operator**
- **Flight Bridge**

## Connections

- Operator → Command CLI: runs command
- Command CLI → Drone Facade: invokes commands
- Drone Facade → Drone API: delegates calls
- Drone API → HTTP Client: implemented by
- HTTP Client → Flight Bridge: HTTP requests
- Flight Bridge → HTTP Client: status JSON
- HTTP Client → Telemetry Snapshot: decodes status
- Drone Facade → Command CLI: returns status
