Tahir Uddin Khan
04/05/2026, 1:34 AMMarvin
04/05/2026, 1:34 AMMarvin
04/05/2026, 1:37 AMblock.save(name, overwrite=True). The prefect block CLI supports listing, inspecting, deleting, generating a UI link to create, and registering block types—but not creating/updating block documents directly.
Verified CLI commands:
- List: prefect block ls
- Inspect: prefect block inspect <BLOCK_TYPE_SLUG>/<BLOCK_NAME>
- Delete: prefect block delete <BLOCK_TYPE_SLUG>/<BLOCK_NAME>
- Create (generates UI link): prefect block create <BLOCK_TYPE_SLUG>
- Register block types: prefect block register -m <module> | -f <file.py>
Docs: CLI: prefect block
Workarounds you can use today:
- Python API (recommended for automation)
from prefect.blocks.system import Secret
# create or overwrite
Secret(value="shh").save("my-secret", overwrite=True)
# later update
s = Secret.load("my-secret")
s.value = "new-secret"
s.save(overwrite=True)
Concepts: Blocks concepts
- One-liner from your shell
python -c "from prefect.blocks.system import Secret; Secret(value='shh').save('my-secret', overwrite=True)"
- REST API (if you need pure HTTP)
- Create/update block documents via the server API
- REST reference: Create Block Document and Update Block Document
If you tell me which block type you’re managing, I can give you a ready-to-run snippet (or a small script) that mimics save(..., overwrite=True).