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
- You should automatically be directed to the browser, but if not, simply cmd+click on the authentication link.
- Ensure the confirmation code displayed in the browser matches up with the one in your terminal.
- Log in to DevZero if you aren’t already.
- 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):
- Install the IDE on your DevBox
- Download Jetbrains Gateway from here
- Use the ide command
dz ide goland # for Goland
dz ide idea # for Idea Ultimate
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
Completion #
dz completion bash > /etc/bash_completion.d/dz
OR
sudo bash -c "dz completion bash > /etc/bash_completion.d/dz"
THEN
source /etc/bash_completion.d/dz
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.
Simplifying Environment Setup With DZ Magic #
DZ Magic is a versatile command-line tool designed to streamline the process of setting up development environments. With just a few simple steps, DZ Magic collects information about your local repositories, installed packages, dotfiles, and Visual Studio Code extensions, and compiles them into a convenient template.
dz onboard magic
dz onboard magic-delete
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!