Metadata-Version: 2.5
Name: cloud-dock-cli
Version: 0.1.0
Summary: Interactive CloudDock configuration generator for future Terraform deployment workflows.
License-File: LICENSE
Requires-Python: >=3.12
Requires-Dist: pytest>=9.1.1
Requires-Dist: pyyaml>=6.0.0
Requires-Dist: ruff>=0.16.5
Requires-Dist: typer>=0.12.0
Description-Content-Type: text/markdown

# CloudDock

CloudDock is a lightweight configuration generator and orchestration helper for application deployment requirements. In Phase 1, it collects a deployment profile interactively and writes a YAML configuration file that can later be consumed by Terraform. In Phase 2, the `plan` command validates prerequisites, prepares a local Terraform checkout, and runs Terraform planning against the generated configuration.

## Phase 1 scope

This phase intentionally does not contact AWS or Terraform. It only provides a CLI workflow for:

- collecting deployment settings
- validating user input
- generating a structured YAML file (`clouddock.yaml`)
- preparing the configuration model for future Terraform conversion

The `deploy` command remains a placeholder and does not run infrastructure commands.

## Phase 2: plan command

The `clouddock plan` flow performs the following:

1. checks for Git, Terraform, and AWS CLI
2. verifies AWS CLI authentication/configuration with `aws sts get-caller-identity`
3. ensures `clouddock.yaml` exists in the current working directory
4. offers to run `clouddock init` if the configuration is missing
5. clones the Terraform repository into `~/.clouddock/terraform` when needed
6. copies the current `clouddock.yaml` into the Terraform working directory
7. runs `terraform init`
8. runs `terraform plan`

The Terraform repository used by CloudDock is:

https://github.com/DGclasher/cloud-dock

CloudDock does not install Git, Terraform, or AWS CLI automatically. The command expects those system tools to already be available on the machine.

## Prerequisites

- Python 3.12
- uv
- Git
- Terraform
- AWS CLI

## Installation

```bash
uv sync
```

## Running

```bash
uv run clouddock --help
uv run clouddock init
uv run clouddock plan
uv run clouddock deploy
```

## Local Terraform working directory

CloudDock uses a local working directory under the user home folder:

```text
~/.clouddock/terraform
```

This keeps the Terraform checkout separate from the Python project source tree.

## Example generated configuration

```yaml
application:
  name: payment-api
  image: 123456789.dkr.ecr.ap-south-1.amazonaws.com/payment-api:v1
  container_port: 8080

regions:
  - ap-south-1
  - ap-southeast-1

compute:
  type: ecs
  desired_count: 2
  cpu: 256
  memory: 512

database:
  enabled: true
  type: postgres

cache:
  enabled: true
  type: redis

environment_variables:
  SPRING_PROFILES_ACTIVE: production
  LOG_LEVEL: INFO
```

## Important notes

- Phase 2 checks prerequisites and runs Terraform planning; it does not run `terraform apply`.
- This phase does not bypass AWS authentication requirements.
- Environment variables are captured as plain configuration values for now; secret management will be added in a future phase.
- The CLI only generates configuration and orchestrates local Terraform planning; it does not provision infrastructure.
