create
The stackgen appstack create command creates a new appStack. Set STACKGEN_GIT_AUTH_TOKEN to a Git token with read access to the repos you want the CLI to scan.
Usage
stackgen appstack create [flags]
Flags (command)
These flags are the ones exposed on stackgen appstack create for current CLI builds.
| Flag | Description |
|---|---|
--appstack-name string | AppStack name. |
--cloud-provider string | aws, gcp, azure, civo (default aws). |
--iac-compute string | aws-ecs, aks-tf, k8s, aws-lambda, gke-tf, gcp-func, openshift, civo (default aws-ecs). |
--skip-policies | Skip default compliance policies. |
-h, --help | Help for create. |
Global flags (with this command)
You can combine stackgen appstack create with the usual globals, for example -i / --interactive, --log, -o / --output, --project, --stackgen-home. See Global CLI flags. Use STACKGEN_PROJECT for the default project when you do not pass --project.
Long help text may mention --local-analysis. If the binary returns unknown flag: --local-analysis, use -i / --interactive instead.
Environment variables
| Variable | Description |
|---|---|
STACKGEN_GIT_AUTH_TOKEN | Git token with read access to repositories for scanning appStacks |
Copy-paste CLI examples
Every block below uses only the command flags in the Flags (command) table plus global flags from Global CLI flags.
Minimal (AWS, default compute target)
stackgen appstack create \
--appstack-name my-app \
--cloud-provider aws \
--iac-compute aws-ecs
Skip default compliance policies
stackgen appstack create \
--appstack-name my-app \
--cloud-provider aws \
--iac-compute aws-ecs \
--skip-policies
Interactive (prompts for the rest)
stackgen appstack create -i
Same as stackgen appstack create --interactive.
With a project (global)
stackgen appstack create \
--appstack-name my-app \
--cloud-provider aws \
--iac-compute aws-ecs \
--project my-project-id
JSON command output (global)
stackgen appstack create \
--appstack-name my-app \
--cloud-provider aws \
--iac-compute aws-ecs \
--output json
Debug logging (global)
stackgen appstack create \
--appstack-name my-app \
--cloud-provider aws \
--iac-compute aws-ecs \
--log 2
Git token in the environment, then create on GCP
export STACKGEN_GIT_AUTH_TOKEN=ghp_your_token_here
stackgen appstack create \
--appstack-name my-microservices \
--cloud-provider gcp \
--iac-compute gke-tf
Another name, same allowed flags (AWS)
stackgen appstack create \
--appstack-name my-local-app \
--cloud-provider aws \
--iac-compute aws-ecs
Component JSON (product shapes, not CLI flags)
None of the JSON in this section is passed as arguments to stackgen appstack create today. There is no --component or --scan-strategy on that command. The blocks show how components are often represented inside StackGen (UI, API, or interactive flows). Use stackgen appstack create -i when you need to supply repo or path details step by step.
Local component (shape)
{
"name": "component",
"source": {
"refType": "local",
"localPath": "/test-user/python-local-repo"
},
"language": "PYTHON",
"analysisPath": "internal/cmd",
"containerPath": "/app",
"containerImageReference": "docker.io/library/ubuntu:24.04"
}
Repository component (shape)
{
"name": "component",
"source": {
"refType": "branch",
"gitReference": "main",
"repository": {
"name": "hello-kitty",
"url": "https://github.com/stackgen-demo/hello-kitty"
}
},
"language": "PYTHON",
"analysisPath": "internal/cmd",
"containerPath": "/app",
"containerImageReference": "docker.io/library/ubuntu:24.04"
}
Local web service (example shape)
{
"name": "web-service",
"source": {
"refType": "local",
"localPath": "/home/user/projects/web-service"
},
"language": "PYTHON",
"analysisPath": "src",
"containerPath": "/app",
"containerImageReference": "docker.io/library/python:3.10"
}
Java API from a Git repo (example shape)
{
"name": "api-service",
"source": {
"refType": "branch",
"gitReference": "main",
"repository": {
"name": "api-service",
"url": "https://github.com/myorg/api-service"
}
},
"language": "JAVA",
"analysisPath": "src/main",
"containerPath": "/app",
"containerImageReference": "docker.io/library/openjdk:17"
}
Multi-service (two example shapes)
Frontend shape
{
"name": "frontend",
"source": {
"refType": "branch",
"gitReference": "main",
"repository": {
"name": "frontend",
"url": "https://github.com/myorg/frontend"
}
},
"language": "PYTHON",
"analysisPath": "src",
"containerPath": "/app",
"containerImageReference": "docker.io/library/python:3.9"
}
Backend shape
{
"name": "backend",
"source": {
"refType": "branch",
"gitReference": "main",
"repository": {
"name": "backend",
"url": "https://github.com/myorg/backend"
}
},
"language": "JAVA",
"analysisPath": "src/main",
"containerPath": "/app",
"containerImageReference": "docker.io/library/openjdk:17"
}