{"id":19347177,"url":"https://github.com/dcos/dcos-core-cli","last_synced_at":"2025-07-23T13:35:30.854Z","repository":{"id":39846359,"uuid":"133795958","full_name":"dcos/dcos-core-cli","owner":"dcos","description":"Core plugin for the DC/OS CLI","archived":false,"fork":false,"pushed_at":"2022-05-25T00:50:25.000Z","size":17567,"stargazers_count":2,"open_issues_count":10,"forks_count":21,"subscribers_count":12,"default_branch":"2.2-patch.x","last_synced_at":"2025-04-23T05:41:19.338Z","etag":null,"topics":["dcos","dcos-ux-guild"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dcos.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null}},"created_at":"2018-05-17T10:12:27.000Z","updated_at":"2021-11-15T19:18:23.000Z","dependencies_parsed_at":"2022-09-14T17:04:20.972Z","dependency_job_id":null,"html_url":"https://github.com/dcos/dcos-core-cli","commit_stats":null,"previous_names":[],"tags_count":71,"template":false,"template_full_name":null,"purl":"pkg:github/dcos/dcos-core-cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcos%2Fdcos-core-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcos%2Fdcos-core-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcos%2Fdcos-core-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcos%2Fdcos-core-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dcos","download_url":"https://codeload.github.com/dcos/dcos-core-cli/tar.gz/refs/heads/2.2-patch.x","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcos%2Fdcos-core-cli/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266689321,"owners_count":23969142,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-23T02:00:09.312Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dcos","dcos-ux-guild"],"created_at":"2024-11-10T04:14:38.642Z","updated_at":"2025-07-23T13:35:30.785Z","avatar_url":"https://github.com/dcos.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DC/OS Command Line Interface - Core Plugin\n\nThe DC/OS Command Line Interface (CLI) is a cross-platform command line\nutility that provides a user-friendly yet powerful way to manage DC/OS\nclusters.\n\n## Installation and usage\n\nIf you're a **user** of DC/OS, please follow the [installation\ninstructions](https://dcos.io/docs/latest/cli/install/). Otherwise,\nfollow the instructions below to set up your development environment.\n\nDetailed help and usage information is available through the dcos help\ncommand and for specific subcommands through `dcos \u003csubcommand\u003e --help`.\n\nAdditional documentation for the CLI and for the DC/OS in general is\navailable in the [DC/OS docs](https://dcos.io/docs/).\n\n## Parsing CLI output\n\nThe CLI outputs either whitespace delimited tables which can be\nprocessed by all of your favourite Unix/Linux tools like sed, awk and\ngrep, or text formatted as JSON when using the `--json` flag.\n\nIf using JSON, you can combine it with the powerful\n[jq](http://stedolan.github.io/jq/) utility. The example below installs\nevery package available in the DC/OS repository:\n\n    dcos package search --json | jq '.[0].packages[].name' | xargs -L 1 dcos package install --yes\n\nNote: The CLI output supports UTF-8 encoding for stdout and stderr.\nPlease follow your platform's instructions on how to do that.\n\n## Development dependencies\n\n1.  [git](http://git-scm.com) must be installed to download the source\n    code for the DC/OS CLI.\n2.  [python](https://www.python.org/) version 3.7.x must be installed.\n    The Makefile won't let you build with another Python version,\n    unless the `DCOS_EXPERIMENTAL=1` environment variable is set.\n3.  If `make env` fails you may be missing required dependencies for\n    cryptography. See\n    [here](https://cryptography.io/en/latest/installation/) for more\n    information or use our dockerfile that builds with all necessary\n    dependencies.\n4.  [virtualenv](https://virtualenv.pypa.io/en/latest/) must be\n    installed and on the system path in order to install legacy\n    subcommands. New subcommands are packaged as platform specific\n    executable or platform specific Zip archives.\n5.  [win-bash](https://sourceforge.net/projects/win-bash/files/shell-complete/latest)\n    must be installed if you are running this in Windows in order to run\n    setup scripts from the Makefiles.\n\n## Basic setup\n\n1.  Make sure you meet requirements for installing\n    [packages](https://packaging.python.org/en/latest/installing.html#installing-requirements)\n2.  Clone git repo for the dcos cli:\n\n        git clone git@github.com:dcos/dcos-core-cli.git\n\n3.  Change directory to the repo directory:\n\n        cd dcos-core-cli\n\n###  Setup virtualenv for the dcos project\n\n        cd python/lib/dcos\n        make env\n\n###  Setup virtualenv for the dcoscli project\n\n        cd python/lib/dcoscli\n        make env\n\n## Using the DC/OS Core CLI plugin\n\nAssuming you have the [DC/OS CLI installed](https://docs.d2iq.com/mesosphere/dcos/latest/cli/install/) and a configured cluster (see [dcos cluster setup](https://docs.d2iq.com/mesosphere/dcos/1.13/cli/command-reference/dcos-cluster/dcos-cluster-setup/)).\n\n1.  From the root of the project, run:\n\n        make \u0026\u0026 make plugin\n\n2.  Add the Core CLI plugin to your CLI (use `darwin`, `linux`, or `windows`):\n\n        dcos plugin add -u ./build/darwin/dcos-core-cli.zip\n\n## Running tests\n\n### Setup\n\nBefore you can run the DC/OS CLI integration tests, you need to get a\ncluster up and running to test against. Currently, the test suite only\nsupports testing against Enterprise DC/OS.\n\nGiven these constraints, the easiest way to launch a cluster with these\ncapabilities is to use\n[dcos-launch](https://github.com/dcos/dcos-launch) with the\nconfiguration listed below:\n\n    launch_config_version: 1\n    deployment_name: ${CLI_TEST_DEPLOYMENT_NAME}\n    installer_url: ${CLI_TEST_INSTALLER_URL}\n    platform: aws\n    provider: onprem\n    aws_region: us-east-1\n    aws_key_name: ${CLI_TEST_SSH_KEY_NAME}\n    ssh_private_key_filename: ${CLI_TEST_SSH_KEY_PATH}\n    os_name: cent-os-7\n    instance_type: m4.large\n    num_masters: 1\n    num_private_agents: 1\n    num_public_agents: 1\n    dcos_config:\n        cluster_name: DC/OS CLI Integration Tests\n        resolvers:\n            - 10.10.0.2\n        dns_search: us-east-1.compute.internal\n        master_discovery: static\n\nWhere `CLI_TEST_DEPLOYMENT_NAME` is a custom name set by the user,\n`CLI_TEST_INSTALLER_URL` is the URL of a dcos_generate_config.ee.sh\nscript for the desired version of DC/OS to test against,\n`CLI_TEST_SSH_KEY_NAME` is the name of an AWS key to install on the\nmachines deployed by the installer, and `CLI_TEST_SSH_KEY_PATH` is a\nlocal path to the key named by `CLI_TEST_SSH_KEY_NAME`.\n\nUnfortunately, the URL to download `dcos_generate_config.ee.sh` scripts\nfor Enterprise DC/OS is not publicly available. For Mesosphere employees\nthe URL to the latest master build of Enterprise DC/OS can be found\nhere:\n\n    https://mesosphere.onelogin.com/notes/45791\n\nFor everyone else, you can still run the integration test suite against\na non-enterprise cluster (i.e. Community DC/OS), but please be aware\nthat running the full test suite *will* fail. See the section below on\n*Running* to see how to limit the set of tests run by the integration\ntest suite.\n\nThe URL to the latest master build of Community DC/OS is:\n\n    https://downloads.dcos.io/dcos/testing/master/dcos_generate_config.sh\n\n### Initialization\n\nOnce you have your cluster up and running you need to modify your\nenvironment in order to run the tests. A simple script you can use to\nmodify your environment can be seen below.\n\n*NOTE*: Make sure you run this script from your Python dcos-core-cli directory.\n\n*NOTE*: You will need to customize the first few lines in the script\nappropriate for your setup. A description of the variables you need to\nmodify can be found below the script\n\n**CLI_TEST_DCOS_URL**: Holds the URL or IP address of the cluster you\nare testing against. If you used `dcos-launch` to launch the cluster, you\ncan get the IP of the cluster by running `dcos-launch describe`.\n\n**CLI_TEST_SSH_KEY_PATH**: Points to a private key file used to ssh\ninto nodes on your cluster. If you used `dcos-launch` to launch the\ncluster, then this should point to the same file used in your\n`dcos-launch` config. This is used by the node integration tests.\n\n**CLI_TEST_SSH_USER**: Holds the username used to ssh into nodes on\nyour cluster. If you used `dcos-launch` with the configuration listed\nabove to launch your cluster, then you *must* set this to centos. This\nis used by the node integration tests.\n\n### Running\n\nNow that your environment is set up appropriately, we can start running\nthe tests. We have tests both in the `dcos` package (`python/lib/dcos`) and\nin the `dcoscli` package (`python/lib/dcoscli`).\n\nWhen running the tests, change your current directory to one of those\ntwo locations and follow the instructions below.\n\n*NOTE*: You **must** have your virtualenv *deactivated* in order to run\nthe tests via the commands below. This is very important and often a\npoint of much confusion.\n\nIf you want to run the full test suite simply run:\n\n    make test\n\nIf you want to run only unit tests that match a specific pattern run:\n\n    env/bin/tox -e py35-unit /\u003ctest-file\u003e.py -- -k \u003ctest-pattern\u003e\n\nIf you want to run only integration tests that match a specific pattern\nrun:\n\n    env/bin/tox -e py35-integration /\u003ctest-file\u003e.py -- -k \u003ctest-pattern\u003e\n\n### Other Useful Commands\n\n1.  List all of the supported test environments:\n\n        env/bin/tox --listenvs\n\n2.  Run a specific set of tests:\n\n        env/bin/tox -e \u003ctestenv\u003e\n\n3.  Run a specific unit test module:\n\n        env/bin/tox -e py35-unit /\u003ctest-file\u003e.py\n\n4.  Run a specific integration test module:\n\n        env/bin/tox -e py35-integration /\u003ctest-file\u003e.py\n\n### Releasing\n\nDocumented [here](https://github.com/dcos/dcos-cli/blob/master/design/release.md#dcos-core-cli)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdcos%2Fdcos-core-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdcos%2Fdcos-core-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdcos%2Fdcos-core-cli/lists"}