MCPcopy Index your code
hub / github.com/dcos/dcos-cli

github.com/dcos/dcos-cli @1.2.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release 1.2.0 ↗ · + Follow
479 symbols 2,266 edges 101 files 316 documented · 66%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

DC/OS Command Line Interface Build Status

The DC/OS Command Line Interface (CLI) is a cross-platform command line utility that provides a user-friendly yet powerful way to manage DC/OS clusters.

Installation and usage

If you're a user of DC/OS, please follow the installation instructions. Otherwise, follow the instructions below to set up your development environment.

Detailed help and usage information is available through the dcos help command and for specific subcommands through dcos <subcommand> --help.

Additional documentation for the CLI and for the DC/OS in general is available in the DC/OS docs.

Development setup

Requirements

  1. git must be installed to download the source code for the DC/OS CLI.
  2. go 1.12+ or Docker.
  3. win-bash must be installed if you are using Windows in order to run setup scripts from the Makefile.

Instructions

  1. Clone git repo for the dcos cli:

    git clone git@github.com:dcos/dcos-cli.git
    
  2. Change directory to the repo directory:

    cd dcos-cli
    
  3. Build the binary (using Docker):

    make
    

    or Using Go (1.12+):

    export NO_DOCKER=1
    make
    

Using the DC/OS CLI

The DC/OS CLI will be built in the directory build/<platform>/.

Running tests

Unit tests

make test

Integration tests

You need to have a running DC/OS cluster in order to run the integration tests. Using a Python virtual environment is recommended.

export DCOS_TEST_DEFAULT_CLUSTER_USERNAME=<username to access the cluster>
export DCOS_TEST_DEFAULT_CLUSTER_PASSWORD=<password to access the cluster>
export DCOS_TEST_DEFAULT_CLUSTER_HOST=<IP or domain of the cluster>
cd tests
pip install -r requirements.txt
pytest integration

Releasing

Releasing a new version of the DC/OS CLI is done through an automated Jenkins build which is triggered automatically for new tags and on pushes to master.

The latest binaries (built from the latest tag) are published to:

  • https://downloads.dcos.io/cli/releases/binaries/dcos/linux/x86-64/latest/dcos
  • https://downloads.dcos.io/cli/releases/binaries/dcos/darwin/x86-64/latest/dcos
  • https://downloads.dcos.io/cli/releases/binaries/dcos/windows/x86-64/latest/dcos.exe

The testing binaries (built from the master branch continuously) are published to:

  • https://downloads.dcos.io/cli/testing/binaries/dcos/linux/x86-64/master/dcos
  • https://downloads.dcos.io/cli/testing/binaries/dcos/darwin/x86-64/master/dcos
  • https://downloads.dcos.io/cli/testing/binaries/dcos/windows/x86-64/master/dcos.exe

The release proces is described here

Contributing

Contributions are always welcome! Please refer to our contributing guidelines.

Extension points exported contracts — how you extend this code

Opener (Interface)
Opener opens a file or URL in the user's preferred application. [1 implementers]
pkg/open/open.go
Context (Interface)
Context contains abstractions for stdout/stderr, the filesystem, and the CLI environment in general. It also acts as a f [1 …
api/cli.go
Option (FuncType)
Option is a functional option for an HTTP client.
pkg/httpclient/client.go
Filter (FuncType)
Filter is a functional option for list filters.
pkg/cluster/lister/filters.go
OpenerFunc (FuncType)
OpenerFunc is a func adapter for the Opener interface.
pkg/open/open.go

Core symbols most depended-on inside this repo

Get
called by 65
pkg/config/config.go
exec_cmd
called by 51
tests/integration/common.py
Set
called by 45
pkg/config/config.go
Close
called by 42
pkg/login/loginserver/server.go
New
called by 28
pkg/httpclient/client.go
Out
called by 26
api/cli.go
Logger
called by 26
api/cli.go
Name
called by 25
pkg/config/cluster.go

Shape

Function 232
Method 181
Struct 55
Route 4
FuncType 3
Interface 2
TypeAlias 2

Languages

Go88%
Python10%
TypeScript2%

Modules by API surface

pkg/plugin/manager.go26 symbols
pkg/httpclient/client.go24 symbols
pkg/config/cluster.go21 symbols
pkg/cli/context.go21 symbols
pkg/cmd/completion/completion_data.gen.go20 symbols
api/cli.go19 symbols
pkg/config/config.go18 symbols
pkg/setup/setup.go16 symbols
tests/integration/test_plugin.py15 symbols
pkg/login/flow.go14 symbols
tests/integration/test_cluster.py13 symbols
pkg/config/config_test.go12 symbols

For agents

$ claude mcp add dcos-cli \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact