Install Cloud-to-Code CLI on Windows
Install using .exe
file
If you have an executable file of the CLI, you need to set up its path in the system environment variables to use it directly from the terminal. Follow these steps to set up the CLI in Windows using the executable file:
- Extract your executable files and store them in a proper folder.
- Open Start and search for Edit the system environment variables.
- Go to Environment Variables.
- Under the User variables section, search for the PATH variable, and select it.
- Click Edit and select New.
- Copy and paste the folder path where the
.exe
is stored. - Restart your terminal and use the CLI directly.
Install using Docker
If you have Docker installed, you can use the CLI directly from the Docker container. Follow these steps to set up the CLI in Windows using Docker:
-
Open your terminal and run the following command to pull the latest version of the CLI image:
docker pull ghcr.io/stackgenhq/cloud2code
-
Once the image has been pulled, you can run the CLI using the following command:
docker run --platform linux/arm64 --rm `
-e AWS_ACCESS_KEY_ID="***************" ` // access key id
-e AWS_SECRET_ACCESS_KEY="***************" ` // secret access key
-e AWS_SESSION_TOKEN="***************" ` // enter an aws session token
-v C:\Users\abc\output:/output `
ghcr.io/stackgenhq/cloud2code import aws --region us-east-1 --include aws_s3_bucket --output-dir /outputReplace the asterisks in the above command with your own AWS credentials and the path where you want to save the output files. The
-v
flag is used to mount a volume from your local machine to the Docker container. -
This will start the CLI and run the command you specified. The output files will be saved in the directory you specified in the
-v
flag.