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

Usage

Command Groups

StackGen CLI commands are grouped by purpose, such as Infrastructure Lifecycle Management, appStack Management, etc.

We've listed the grouping below:

ILM Commands

CommandDescription
destroyTeardown your infrastructure
driftDetect and manage infrastructure drift
provisionProvisions your appStack

appStack Management Commands

CommandDescription
appStackManage appStacks for complex codegen
generateGenerates IaC files and export desired directory
importImport infrastructure to StackGen

Other Commands

CommandDescription
configureConfigures the stackgen cli
projectRetrieve/Manage projects within StackGen
resourceResource management commands
runExecute any tofu or terraform command
uploadUpload or manage different policies and rules

Additional Commands

CommandDescription
completionGenerate the autocompletion script for the specified shell
helpHelp about any command
versionPrints the version of the stackgen cli

Quick Commands

Click to view

Help on Usage

stackgen help

Enter the CLI Container

docker run -it --rm -p 50525:50525 -v ~/.appcd:/app/.appcd ghcr.io/appcd-dev/appcd-dist/stackgen-cli:latest
note

This will switch the terminal prompt to the StackGen CLI container where StackGen can be run.

Login or Configure Authentication:

stackgen configure
note

This will present you with a clickable link to copy and paste into your browser on your main machine to complete login.

Connect to a Repository

export APPCD_GIT_AUTH_TOKEN={token with readonly access to desired repositories}

Exporting a valid token allows stackgen appStack create to display your available repositories and branches for easier selection.

Create an appStack

stackgen appstack create

Create appStack Version

stackgen appstack create-version <name of appStack> --local-analysis

List appStacks

stackgen appstack show

Download or Generate IaC Files for an appStack

stackgen appstack download-iac --uuid <uuid of appStack output in prior step> --destination <path/to/file.zip>
note

By default, the docker run command above creates a volume in /app/.stackgen in the container, so any files written there will be synced to ~/.stackgen on the host machine.