CLI Reference

Complete reference for the stackkit command-line interface.

Commands

Global Flags

Every subcommand accepts these flags.

FlagShortDefaultDescription
--verbose-vfalseEnable verbose output
--quiet-qfalseSuppress non-essential output
--chdir-C.Change to directory before running
--spec-sstack-spec.yamlPath to stack specification file
--contextauto-detectNode context override (local, cloud, pi)

stackkit init [kit]

Create a new stack-spec.yaml. Without arguments, an interactive wizard guides you through StackKit selection, variant, domain, and email configuration.

stackkit init                              # interactive wizard
stackkit init base-kit                     # skip kit selection
stackkit init base-kit --variant minimal   # specify variant
stackkit init base-kit --non-interactive   # fail if input required
stackkit init ./path/to/custom-kit         # use local kit path
FlagDefaultDescription
--variantautoService variant
--modesimpleDeployment mode (simple, advanced)
-o, --outputdeployOutput directory for generated files
-f, --forcefalseOverwrite existing files
--non-interactivefalseFail instead of prompting for input

stackkit prepare

Prepare a system for deployment. Checks and installs Docker and OpenTofu if missing, validates the spec, and reports system resources.

stackkit prepare                                  # local system
stackkit prepare --host 192.168.1.100 --user root # remote via SSH
stackkit prepare --dry-run                        # preview only
FlagDefaultDescription
--hostlocalhostTarget host IP or hostname
--userSSH username (remote only)
--keySSH private key path (remote only)
--dry-runfalseShow what would be done without changes
--skip-dockerfalseSkip Docker check/install
--skip-tofufalseSkip OpenTofu check/install
--auto-fixtrueAuto-correct fixable issues

stackkit generate

Generate OpenTofu files from the stack spec and StackKit templates. Output placed in deploy/ by default. Generated files are artifacts — never edit them directly.

stackkit generate                # generate into ./deploy
stackkit generate -o ./out       # custom output directory
stackkit generate --force        # overwrite existing output
FlagDefaultDescription
-o, --outputdeployOutput directory
-f, --forcefalseOverwrite existing output

stackkit plan

Preview what apply would change without modifying anything.

stackkit plan                     # preview changes
stackkit plan -o plan.tfplan      # save plan to file
stackkit plan --destroy           # preview a destroy
FlagDefaultDescription
-o, --outSave plan to file
--destroyfalseCreate a destroy plan

stackkit apply [plan-file]

Deploy the infrastructure. If the deploy directory is missing, generate runs automatically first.

stackkit apply                    # deploy with confirmation
stackkit apply --auto-approve     # deploy without confirmation
stackkit apply plan.tfplan        # apply a saved plan
FlagDefaultDescription
--auto-approvefalseSkip the interactive confirmation

stackkit destroy

Tear down all infrastructure managed by the deployment.

stackkit destroy                          # with confirmation
stackkit destroy --auto-approve           # no confirmation
stackkit destroy --auto-approve --force   # ignore errors
FlagDefaultDescription
--auto-approvefalseSkip confirmation
--forcefalseContinue even if errors occur

stackkit status

Show current deployment status: services, health, and container IDs.

stackkit status             # table output
stackkit status --json      # JSON output
FlagDefaultDescription
--jsonfalseOutput as JSON

stackkit validate [file]

Validate the stack spec against CUE schemas and check generated OpenTofu files.

stackkit validate                   # validate current spec
stackkit validate my-spec.yaml      # validate a specific file
stackkit validate --all             # also validate all .cue files
FlagDefaultDescription
--allfalseAlso validate all .cue files under working directory

stackkit addon

Manage composable add-ons: monitoring, backup, VPN, media server, and more.

stackkit addon list              # list available add-ons
stackkit addon add monitoring    # add an add-on
stackkit addon remove monitoring # remove an add-on

After adding or removing add-ons, run stackkit generate --force to regenerate deployment files.

stackkit version

Print version, git commit, build date, Go version, and OS/architecture.

$ stackkit version
stackkit version v0.3.0
  Git commit: a1b2c3d
  Build date: 2026-03-01T12:00:00Z
  Go version: go1.24
  OS/Arch:    linux/amd64

stackkit completion <shell>

Generate shell completion scripts for tab-completion.

# Bash
stackkit completion bash > /etc/bash_completion.d/stackkit

# Zsh
stackkit completion zsh > "${fpath[1]}/_stackkit"

# Fish
stackkit completion fish > ~/.config/fish/completions/stackkit.fish

Typical Workflows

First deployment

curl -sSL install.stackkit.cc | sh
mkdir my-homelab && cd my-homelab
stackkit init base-kit
stackkit apply --auto-approve
stackkit status

Changing configuration

# edit stack-spec.yaml
stackkit generate --force
stackkit plan
stackkit apply

Adding an add-on

stackkit addon add monitoring
stackkit generate --force
stackkit apply

Files Created by stackkit

PathCreated byPurpose
stack-spec.yamlinitDeployment specification
deploy/generateGenerated OpenTofu files (never edit)
deploy/main.tfgenerateOpenTofu resource definitions
.stackkit/state.yamlapplyDeployment state tracking