StackPanel

stack preflight

Run shell-entry preparation tasks and explicit env imports

stack preflight

Run shell-entry preparation tasks and explicit environment imports.

stack preflight run is the safe entrypoint for tasks that should happen on shell entry: host-side code generation and file ops. It is stack setup restricted to reconciliation, over the same engine - it never offers addons and never prompts, so shell entry never adopts anything. Use stack doctor to see what it would do.

stack preflight import-env explicitly generates .stack/config.local.nix from environment variables for pure mode.

Use import-env when you want to materialize relevant environment variables into Nix configuration. This is intentionally explicit because it changes local config and makes the current shell stale.

In pure mode, all environment variables are cleaned except those in devshell.clean.keep

After running stack preflight import-env, you can use nix develop (without --impure) and direnv allow in pure mode.

Usage

stack preflight run
stack preflight import-env

Subcommands

CommandDescription
stack preflight run [module...]Run safe shell-entry tasks, including host-side codegen
stack preflight import-envGenerate .stack/config.local.nix from environment variables

Flags

The root preflight command has no direct flags; use a subcommand.

Global Flags

These flags are inherited from parent commands.

FlagTypeDefaultDescription
--daemon, -dboolfalseRun in daemon mode (no TUI, for background processes)
--no-colorboolfalseDisable color output
--no-tuiboolfalseDisable interactive TUI mode
--verbose, -vboolfalseEnable verbose output

On this page