Dfx deploy needs a force push argument

When using dfx deploy to deploy Motoko canisters, if there’s a mismatch in the expected and available Candid bindings, we get a prompt on the command line that asks us whether we are sure that we would like to deploy regardless.

However, this prompt requires manual input on the CLI with a “yes/no”, otherwise the terminal is stuck indefinitely on that prompt.

dfx deploy needs to include a parameter that lets us specify this so that we can use that on terminals like CI environments where manual input is not available

Something like

dfx deploy --allow-candid-mismatch

which will basically perform the same function as typing “yes” on the terminal.

echo "yes" | dfx deploy

1 Like

Thank you for the workaround.

I am using something similar for now but I believe it would be more ergonomic if dfx included this in its own API.

Consider this forum thread as a feature request/feedback :slight_smile:

I think adding a --yes flag is reasonable. Please don’t expect any changes too soon as this is easy to work around, but I added an internal ticket for it.

1 Like

This has been implemented and will be in the next release of dfx: feat: Add a -y flag to deploy/install by adamspofford-dfinity · Pull Request #2667 · dfinity/sdk · GitHub