The secret delete command deletes a specified AWS Secrets Manager secret by name in the selected AWS region. Use it to clean up secrets that are no longer referenced in your Stacktape configuration — for example, retired API keys, rotated credentials, or secrets from deleted stages.
Before deleting a secret, verify that no active Stacktape configuration references it via $Secret('secret-name'). If a configuration still references a deleted secret, future operations that need to resolve that secret may fail.
Usage
In non-agent mode, Stacktape prompts for the secret name regardless of other flags.
In agent mode (CI pipelines or AI coding agents), pass the secret name as an argument — it becomes required.
On success, the CLI reports Secret "my-api-key" deleted.
Arguments reference
stacktape secret delete <secret-name>CLI options-r, --regionrequired"us-east-2" | "us-east-1" | "us-west-1" | "us-west-2" | "ap-east-1" | "ap-south-1" | "ap-northeast-3" | "ap-northeast-2" | "ap-southeast-1" | "ap-southeast-2" | "ap-northeast-1" | "ca-central-1" | "eu-central-1" | "eu-west-1" | "eu-west-2" | "eu-west-3" | "eu-north-1" | "me-south-1" | "sa-east-1" | "af-south-1" | "eu-south-1"AWS Region
The AWS region for the operation. For a list of available regions, see the AWS documentation.
Inside a project whose config declares region, the flag is optional and overrides the config.
--aws-accountstringAWS Account
The name of the AWS account to use for the operation. The account must first be connected in the Stacktape Console.
Without it, the account is chosen by --profile, AWS_PROFILE or AWS credentials in environment variables, then by your saved default, then by your organization's only connected account. --aws-account takes precedence over all of them, but AWS credentials in environment variables must then belong to that account.
-h, --helpstringShow Help
If provided, the command will not execute and will instead print help information.
--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.
-p, --profilestringAWS Profile
The AWS profile to use for the command. You can manage profiles using the aws-profile:* commands and set a default profile with defaults set.
For commands that use a connected AWS account, --profile (or AWS_PROFILE) selects the connected account the profile belongs to, unless --aws-account is set. The command fails if that account is not connected.
--quietbooleanQuiet
Hide progress, banners, success messages and hints. Command output, warnings and errors are still printed.
--secret-name (positional 1)stringSecret Name
The name of the secret in AWS Secrets Manager.
Examples
Delete a secret interactively — you will be prompted for the name.
Delete a secret by name in agent mode (no prompt, JSONL output).
Use a specific AWS profile in agent mode.
Related commands
secret set— create a new secret or update an existing one in AWS Secrets Manager.secret get— retrieve and display details about a stored secret.deploy— deploy a stack that references secrets via the$Secret()directive.