<@ULVA73B9P> How can I run a deployment from cli u...
# ask-marvin
j
@Marvin How can I run a deployment from cli using the
--params
option to supply my paramters?
m
thought for 117.3 seconds
In Prefect 3.x, you can pass a full JSON object of parameters with
--params
when running a deployment. Basic usage (inline JSON):
Copy code
prefect deployment run <FLOW_NAME>/<DEPLOYMENT_NAME> --params '{"name":"Alice","count":42,"enabled":true}'
Read JSON from stdin (handy for files or generators):
Copy code
# From a file
cat params.json | prefect deployment run <FLOW_NAME>/<DEPLOYMENT_NAME> --params -

# Construct JSON dynamically (jq)
jq -n '{name:"Alice", count:42, enabled:true}' | \
  prefect deployment run <FLOW_NAME>/<DEPLOYMENT_NAME> --params -
Notes: - Wrap the JSON in single quotes in bash/zsh to avoid escaping double quotes. -
--params
accepts one complete JSON object. If you prefer setting individual keys, you can use
-p/--param key=value
repeatedly; if both are provided,
--param
entries override keys from
--params
. - Add
--watch
if you want to stream logs until the run finishes:
Copy code
prefect deployment run <FLOW_NAME>/<DEPLOYMENT_NAME> --params '{"foo":"bar"}' --watch