# acquia/cli architecture

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

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

## Overview

Acquia CLI is a Symfony-based command-line client for Acquia Cloud Platform. A user invokes a command, which may resolve Cloud or ACSF API clients and perform a platform operation; the database-push example also stages a local dump, transfers it, and imports it remotely. The tree shows broad command families for IDEs, environments, applications, authentication, SSH, and Code Studio. README documents Drush and log-tail support. Several command families were not sampled, so their internal call paths are not asserted.

Main entry points: [`src/CloudApi/ClientService.php`](https://github.com/acquia/cli/blob/main/src/CloudApi/ClientService.php) (Cloud API client service), [`src/Command/CommandBase.php`](https://github.com/acquia/cli/blob/main/src/Command/CommandBase.php) (Command base), [`src/Command/Push/PushDatabaseCommand.php`](https://github.com/acquia/cli/blob/main/src/Command/Push/PushDatabaseCommand.php) (Push database), [`src/Command/Pull/PullCommandBase.php`](https://github.com/acquia/cli/blob/main/src/Command/Pull/PullCommandBase.php) (Pull workflows)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["CLI runtime"]
  node_application["Console application<br/>[Application.php]"]
  node_base["Command base<br/>[CommandBase.php]"]
  node_auth["Authentication commands"]
  node_datastore[("Configuration datastore<br/>[Datastore.php]")]
end

subgraph group_platform["Platform access"]
  node_cloudservice["Cloud API client service<br/>[ClientService.php]"]
  node_cloudfactory["Cloud connector factory"]
  node_acsfservice["ACSF client service"]
  node_acsfclient["ACSF response client<br/>[AcsfClient.php]"]
end

subgraph group_operations["Cloud operations"]
  node_envcommands["Environment commands"]
  node_pull["Pull workflows"]
  node_pull_database["Pull database"]
  node_push_database["Push database"]
  node_machine["Local process helper"]
  node_ssh["SSH helper<br/>[SshHelper.php]"]
  node_transformer["Environment transformer"]
end

subgraph group_developer["Developer workflows"]
  node_ide["Cloud IDE commands"]
  node_app_commands["Application commands"]
  node_codestudio["Code Studio workflows"]
  node_remote["Remote command tools"]
  node_archive["Archive export"]
end

node_user(("CLI user"))
node_cloud{{"Acquia Cloud API"}}

node_user -->|"invokes"| node_application
node_application -.->|"dispatches commands"| node_base
node_user -->|"authenticates"| node_auth
node_base -->|"uses API client"| node_cloudservice
node_base -->|"uses ACSF client"| node_acsfservice
node_cloudservice -->|"creates connector"| node_cloudfactory
node_cloudservice -.->|"sends API requests"| node_cloud
node_acsfservice -->|"creates client"| node_acsfclient
node_user -->|"manages environments"| node_envcommands
node_user -->|"pulls site data"| node_pull
node_pull_database -->|"delegates"| node_pull
node_pull -->|"queries platform"| node_cloudservice
node_user -->|"pushes database"| node_push_database
node_push_database -->|"gets environment data"| node_cloudservice
node_push_database -->|"creates local dump"| node_machine
node_push_database -->|"imports remotely"| node_ssh
node_user -->|"manages IDEs"| node_ide
node_user -->|"manages applications"| node_app_commands
node_user -.->|"runs CI migration"| node_codestudio
node_user -->|"runs remote commands"| node_remote
node_user -.->|"exports archive"| node_archive
node_pull -->|"transforms environments"| node_transformer
node_base -->|"uses datastore"| node_datastore

click node_application "https://github.com/acquia/cli/blob/main/src/Application.php"
click node_base "https://github.com/acquia/cli/blob/main/src/Command/CommandBase.php"
click node_auth "https://github.com/acquia/cli/tree/main/src/Command/Auth"
click node_cloudservice "https://github.com/acquia/cli/blob/main/src/CloudApi/ClientService.php"
click node_cloudfactory "https://github.com/acquia/cli/blob/main/src/CloudApi/ConnectorFactory.php"
click node_acsfservice "https://github.com/acquia/cli/blob/main/src/AcsfApi/AcsfClientService.php"
click node_acsfclient "https://github.com/acquia/cli/blob/main/src/AcsfApi/AcsfClient.php"
click node_envcommands "https://github.com/acquia/cli/tree/main/src/Command/Env"
click node_pull "https://github.com/acquia/cli/blob/main/src/Command/Pull/PullCommandBase.php"
click node_pull_database "https://github.com/acquia/cli/blob/main/src/Command/Pull/PullDatabaseCommand.php"
click node_push_database "https://github.com/acquia/cli/blob/main/src/Command/Push/PushDatabaseCommand.php"
click node_machine "https://github.com/acquia/cli/blob/main/src/Helpers/LocalMachineHelper.php"
click node_ssh "https://github.com/acquia/cli/blob/main/src/Helpers/SshHelper.php"
click node_transformer "https://github.com/acquia/cli/blob/main/src/Transformer/EnvironmentTransformer.php"
click node_ide "https://github.com/acquia/cli/tree/main/src/Command/Ide"
click node_app_commands "https://github.com/acquia/cli/tree/main/src/Command/App"
click node_codestudio "https://github.com/acquia/cli/tree/main/src/Command/CodeStudio"
click node_remote "https://github.com/acquia/cli/tree/main/src/Command/Remote"
click node_archive "https://github.com/acquia/cli/blob/main/src/Command/Archive/ArchiveExportCommand.php"
click node_datastore "https://github.com/acquia/cli/blob/main/src/DataStore/Datastore.php"

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_application,node_base,node_auth,node_datastore,node_user toneBlue
class node_cloudservice,node_cloudfactory,node_acsfservice,node_acsfclient toneAmber
class node_envcommands,node_pull,node_pull_database,node_push_database,node_machine,node_ssh,node_transformer,node_cloud toneMint
class node_ide,node_app_commands,node_codestudio,node_remote,node_archive toneRose
```

## Components

### CLI runtime

- [Console application](https://github.com/acquia/cli/blob/main/src/Application.php): `src/Application.php`
- [Command base](https://github.com/acquia/cli/blob/main/src/Command/CommandBase.php): `src/Command/CommandBase.php`
- [Authentication commands](https://github.com/acquia/cli/tree/main/src/Command/Auth): `src/Command/Auth`
- [Configuration datastore](https://github.com/acquia/cli/blob/main/src/DataStore/Datastore.php): `src/DataStore/Datastore.php`

### Platform access

- [Cloud API client service](https://github.com/acquia/cli/blob/main/src/CloudApi/ClientService.php): `src/CloudApi/ClientService.php`
- [Cloud connector factory](https://github.com/acquia/cli/blob/main/src/CloudApi/ConnectorFactory.php): `src/CloudApi/ConnectorFactory.php`
- [ACSF client service](https://github.com/acquia/cli/blob/main/src/AcsfApi/AcsfClientService.php): `src/AcsfApi/AcsfClientService.php`
- [ACSF response client](https://github.com/acquia/cli/blob/main/src/AcsfApi/AcsfClient.php): `src/AcsfApi/AcsfClient.php`

### Cloud operations

- [Environment commands](https://github.com/acquia/cli/tree/main/src/Command/Env): `src/Command/Env`
- [Pull workflows](https://github.com/acquia/cli/blob/main/src/Command/Pull/PullCommandBase.php): `src/Command/Pull/PullCommandBase.php`
- [Pull database](https://github.com/acquia/cli/blob/main/src/Command/Pull/PullDatabaseCommand.php): `src/Command/Pull/PullDatabaseCommand.php`
- [Push database](https://github.com/acquia/cli/blob/main/src/Command/Push/PushDatabaseCommand.php): `src/Command/Push/PushDatabaseCommand.php`
- [Local process helper](https://github.com/acquia/cli/blob/main/src/Helpers/LocalMachineHelper.php): `src/Helpers/LocalMachineHelper.php`
- [SSH helper](https://github.com/acquia/cli/blob/main/src/Helpers/SshHelper.php): `src/Helpers/SshHelper.php`
- [Environment transformer](https://github.com/acquia/cli/blob/main/src/Transformer/EnvironmentTransformer.php): `src/Transformer/EnvironmentTransformer.php`

### Developer workflows

- [Cloud IDE commands](https://github.com/acquia/cli/tree/main/src/Command/Ide): `src/Command/Ide`
- [Application commands](https://github.com/acquia/cli/tree/main/src/Command/App): `src/Command/App`
- [Code Studio workflows](https://github.com/acquia/cli/tree/main/src/Command/CodeStudio): `src/Command/CodeStudio`
- [Remote command tools](https://github.com/acquia/cli/tree/main/src/Command/Remote): `src/Command/Remote`
- [Archive export](https://github.com/acquia/cli/blob/main/src/Command/Archive/ArchiveExportCommand.php): `src/Command/Archive/ArchiveExportCommand.php`

### Other components

- **CLI user**
- **Acquia Cloud API**

## Connections

- CLI user → Console application: invokes (evidence: `README.md`)
- Console application → Command base: dispatches commands (evidence: `src/Command/CommandBase.php`)
- CLI user → Authentication commands: authenticates (evidence: `README.md`)
- Command base → Cloud API client service: uses API client (evidence: `src/Command/CommandBase.php`)
- Command base → ACSF client service: uses ACSF client (evidence: `src/Command/CommandBase.php`)
- Cloud API client service → Cloud connector factory: creates connector (evidence: `src/CloudApi/ClientService.php`)
- Cloud API client service → Acquia Cloud API: sends API requests
- ACSF client service → ACSF response client: creates client (evidence: `src/AcsfApi/AcsfClientService.php`)
- CLI user → Environment commands: manages environments (evidence: `README.md`)
- CLI user → Pull workflows: pulls site data (evidence: `README.md`)
- Pull database → Pull workflows: delegates (evidence: `src/Command/Pull/PullDatabaseCommand.php`)
- Pull workflows → Cloud API client service: queries platform (evidence: `src/Command/Pull/PullCommandBase.php`)
- CLI user → Push database: pushes database (evidence: `src/Command/Push/PushDatabaseCommand.php`)
- Push database → Cloud API client service: gets environment data (evidence: `src/Command/Push/PushDatabaseCommand.php`)
- Push database → Local process helper: creates local dump (evidence: `src/Command/Push/PushDatabaseCommand.php`)
- Push database → SSH helper: imports remotely (evidence: `src/Command/Push/PushDatabaseCommand.php`)
- CLI user → Cloud IDE commands: manages IDEs (evidence: `README.md`)
- CLI user → Application commands: manages applications (evidence: `README.md`)
- CLI user → Code Studio workflows: runs CI migration
- CLI user → Remote command tools: runs remote commands (evidence: `README.md`)
- CLI user → Archive export: exports archive
- Pull workflows → Environment transformer: transforms environments (evidence: `src/Command/Pull/PullCommandBase.php`)
- Command base → Configuration datastore: uses datastore (evidence: `src/Command/CommandBase.php`)
