<@ULVA73B9P> using the Prefect CLI, how do I show ...
# ask-marvin
n
@Marvin using the Prefect CLI, how do I show the value of a secret block?
m
thought for 21.1 seconds
Use:
Copy code
bash
prefect block inspect <block-type-slug>/<block-name>
For a secret block, that would look like:
Copy code
bash
prefect block inspect secret/my-secret
A couple important notes: - This is the CLI command available in Prefect 3.x for viewing configured block details. - For
Secret
blocks, Prefect typically redacts/masks the secret value rather than printing the raw secret in plain text. If your goal is to retrieve the actual secret value, the usual pattern is to load it in Python instead:
Copy code
python
from prefect.blocks.system import Secret

secret = Secret.load("my-secret").get()
print(secret)
CLI help: - `prefect block`: available subcommands include
inspect
,
ls
, etc. -
prefect block inspect --help
confirms the syntax:
prefect block inspect [SLUG]
Docs: - Prefect docs If you want, I can also show you how to list secret blocks first, or how to read one from a deployment/flow runtime context.