How do I install dfx 17.0 non-interactively?

When installing dfx 17.0, it asks for confirmation to proceed:

$ sh -ci "$(curl -fsSL https://internetcomputer.org/install.sh)"
info: Executing dfxvm install script, commit: 0016b0796d9bf2b4b74f4cc333bcccc139339e0e
info: Downloading latest release...
info: Checking integrity of tarball...
dfxvm-x86_64-unknown-linux-gnu.tar.gz: OK

Welcome to dfxvm!

This will install dfxvm, and download and install dfx.

The dfxvm and dfx commands will be added to the following directory:

   ...

Current installation options:

            dfx version: latest
   modify PATH variable: yes

Proceed with installation?:
> Proceed with installation (default)
  Customize installation
  Cancel installation

How do I avoid it from asking to proceed, and just do it?

I need this because I am installing it as part of a Github Action workflow.

DFXVM_INIT_YES=true maybe?

Took me a while to find the post but, I remembered I read something today and ultimately found it back in The dfx version manager (dfxvm) version 1.0.0 is released!

1 Like

That’s right. You can also use the setup-dfx GitHub action

    - name: Install dfx
      uses: dfinity/setup-dfx@main
2 Likes

Are you not having issue in finding the dfx in the path? After I install it in my docker and try to run dfx --version it doesnt seem to find dfx in the path anymore.

ENV DFXVM_INIT_YES=true
RUN curl -fsSL https://internetcomputer.org/install.sh | sh

I think you have to source ~/profile after installation, or open a new shell.

In my GitHub action I first install it in a separate step, and then use it in a next step, which is like opening a new shell.

Thanks, the way I fixed it for now is setting dfxPath = '/root/.local/share/dfx/bin'; and pushing this new env to my code that interacts with the CLI. Really not cool having to do that in a rush but this was the easier change for me, since this new dfx update was breaking my app in production.