Install StackGen CLI
This guide covers both installing and uninstalling the StackGen CLI on different operating systems.
Install
To install StackGen CLI, follow the appropriate method based on your operating system:
macOS
Click to view
Install Homebrew if not already installed by running:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Install StackGen:
brew install stackgenhq/stackgen/stackgen
Verify the Installation:
stackgen version
Updating StackGen CLI on macOS
Update StackGen CLI using:
brew upgrade stackgen
You can verify the updated version with:
stackgen version
Linux
Click to view
Follow these steps to install StackGen using Homebrew on your Linux system.
-
Install Git: Git is required for Homebrew and StackGen.
sudo yum install git -y
-
Install Homebrew: Homebrew is a package manager that simplifies software installation. Set up the environment path:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
-
Configure Homebrew for Your Shell: Add Homebrew to your shell’s environment variables. If you’re using a different shell like
zsh
orfish
, replace.bashrc
accordingly.echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"' >> ~/.bashrc
-
Apply the Changes: Reload your shell configuration so the new settings take effect.
source ~/.bashrc
-
Install StackGen: Now use Homebrew to install StackGen.
brew install stackgenhq/stackgen/stackgen
Update StackGen CLI on Linux
Update StackGen CLI using:
brew upgrade stackgen
You can verify the updated version with:
stackgen --version
Windows
Click to view
StackGen CLI can be used on Windows in two ways:
Option 1: Using Docker
StackGen CLI runs on Windows using Docker. To start a StackGen CLI container, use the following command:
docker run -it --rm -p 50525:50525 -v ~/.stackgen:/home/stackgen/.stackgen ghcr.io/stackgenhq/stackgen:latest
This command launches a temporary StackGen CLI container, switching the terminal prompt to the StackGen CLI environment where StackGen commands can be executed.
Updating StackGen CLI with Docker
If you're using the Docker-based CLI, pull the latest image:
docker pull ghcr.io/stackgenhq/stackgen:latest
Then run the CLI as usual:
docker run -it --rm -p 50525:50525 -v ~/.stackgen:/home/stackgen/.stackgen ghcr.io/stackgenhq/stackgen:latest
Option 2: Using Windows Subsystem for Linux (WSL)
Alternatively, users can install WSL and run the StackGen CLI using the Linux installation steps. This approach allows for a native Linux environment within Windows.
- Install WSL and a Linux distribution (e.g., Ubuntu) by following the WSL installation guide.
- Open WSL and follow the Linux installation steps above.
Updating StackGen CLI with WSL
If you're using WSL with Homebrew, follow the same upgrade command as Linux/macOS:
brew upgrade stackgen
You can verify the updated version with:
stackgen version
Install StackGen CLI Dependencies
Click to view
You will need to install the following before you provision or deploy your appStacks:
- terraform: Refer to the terraform documentation to install terraform.
- OpenTofu: Follow the steps to install OpenTofu.
Uninstall
Click to view
If you need to uninstall StackGen CLI from your system, follow the appropriate instructions for your operating system:
macOS
To uninstall StackGen CLI from macOS:
brew uninstall stackgen
Linux
To uninstall StackGen CLI from Linux:
brew uninstall stackgen
Windows
From Docker
If you've been using StackGen CLI with Docker, there's no formal uninstallation needed as each container is temporary.
To remove the Docker image:
docker rmi ghcr.io/stackgenhq/stackgen:latest
You can also remove any related Docker volumes if desired:
docker volume prune
From WSL
To uninstall StackGen CLI from Windows Subsystem for Linux:
- Open your WSL terminal
- Run the same uninstall command as Linux:
brew uninstall stackgen