Skip to main content

Mass Alpha Stash Get

mass alpha stash get​

Print a stash entry's value

Synopsis​

Get Stash Entry

Prints an entry's value exactly as it is stored, with no trailing newline, so you can use it directly in $(...).

The command fails when the key has no value or has expired. Use that to compute a value again when it is gone.

A sensitive value is printed only for callers with stash:export on its stash, and for the deployment's own token. Other callers get an error.

Stashes do not inherit. To read a key on an environment, use the environment as the scope, not one of its instances.

Usage​

shell
mass alpha stash get <scope>.<key> [flags]

Flags​

  • --output, -o: Output format, text (default) or json. json prints the whole entry: its value, the parsed data of a JSON value, the label, the format, the flags, and the expiry.

Examples​

Read a value that an earlier step wrote:

shell
DB_HOST=$(mass alpha stash get "$MASSDRIVER_DEPLOYMENT_ID.db/hostname")

Read one field of a JSON value:

shell
mass alpha stash get "$MASSDRIVER_DEPLOYMENT_ID.stats" -o json | jq .data.changed

Use a cached value, or compute it again when it has expired:

shell
AMI=$(mass alpha stash get billing-dev-app.ami-id) || {
AMI=$(./find-latest-ami.sh)
mass alpha stash set billing-dev-app.ami-id "$AMI" --ttl 86400
}
mass alpha stash get <scope>.<key> [flags]

Options​

  -h, --help            help for get
-o, --output string Output format (text, json) (default "text")

Options inherited from parent commands​

      --profile string   Configuration profile to use (overrides MASSDRIVER_PROFILE and the active profile)

SEE ALSO​

  • mass alpha stash - Share values between deployments, scripts, and the Massdriver UI