Skip to main content
⏳ Estimated read time: 3 min read

Install and Uninstall

This guide covers both installing and uninstalling the StackGen CLI on different operating systems:

Installation

To install StackGen CLI, follow the appropriate method based on your operating system:

macOS Installation

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 Installation

Install Homebrew if not already installed by running:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Set up the environment path:

echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"' >> ~/.bashrc      # change .bashrc as per your current shell
source ~/.bashrc

Install StackGen:

brew install stackgenhq/stackgen/stackgen

Verify the Installation:

stackgen version

Updating StackGen CLI on Linux

Update StackGen CLI using:

brew upgrade stackgen

You can verify the updated version with:

stackgen version

Windows Installation

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
note

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.

  1. Install WSL and a Linux distribution (e.g., Ubuntu) by following the WSL installation guide.
  2. 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

Uninstallation

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:

  1. Open your WSL terminal
  2. Run the same uninstall command as Linux:
brew uninstall stackgen