CLI

Understanding the command line interface utility in DC/OS

The DC/OS command line interface (DC/OS CLI) utility allows you to manage cluster nodes, install and manage packages, inspect the cluster state, and manage services and tasks.

DC/OS 2.0 requires the DC/OS CLI >= 0.8. To install it, follow these instructions.

To list available commands, run dcos with no parameters:

  1. $ dcos
  2. Usage:
  3. dcos [command]
  4. Commands:
  5. auth
  6. Authenticate to DC/OS cluster
  7. cluster
  8. Manage your DC/OS clusters
  9. config
  10. Manage the DC/OS configuration file
  11. diagnostics
  12. Create and manage DC/OS diagnostics bundles
  13. help
  14. Help about any command
  15. job
  16. Deploy and manage jobs in DC/OS
  17. marathon
  18. Deploy and manage applications to DC/OS
  19. node
  20. View DC/OS node information
  21. package
  22. Install and manage DC/OS software packages
  23. plugin
  24. Manage CLI plugins
  25. quota
  26. Manage DC/OS quotas
  27. service
  28. Manage DC/OS services
  29. task
  30. Manage DC/OS tasks
  31. Options:
  32. --version
  33. Print version information
  34. -v, -vv
  35. Output verbosity (verbose or very verbose)
  36. -h, --help
  37. Show usage help
  38. Use "dcos [command] --help" for more information about a command.

Setting up a cluster

In order to interact with your cluster, you first need to set up the CLI.

  1. dcos cluster setup <cluster-url>

After following the login procedure, your CLI is now ready to interact with your cluster. You will notice that it now has additional commands such as marathon, node, package etc. These commands come from the plugins, dcos-core-cli and, if applicable, dcos-enterprise-cli, which is automatically installed as part of the setup command.

To display the DC/OS CLI version, run:

  1. dcos --version

Listing your clusters

The DC/OS CLI can work with multiple clusters. The following command displays the latest configured cluster:

  1. $ dcos cluster list
  2. NAME ID STATUS VERSION URL
  3. * cluster 26f72c2f-8d03-47d7-b95f-972b1fd3dea2 AVAILABLE 1.13 <cluster-url>

NOTE: The * indicates that the CLI is currently attached to the cluster name. If you run the setup command again with another cluster, you will see a new item in the list.

DC/OS CLI versions and configuration files

The DC/OS CLI has a configuration file for each connected cluster, which by default is stored in ~/.dcos/clusters/<cluster_id>/dcos.toml. You can optionally change the base portion (~/.dcos) of the configuration directory using the DCOS_DIR environment variable.

Installing the CLI

Installing the DC/OS command line interface

Configuring the CLI

Configuring the command line interface

Uninstalling the CLI

Uninstalling the DC/OS command line interface

CLI Plugins

How to extend the command line interface

DC/OS Enterprise CLI

ENTERPRISE

Configuring the DC/OS Enterprise command line interface

CLI Autocompletion

Enabling autocompletion for the CLI

Command Reference

Exploring the unique DC/OS commands