# youngsunli/aca architecture

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

- Interactive diagram: https://gitdiagram.com/youngsunli/aca
- Repository: https://github.com/youngsunli/aca
- Video tour (about a minute): https://gitdiagram.com/youngsunli/aca/video

## Overview

aca is a CLI for operating Windows IIS sites and services on Alibaba Cloud ECS through Cloud Assistant. The primary workflow is to discover/configure targets, pre-check and deploy a package across servers, then inspect or roll back deployments; it also provides remote administration, diagnostics, and certificate management. The graph follows documented command capabilities and sampled TypeScript call sites. PowerShell scripts implement server-side actions, but their individual internals and some command wiring were not sampled.

Main entry points: [`src/cli.ts`](https://github.com/youngsunli/aca/blob/main/src/cli.ts) (aca CLI), [`src/ecs.ts`](https://github.com/youngsunli/aca/blob/main/src/ecs.ts) (ECS API), [`src/deploy.ts`](https://github.com/youngsunli/aca/blob/main/src/deploy.ts) (Deploy and check), [`src/rollback.ts`](https://github.com/youngsunli/aca/blob/main/src/rollback.ts) (Rollback)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["CLI and targets"]
  node_cli["aca CLI<br/>[cli.ts]"]
  node_config["Target config<br/>[config.ts]"]
  node_discovery["Discovery<br/>[discover.ts]"]
  node_skill["Agent skill<br/>[SKILL.md]"]
end

subgraph group_release["Release operations"]
  node_deployment["Deploy and check<br/>[deploy.ts]"]
  node_rollback["Rollback<br/>[rollback.ts]"]
  node_clb["Load balancing<br/>[clb.ts]"]
  node_server_scripts["Server scripts"]
end

subgraph group_operations["Remote operations"]
  node_overview["Status overview<br/>[overview.ts]"]
  node_diff["File comparison<br/>[diff.ts]"]
  node_logs["Log inspection<br/>[logs.ts]"]
  node_pull["Remote file transfer<br/>[pull.ts]"]
  node_powershell["PowerShell runner<br/>[ecs.ts]"]
end

subgraph group_certificates["Certificate management"]
  node_certs["Certificate operations<br/>[certs.ts]"]
  node_cloud_certs["Cloud certificates<br/>[cas.ts]"]
end

subgraph group_infrastructure["Cloud and internals"]
  node_ecs["ECS API<br/>[ecs.ts]"]
  node_oss["Package and transfer storage<br/>[oss.ts]"]
  node_leases["Target leases<br/>[lease.ts]"]
end

node_operator(("Operator"))
node_agent(("AI agent"))
node_aliyun{{"Alibaba Cloud"}}
node_oss_service[("OSS")]
node_windows["Windows servers"]

node_operator -->|"runs commands"| node_cli
node_agent -.->|"uses guidance"| node_skill
node_skill -.->|"invokes"| node_cli
node_cli -->|"loads"| node_config
node_cli -->|"dispatches"| node_discovery
node_discovery -->|"queries instances"| node_ecs
node_cli -->|"dispatches"| node_deployment
node_deployment -->|"resolves targets"| node_config
node_deployment -->|"acquires target lease"| node_leases
node_deployment -->|"uploads package"| node_oss
node_deployment -->|"renders scripts"| node_server_scripts
node_deployment -->|"runs checks and deploy"| node_ecs
node_deployment -->|"takes servers out"| node_clb
node_cli -->|"dispatches"| node_rollback
node_rollback -->|"resolves target"| node_config
node_rollback -->|"acquires target lease"| node_leases
node_rollback -->|"renders scripts"| node_server_scripts
node_rollback -->|"runs rollback"| node_ecs
node_rollback -->|"takes servers out"| node_clb
node_cli -->|"dispatches"| node_overview
node_overview -->|"queries server state"| node_ecs
node_cli -->|"dispatches"| node_diff
node_diff -->|"runs file listing"| node_ecs
node_diff -->|"transfers listing"| node_oss
node_cli -->|"dispatches"| node_logs
node_logs -->|"queries server logs"| node_ecs
node_cli -->|"dispatches"| node_pull
node_pull -->|"runs file transfer"| node_ecs
node_pull -->|"transfers file"| node_oss
node_cli -->|"dispatches run"| node_powershell
node_powershell -->|"submits commands"| node_ecs
node_cli -->|"dispatches"| node_certs
node_certs -.->|"uses cloud certificate source"| node_cloud_certs
node_certs -->|"renders scripts"| node_server_scripts
node_certs -->|"inspects and replaces"| node_ecs
node_certs -->|"transfers encrypted certificate"| node_oss
node_ecs -->|"calls ECS API"| node_aliyun
node_ecs -->|"executes via Cloud Assistant"| node_windows
node_cloud_certs -.->|"calls certificate API"| node_aliyun
node_oss -->|"reads and writes"| node_oss_service
node_leases -->|"stores lease records"| node_oss
node_clb -->|"updates CLB weights"| node_aliyun

click node_cli "https://github.com/youngsunli/aca/blob/main/src/cli.ts"
click node_config "https://github.com/youngsunli/aca/blob/main/src/config.ts"
click node_discovery "https://github.com/youngsunli/aca/blob/main/src/discover.ts"
click node_skill "https://github.com/youngsunli/aca/blob/main/.claude/skills/aca/SKILL.md"
click node_deployment "https://github.com/youngsunli/aca/blob/main/src/deploy.ts"
click node_rollback "https://github.com/youngsunli/aca/blob/main/src/rollback.ts"
click node_clb "https://github.com/youngsunli/aca/blob/main/src/clb.ts"
click node_server_scripts "https://github.com/youngsunli/aca/tree/main/ps"
click node_overview "https://github.com/youngsunli/aca/blob/main/src/overview.ts"
click node_diff "https://github.com/youngsunli/aca/blob/main/src/diff.ts"
click node_logs "https://github.com/youngsunli/aca/blob/main/src/logs.ts"
click node_pull "https://github.com/youngsunli/aca/blob/main/src/pull.ts"
click node_powershell "https://github.com/youngsunli/aca/blob/main/src/ecs.ts"
click node_certs "https://github.com/youngsunli/aca/blob/main/src/certs.ts"
click node_cloud_certs "https://github.com/youngsunli/aca/blob/main/src/cas.ts"
click node_ecs "https://github.com/youngsunli/aca/blob/main/src/ecs.ts"
click node_oss "https://github.com/youngsunli/aca/blob/main/src/oss.ts"
click node_leases "https://github.com/youngsunli/aca/blob/main/src/lease.ts"

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,node_config,node_discovery,node_skill toneBlue
class node_deployment,node_rollback,node_clb,node_server_scripts,node_oss_service toneAmber
class node_overview,node_diff,node_logs,node_pull,node_powershell,node_windows toneMint
class node_certs,node_cloud_certs toneRose
class node_ecs,node_oss,node_leases,node_operator,node_agent,node_aliyun toneIndigo
```

## Components

### CLI and targets

- [aca CLI](https://github.com/youngsunli/aca/blob/main/src/cli.ts): `src/cli.ts`
- [Target config](https://github.com/youngsunli/aca/blob/main/src/config.ts): `src/config.ts`
- [Discovery](https://github.com/youngsunli/aca/blob/main/src/discover.ts): `src/discover.ts`
- [Agent skill](https://github.com/youngsunli/aca/blob/main/.claude/skills/aca/SKILL.md): `.claude/skills/aca/SKILL.md`

### Release operations

- [Deploy and check](https://github.com/youngsunli/aca/blob/main/src/deploy.ts): `src/deploy.ts`
- [Rollback](https://github.com/youngsunli/aca/blob/main/src/rollback.ts): `src/rollback.ts`
- [Load balancing](https://github.com/youngsunli/aca/blob/main/src/clb.ts): `src/clb.ts`
- [Server scripts](https://github.com/youngsunli/aca/tree/main/ps): `ps`

### Remote operations

- [Status overview](https://github.com/youngsunli/aca/blob/main/src/overview.ts): `src/overview.ts`
- [File comparison](https://github.com/youngsunli/aca/blob/main/src/diff.ts): `src/diff.ts`
- [Log inspection](https://github.com/youngsunli/aca/blob/main/src/logs.ts): `src/logs.ts`
- [Remote file transfer](https://github.com/youngsunli/aca/blob/main/src/pull.ts): `src/pull.ts`
- [PowerShell runner](https://github.com/youngsunli/aca/blob/main/src/ecs.ts): `src/ecs.ts`

### Certificate management

- [Certificate operations](https://github.com/youngsunli/aca/blob/main/src/certs.ts): `src/certs.ts`
- [Cloud certificates](https://github.com/youngsunli/aca/blob/main/src/cas.ts): `src/cas.ts`

### Cloud and internals

- [ECS API](https://github.com/youngsunli/aca/blob/main/src/ecs.ts): `src/ecs.ts`
- [Package and transfer storage](https://github.com/youngsunli/aca/blob/main/src/oss.ts): `src/oss.ts`
- [Target leases](https://github.com/youngsunli/aca/blob/main/src/lease.ts): `src/lease.ts`

### Other components

- **Operator**
- **AI agent**
- **Alibaba Cloud**
- **OSS**
- **Windows servers**

## Connections

- Operator → aca CLI: runs commands
- AI agent → Agent skill: uses guidance
- Agent skill → aca CLI: invokes
- aca CLI → Target config: loads
- aca CLI → Discovery: dispatches
- Discovery → ECS API: queries instances
- aca CLI → Deploy and check: dispatches
- Deploy and check → Target config: resolves targets
- Deploy and check → Target leases: acquires target lease
- Deploy and check → Package and transfer storage: uploads package
- Deploy and check → Server scripts: renders scripts
- Deploy and check → ECS API: runs checks and deploy
- Deploy and check → Load balancing: takes servers out
- aca CLI → Rollback: dispatches
- Rollback → Target config: resolves target
- Rollback → Target leases: acquires target lease
- Rollback → Server scripts: renders scripts
- Rollback → ECS API: runs rollback
- Rollback → Load balancing: takes servers out
- aca CLI → Status overview: dispatches
- Status overview → ECS API: queries server state
- aca CLI → File comparison: dispatches
- File comparison → ECS API: runs file listing
- File comparison → Package and transfer storage: transfers listing
- aca CLI → Log inspection: dispatches
- Log inspection → ECS API: queries server logs
- aca CLI → Remote file transfer: dispatches
- Remote file transfer → ECS API: runs file transfer
- Remote file transfer → Package and transfer storage: transfers file
- aca CLI → PowerShell runner: dispatches run
- PowerShell runner → ECS API: submits commands
- aca CLI → Certificate operations: dispatches
- Certificate operations → Cloud certificates: uses cloud certificate source
- Certificate operations → Server scripts: renders scripts
- Certificate operations → ECS API: inspects and replaces
- Certificate operations → Package and transfer storage: transfers encrypted certificate
- ECS API → Alibaba Cloud: calls ECS API
- ECS API → Windows servers: executes via Cloud Assistant
- Cloud certificates → Alibaba Cloud: calls certificate API
- Package and transfer storage → OSS: reads and writes
- Target leases → Package and transfer storage: stores lease records
- Load balancing → Alibaba Cloud: updates CLB weights
