The defaults set command sets system-wide default values for common Stacktape CLI arguments like region, stage, and AWS profile. Once configured, you can skip repetitive flags on commands like deploy, delete, and logs. The command does not require an API key, so you can run it before login.
Usage
The command is fully interactive — it prompts you for each configurable property one at a time. Each prompt shows the current value — either the previously saved value or the property's configured default. If the resolved value is null, the prompt displays << not-set >>. Sensitive properties use password-style input and their current values are redacted — values longer than four characters are masked except for the last four characters, while values with four or fewer characters are displayed unchanged.
For each prompt, you have three options:
- Leave blank (press Enter) to keep the current value unchanged.
- Enter a new value to update it.
- Enter a space character to reset the property to its configured default value.
After saving, the command prints the path to the file where defaults are stored.
Configurable defaults
The command walks through two groups of settings: CLI argument defaults and other defaults.
CLI argument defaults
These defaults apply automatically when the corresponding CLI flag is not explicitly provided on a command invocation. The command description lists these configurable properties:
| Property | Description |
|---|---|
region | AWS region for deployments and operations |
awsProfile | AWS credentials profile (corresponds to the --profile CLI flag) |
stage | Stage name |
projectName | Project name |
awsAccount | AWS Account name |
Setting a default region and stage is the most common use case. For example, deploy requires both --region and --stage, so defaults for both let you run stacktape deploy without extra flags. delete requires --region, and logs requires --region, --stage, and --resource-name (which is not a configurable default).
Other defaults
The command also prompts for additional settings that are not CLI flags:
| Property | Description |
|---|---|
| Executable paths | Default executables for resolving Node.js directives and other script invocations |
Sensitive configurable defaults are prompted with password-style input. Their current values are redacted — values longer than four characters are masked except for the last four, while values with four or fewer characters are displayed unchanged.
Most users only need to configure region, stage, and optionally awsProfile. The executable settings are only relevant if your system uses non-standard installation paths or a version manager that places binaries outside the default PATH.
How defaults interact with CLI flags
Configured defaults fill in values when you do not pass the corresponding CLI flag. If your default region is eu-west-1, running the following command deploys to us-east-1 for that single invocation:
The configured default remains unchanged — it still applies to subsequent commands that don't pass --region explicitly.
Where defaults are stored
After saving, Stacktape prints the local persisted-state file path. This file is local to your machine.
Protect the persisted-state file with standard filesystem permissions if you share the machine with other users.
Examples
Configure your region and stage so most commands work without extra flags.
When the prompts appear, enter eu-west-1 for region and production for stage. Leave other fields blank to skip them. Afterward, commands like stacktape deploy use those values automatically.
To check what defaults are currently configured, use defaults list.
To reset a single default to its configured default value, run defaults set again and enter a space character when prompted for that property.
Flags reference
stacktape defaults set <key> <value>CLI options-h, --helpstringShow Help
If provided, the command will not execute and will instead print help information.
--key (positional 1)stringDefault setting to update: region, stage, profile, project, aws-account, api-key, executable-python or executable-javascript.
--log-level"info" | "debug" | "error"Log Level
The level of logs to print to the console.
info: Basic information about the operation.error: Only errors.debug: Detailed information for debugging.
--quietbooleanQuiet
Hide progress, banners, success messages and hints. Command output, warnings and errors are still printed.
--value (positional 2)stringNew value for the selected default setting.
Related commands
defaults list— print all currently configured defaults.login— configure your Stacktape API key.deploy— deploy a stack, using configured defaults for region, stage, and project name.
defaults set FAQ
Do explicit CLI flags override configured defaults?
Configured defaults fill in values only when you do not pass the corresponding CLI flag. For example, --region us-east-1 overrides a default region of eu-west-1 for that single invocation without changing the stored default. This lets you keep convenient defaults while still targeting a different region or stage when needed.
How do I clear a single configured default?
Run stacktape defaults set again. When prompted for the property you want to clear, enter a single space character instead of a value. This resets the property to its configured default value. Other properties remain unchanged — just press Enter to skip them.
Do I need to be logged in to run defaults set?
No. The defaults set command does not require a Stacktape API key. You can configure region, stage, and profile defaults before running login. This is useful when setting up a new machine — configure your defaults first, then log in when you're ready to deploy.
Can I set defaults per project, or only globally?
The defaults set command sets system-wide defaults that apply across all projects on your machine — there is no per-project scope. If one region, stage, and profile cover most of your work, defaults are the simplest option. If you regularly switch between configurations (for example separate staging and production setups), keep your most common values as defaults and pass explicit flags (such as --region or --stage) on the commands where the defaults don't apply — those flags override the stored defaults for that single invocation.