CLI Reference

The DevZero CLI (dz) allows users to use DevZero directly from the terminal.

Installation #

See instructions

Authenticate #

Log in to DevZero to authenticate dz with the login command:

dz login
  1. You should automatically be directed to the browser, but if not, simply cmd+click on the authentication link.
  2. Ensure the confirmation code displayed in the browser matches up with the one in your terminal.
  3. Log in to DevZero if you aren’t already.
  4. That’s it - you’re in!‍

Usage and common commands #

SSH #

This will establish an SSH connection with a developer environment.

dz ssh

VS Code and other IDEs #

VS Code #

code will open up an environment in VS Code.

dz code

Jetbrains IDEs #

For Jetbrains IDEs (IntelliJ, Goland, PyCharm etc):

  1. Install the IDE on your DevBox
  2. Download Jetbrains Gateway from here
  3. Use the ide command
dz ide goland # for Goland
dz ide intellij # for IntelliJ
dz ide pycharm # for PyCharm

Help (+ other commands) #

You can easily see all available commands by using help:

$ dz help
DevZero enables development in the cloud

Usage:
  dz [command]

Available Commands:
  cdk         cdk utilities
  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
  machines    manage VMs
  onboard     Simplify DZ onboarding tasks
  ssh         Connect to a running DevZero instance
  update      Updates the dz binary
  version     CLI version

Flags:
  -h, --help              help for dz
  -p, --password string   password for auth
  -u, --username string   username for API-auth

Use "dz [command] --help" for more information about a command.

To get more information about a specific command:

dz <command> --help

CDK #

Cloudformation functionality is available under dz cdk

Onboard #

dz onboard create-keys will automatically create a private/public ssh keypair on your local machine, and send the public key up to DevZero. We place this public key on machines that you launch so that you can connect to them from your local computer. All of your keys created with DevZero are visible in your profile settings.

Kubernetes #

Kubernetes related functionality is available under dz kube

Installing and using the DZ CLI from a DevBox #

Add this snippet to the scriptpolicy of a Template (or your Personal Policy) to install dz automatically in your environments:

- script: |
    cd /home/devzero
    curl https://devinfra-public.s3.us-west-2.amazonaws.com/bin/v0/dz-linux -o dz
    chmod +x dz
    sudo mv dz /usr/local/bin/
  runas: devzero

Feature requests #

If there’s anything you wish you could do from your terminal that isn’t in the DZ CLI yet, please drop us a line at support@devzero.io!

PreviousTroubleshooting
NextTemplating Syntax