Connect to a Machine
How to download and see general CLI docs #
Download Instructions #
Download the public binary
curl https://devinfra-public.s3.us-west-2.amazonaws.com/bin/v0/dz-darwin -o dz
Running this command in the terminal at the desired location will download the dz binary
Set the execute permission on the file
chmod +x dz
Running +x adds the execute permission to the file in the path
Move the executable to the bin folder under your usr folder
[sudo] mv dz /usr/local/bin/
If you don’t already have a bin folder, you might receive an error No such file or directory. If so, Use the shortcut Shift + ⌘ + C and go to /usr/local/ path. Then create a new folder bin
💡 usr is an abbreviation of “user related”
General CLI Help #
All DevZero commands start with dz and the usage is dz [command] Available commands are shared below:
Available Commands: completion Generate the autocompletion script for the specified shell help Help about any command ide Connects an IDE to a box kube devzero in k8 login Authenticates the user new Get a new machine ssh Connect to a running DevZero instance update Updates the dz binary version CLI version Flags: -h, --help help for dz Use "dz [command] --help" for more information about a command.
Example: dz ide is used to connect a supported IDE to a running DevBox Running the above command shows the usage and available commands
If you are further interested to learn more about each available command, you can do so by using:
dz ide <command> -h or dz ide <command> --help
Auth to the CLI #
From the terminal, login in to DevZero using the dz login command which initiates the device authentication process using the Device Authorization Flow(specified in OAuth 2.0)
- You should be navigated to the verification page with embedded user code in the browser.
- Ensure the confirmation code displayed in the browser matches up with the one in your terminal. If it does match, Click Confirm which will trigger one/more of the following processes:
- Authenticating the user;
- Redirecting the user to an Identity Provider to handle authentication;
- Checking for active SSO sessions;
- Obtaining user consent for the device, unless consent has been previously given.
Upon successful authentication and consent, the confirmation prompt will be shown: At this point, authentication is complete the device has been authorized and you should also see the following message in the terminal:
Successfully logged in. Session valid for 168h0m0s
💡 Authenticating allows you to create new DevBoxes(dz new), connecting to existing DevBoxes(dz ssh), connecting an IDE to DevBoxes(dz ide <ide_name>) and running DevZero in K8s(dz kube <command>)
VS Code #
Install our VS Code extension from the Visual Studio Marketplace here.
Upon successful installation, you should see a welcome screen as follows.
By this time, as you already have an account with DevZero, simply click Sign In which takes you through the authentication process for VS Code Extension.
Once authenticated you should be taken back to VS Code where you should see available environments ready to Launch with a button click and also running environments
Once you click LAUNCH , you are set to START CODING !!
Jetbrains IDE #
DevZero supports JetBrains IDEs by leveraging built-in features of the JetBrains Gateway.
- JetBrains Gateway has been installed on the user's local machine.
- The remote VM must be running Linux.
Connecting via JetBrains Gateway #
- Open JetBrains Gateway and click on SSH under Connections.
- Click the New Connection button.
- In the Username field enter "devzero"
- In the Host field, enter the name of the remote VM. This can be easily copied from the Console portal.
- Click Check Connection and Continue.
- Select the desired IDE to be installed and the desired project directory.
- Click Download IDE and Connect
Connecting via JetBrains Gateway:
Connecting via JetBrains Gateway