# ridecell/ridectl architecture

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

- Interactive diagram: https://gitdiagram.com/ridecell/ridectl
- Repository: https://github.com/ridecell/ridectl

## Overview

Ridectl is an employee-facing CLI for interacting with SummonPlatform and microservice environments. Users choose a command and target; Ridectl resolves the Kubernetes instance and performs an operation such as opening a shell, inspecting database access, restarting workloads, or editing encrypted secrets. The graph includes documented capabilities even where their implementation was not sampled; links for those features rely on README evidence. Source excerpts show shell execution, restart actions, and the secret-editing flow; unsampled internals are not inferred.

Main entry points: [`pkg/cmd/root.go`](https://github.com/ridecell/ridectl/blob/master/pkg/cmd/root.go) (Command root), [`pkg/cmd/edit/object.go`](https://github.com/ridecell/ridectl/blob/master/pkg/cmd/edit/object.go) (Secret objects), [`pkg/cmd/shell.go`](https://github.com/ridecell/ridectl/blob/master/pkg/cmd/shell.go) (Interactive shell), [`pkg/cmd/pyshell.go`](https://github.com/ridecell/ridectl/blob/master/pkg/cmd/pyshell.go) (Python shell)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["CLI and access"]
  node_entry["CLI entry<br/>[main.go]"]
  node_commands["Command root<br/>[root.go]"]
  node_access["Access and config<br/>[utils.go]"]
  node_exec["Command execution<br/>[exec.go]"]
end

subgraph group_workloads["Workload operations"]
  node_shell["Interactive shell<br/>[shell.go]"]
  node_pyshell["Python shell<br/>[pyshell.go]"]
  node_restart["Restart workloads<br/>[restart.go]"]
end

subgraph group_secrets["Secret management"]
  node_edit["Secret edit flow<br/>[edit.go]"]
  node_objects["Secret objects<br/>[object.go]"]
  node_secret_types["Secret API types"]
  node_encrypt["Encrypt secrets<br/>[encrypt.go]"]
  node_decrypt["Decrypt secrets<br/>[decrypt.go]"]
end

subgraph group_support["Status and database"]
  node_dbshell["Database shell<br/>[dbshell.go]"]
  node_password["Connection details<br/>[password.go]"]
  node_status["Instance status<br/>[status.go]"]
  node_postgresdump["Postgres dump<br/>[postgresdump.go]"]
  node_aws["AWS utilities<br/>[aws.go]"]
end

node_employee(("Employee"))
node_kube[("Kubernetes cluster")]
node_kms["AWS KMS"]
node_editor["Local editor"]
node_teleport["Teleport / tsh"]

node_employee -->|"runs"| node_entry
node_entry -->|"executes"| node_commands
node_commands -.->|"dispatches"| node_shell
node_commands -.->|"dispatches"| node_pyshell
node_commands -.->|"dispatches"| node_dbshell
node_commands -->|"dispatches"| node_password
node_commands -->|"dispatches"| node_restart
node_commands -.->|"dispatches"| node_edit
node_commands -.->|"dispatches"| node_encrypt
node_commands -.->|"dispatches"| node_decrypt
node_commands -.->|"dispatches"| node_status
node_commands -.->|"dispatches"| node_postgresdump
node_shell -->|"resolves target"| node_access
node_pyshell -->|"resolves target"| node_access
node_shell -->|"lists pods"| node_kube
node_pyshell -->|"lists pods"| node_kube
node_shell -->|"runs kubectl"| node_exec
node_pyshell -->|"runs kubectl"| node_exec
node_restart -->|"deletes workloads"| node_kube
node_dbshell -->|"reads credentials"| node_kube
node_dbshell -->|"runs database commands"| node_exec
node_dbshell -->|"connects database"| node_teleport
node_status -->|"fetches status"| node_kube
node_postgresdump -.->|"queries backup jobs"| node_kube
node_edit -->|"parses and correlates"| node_objects
node_edit -->|"opens tempfile"| node_editor
node_objects -->|"uses API types"| node_secret_types
node_objects -->|"encrypts and decrypts"| node_kms
node_encrypt -->|"uses secret editing"| node_objects
node_decrypt -->|"uses secret editing"| node_objects
node_aws -.->|"uses AWS KMS"| node_kms
node_access -->|"checks login"| node_teleport

click node_entry "https://github.com/ridecell/ridectl/blob/master/cmd/ridectl/main.go"
click node_commands "https://github.com/ridecell/ridectl/blob/master/pkg/cmd/root.go"
click node_access "https://github.com/ridecell/ridectl/blob/master/pkg/utils/utils.go"
click node_exec "https://github.com/ridecell/ridectl/blob/master/pkg/exec/exec.go"
click node_shell "https://github.com/ridecell/ridectl/blob/master/pkg/cmd/shell.go"
click node_pyshell "https://github.com/ridecell/ridectl/blob/master/pkg/cmd/pyshell.go"
click node_restart "https://github.com/ridecell/ridectl/blob/master/pkg/cmd/restart.go"
click node_dbshell "https://github.com/ridecell/ridectl/blob/master/pkg/cmd/dbshell.go"
click node_password "https://github.com/ridecell/ridectl/blob/master/pkg/cmd/password.go"
click node_status "https://github.com/ridecell/ridectl/blob/master/pkg/cmd/status.go"
click node_postgresdump "https://github.com/ridecell/ridectl/blob/master/pkg/cmd/postgresdump.go"
click node_edit "https://github.com/ridecell/ridectl/blob/master/pkg/cmd/edit.go"
click node_objects "https://github.com/ridecell/ridectl/blob/master/pkg/cmd/edit/object.go"
click node_secret_types "https://github.com/ridecell/ridectl/blob/master/pkg/apis/secrets/v1beta2/decryptedsecret_types.go"
click node_encrypt "https://github.com/ridecell/ridectl/blob/master/pkg/cmd/encrypt.go"
click node_decrypt "https://github.com/ridecell/ridectl/blob/master/pkg/cmd/decrypt.go"
click node_aws "https://github.com/ridecell/ridectl/blob/master/pkg/cmd/aws.go"

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_entry,node_commands,node_access,node_exec toneBlue
class node_shell,node_pyshell,node_restart,node_kube toneAmber
class node_edit,node_objects,node_secret_types,node_encrypt,node_decrypt toneMint
class node_dbshell,node_password,node_status,node_postgresdump,node_aws toneRose
class node_employee,node_kms,node_editor,node_teleport toneIndigo
```

## Components

### CLI and access

- [CLI entry](https://github.com/ridecell/ridectl/blob/master/cmd/ridectl/main.go): `cmd/ridectl/main.go`
- [Command root](https://github.com/ridecell/ridectl/blob/master/pkg/cmd/root.go): `pkg/cmd/root.go`
- [Access and config](https://github.com/ridecell/ridectl/blob/master/pkg/utils/utils.go): `pkg/utils/utils.go`
- [Command execution](https://github.com/ridecell/ridectl/blob/master/pkg/exec/exec.go): `pkg/exec/exec.go`

### Workload operations

- [Interactive shell](https://github.com/ridecell/ridectl/blob/master/pkg/cmd/shell.go): `pkg/cmd/shell.go`
- [Python shell](https://github.com/ridecell/ridectl/blob/master/pkg/cmd/pyshell.go): `pkg/cmd/pyshell.go`
- [Restart workloads](https://github.com/ridecell/ridectl/blob/master/pkg/cmd/restart.go): `pkg/cmd/restart.go`

### Secret management

- [Secret edit flow](https://github.com/ridecell/ridectl/blob/master/pkg/cmd/edit.go): `pkg/cmd/edit.go`
- [Secret objects](https://github.com/ridecell/ridectl/blob/master/pkg/cmd/edit/object.go): `pkg/cmd/edit/object.go`
- [Secret API types](https://github.com/ridecell/ridectl/blob/master/pkg/apis/secrets/v1beta2/decryptedsecret_types.go): `pkg/apis/secrets/v1beta2/decryptedsecret_types.go`
- [Encrypt secrets](https://github.com/ridecell/ridectl/blob/master/pkg/cmd/encrypt.go): `pkg/cmd/encrypt.go`
- [Decrypt secrets](https://github.com/ridecell/ridectl/blob/master/pkg/cmd/decrypt.go): `pkg/cmd/decrypt.go`

### Status and database

- [Database shell](https://github.com/ridecell/ridectl/blob/master/pkg/cmd/dbshell.go): `pkg/cmd/dbshell.go`
- [Connection details](https://github.com/ridecell/ridectl/blob/master/pkg/cmd/password.go): `pkg/cmd/password.go`
- [Instance status](https://github.com/ridecell/ridectl/blob/master/pkg/cmd/status.go): `pkg/cmd/status.go`
- [Postgres dump](https://github.com/ridecell/ridectl/blob/master/pkg/cmd/postgresdump.go): `pkg/cmd/postgresdump.go`
- [AWS utilities](https://github.com/ridecell/ridectl/blob/master/pkg/cmd/aws.go): `pkg/cmd/aws.go`

### Other components

- **Employee**
- **Kubernetes cluster**
- **AWS KMS**
- **Local editor**
- **Teleport / tsh**

## Connections

- Employee → CLI entry: runs (evidence: `README.md`)
- CLI entry → Command root: executes (evidence: `cmd/ridectl/main.go`)
- Command root → Interactive shell: dispatches
- Command root → Python shell: dispatches
- Command root → Database shell: dispatches
- Command root → Connection details: dispatches (evidence: `README.md`)
- Command root → Restart workloads: dispatches (evidence: `README.md`)
- Command root → Secret edit flow: dispatches
- Command root → Encrypt secrets: dispatches
- Command root → Decrypt secrets: dispatches
- Command root → Instance status: dispatches
- Command root → Postgres dump: dispatches
- Interactive shell → Access and config: resolves target (evidence: `pkg/cmd/shell.go`)
- Python shell → Access and config: resolves target (evidence: `pkg/cmd/pyshell.go`)
- Interactive shell → Kubernetes cluster: lists pods (evidence: `pkg/cmd/shell.go`)
- Python shell → Kubernetes cluster: lists pods (evidence: `pkg/cmd/pyshell.go`)
- Interactive shell → Command execution: runs kubectl (evidence: `pkg/cmd/shell.go`)
- Python shell → Command execution: runs kubectl (evidence: `pkg/cmd/pyshell.go`)
- Restart workloads → Kubernetes cluster: deletes workloads (evidence: `pkg/cmd/restart.go`)
- Database shell → Kubernetes cluster: reads credentials (evidence: `pkg/cmd/dbshell.go`)
- Database shell → Command execution: runs database commands (evidence: `pkg/cmd/dbshell.go`)
- Database shell → Teleport / tsh: connects database (evidence: `pkg/cmd/dbshell.go`)
- Instance status → Kubernetes cluster: fetches status (evidence: `pkg/cmd/status.go`)
- Postgres dump → Kubernetes cluster: queries backup jobs
- Secret edit flow → Secret objects: parses and correlates (evidence: `pkg/cmd/edit.go`)
- Secret edit flow → Local editor: opens tempfile (evidence: `pkg/cmd/edit.go`)
- Secret objects → Secret API types: uses API types (evidence: `pkg/cmd/edit/object.go`)
- Secret objects → AWS KMS: encrypts and decrypts (evidence: `pkg/cmd/edit/object.go`)
- Encrypt secrets → Secret objects: uses secret editing (evidence: `pkg/cmd/encrypt.go`)
- Decrypt secrets → Secret objects: uses secret editing (evidence: `pkg/cmd/decrypt.go`)
- AWS utilities → AWS KMS: uses AWS KMS
- Access and config → Teleport / tsh: checks login (evidence: `pkg/utils/utils.go`)
