# SwitchCase Infrastructure CLI setup

The downloadable CLI edition uses neutral Lucide icons for AWS resources and bundled architecture icons for Azure. AWS service names, resource mapping and all export formats are preserved. Some documentation screenshots show the source-build artwork rather than this edition.

Version 1.0.0. Generate AWS/Azure diagrams and documentation from Pulumi or Terraform/OpenTofu files.

## Requirements

- Node.js 22 or newer and npm (check `node --version` and `npm --version`). Use a supported Node.js LTS release from https://nodejs.org/.
- Windows, macOS, or Linux. Installation requires internet access to download production dependencies from npm. Native dependencies must support your OS and CPU architecture.
- No cloud account, Pulumi CLI, Terraform CLI, Python, or .NET SDK is required for the bundled static examples. Pulumi stack acquisition or explicitly requested preview execution requires Pulumi CLI and the relevant backend/cloud authentication. Never share credentials or commit exported secrets.

## Install the downloaded package

Open a terminal in the directory containing `iac-diagrams-1.0.0.tgz`:

```sh
mkdir switchcase-infrastructure
cd switchcase-infrastructure
npm init -y
npm install ../iac-diagrams-1.0.0.tgz
node node_modules/iac-diagrams/dist/cli.js --version
node node_modules/iac-diagrams/dist/cli.js --help
```

The same commands work in PowerShell. If PowerShell blocks the npm script wrapper, use `npm.cmd` instead of `npm`. Do not change your system execution policy. Installation uses the downloaded archive, not an assumed public npm release.

## Run the bundled AWS demo

From the installation directory:

```sh
node node_modules/iac-diagrams/dist/cli.js node_modules/iac-diagrams/examples/aws-stack.json --no-config --use-template review --output-dir output/aws-demo
```

Open `output/aws-demo/infrastructure.svg` in a browser, `infrastructure.pdf` in a PDF viewer, `infrastructure.md` in a Markdown viewer, or `infrastructure.drawio` in diagrams.net. The example also generates PNG and JSON outputs.

For Azure, replace the input with `node_modules/iac-diagrams/examples/azure-stack.json` and the output directory with `output/azure-demo`.

## Generate from your own project

```sh
node node_modules/iac-diagrams/dist/cli.js "/path/to/your/project" --no-config --use-template network --output-dir output/my-project
```

Quote paths containing spaces. On Windows, use a path such as `"C:\projects\my-infrastructure"`. Inputs can be a project directory, Pulumi source/stack export, Terraform HCL, or state/plan JSON. Static parsing does not execute your infrastructure. Preview execution is opt-in; review its permissions and effects before enabling it.

List available templates with `--list-templates`. See the bundled README.md and docs/ for configuration, profiles, diagnostics, supported input formats, and export options. Generated diagrams can contain infrastructure names, addresses, and other private details: review before sharing.

## Windows desktop alternative

A separate Windows portable build, `SwitchCase Infrastructure 1.0.0.exe`, includes its own runtime and does not need Node.js/npm. It is not included in this CLI archive, and these instructions do not indicate that a public desktop download is available. The Windows executable is currently unsigned. Verify the download source and published SHA-256 before deciding whether to run it; do not disable security protection to bypass a warning. macOS and Linux desktop binaries are not included in this download.

## Troubleshooting and removal

- Node version error: install Node.js 22+ and reopen the terminal.
- Native module/install error: check your OS/CPU support and retry with a supported Node.js LTS release. Keep npm's optional dependencies enabled.
- No resources: check the input format and generated diagnostics; start with the bundled demo to verify the install.
- Access denied: choose an output folder you can write to.
- Remove the local dependency with `npm uninstall iac-diagrams`. Keep or delete generated diagrams separately as needed.

The CLI archive contains production JavaScript, documentation, examples, schemas, fonts/icons and license notices. It does not contain your cloud credentials or local project data. MIT license; bundled assets retain their separate notices.
