@medable/mdctl-cli
Medable Developer Tools :: Cli tool
Last updated 2 months ago by jamessas .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @medable/mdctl-cli 
SYNC missed versions from official npm registry.

mdctl-cli

Developer Tools Cli for Medable

Credentials

Our developer tools allow you to store your credentials in a safe way and use them to perform other operations later on.

Add new credentials

To add new credentials simply run the next command follow the prompts.

mdctl credentials add

You can also specify some arguments

--type - sets the type (password, token, signature). auto-detected when adding/updating.
--endpoint - sets the endpoint. eg. https://api.dev.medable.com
--env sets the environment. eg. my-org-code
--apiKey api key for looking up signing credentials (and token credentials)

Secret fields are still required to be filled manually (e.g: password).

You can add credentials from a file by using the --file path/to/file argument.

Reading credentials from file

File can be provided in YAML or JSON format, the following fields can be defined

type - sets the type (password, token, signature). auto-detected when adding/updating.
endpoint - sets the endpoint. eg. https://api.dev.medable.com
env - sets the environment. eg. my-org-code
apiKey - api key for looking up signing credentials (and token credentials)
password - account password for login
apiSecret - api secret key for signing
token - jwt token, which must include the 'cortex/eml' claim for lookup

Listing credentials

To list the existing credentials simply run

mdctl credentials list

It's also possible to filter the credentials by providing arguments

--type filters by type
--username filters by username
--endpoint filters by endpoint
--env filters by environment
--apiKey filters by apiKey

Clear credentials

Use the following command in combination with our filters to delete 1 or more credentials

mdctl credentials clear --username john@medable.com

Available filters are:

--type deletes by type
--endpoint deletes by endpoint
--username deletes by username
--env deletes by environment
--apiKey deletes by apiKey

Get credentials

It's also possible to retrieve the first matching credential by running

mdctl credentials get

You can also provide filters to help our tool to decide which credential we want to retrieve

--type filters by type
--username filters by username
--endpoint filters by endpoint
--env filters by environment
--apiKey filters by apiKey

Default credentials

Default credentials can be used to perform operations without having to explicitly specify the credentials to use, for example: mdctl env export //will try to perform the environment export with the default credentials

The following commands help you to manage the default credentials

mdctl credentials default set     //Sets default credentails, see filters below
mdctl credentials default get    //Gets default credentails, see filters below
mdctl credentials default clear //Removes default credentails, see filters below

Password session

Only if you use credentials of type 'password' you can start a session by doing:

mdctl credentials login

In order to avoid interactions with the CLI it is possible to use the following filters to narrow down the credentials to use:

--username filters by username
--endpoint filters by endpoint
--env filters by environment
--apiKey filters by apiKey

If no filters are provided then the CLI will try to use the default credentials (as long as they are type 'password').

If there are no default credentials or if the filters provided return more than 1 result then follow the prompts to choose the desired credentials.

It is also possible to provide a path to a file with this information by using --file path/to/file

Use mdctl credentials logout to end the session.

Check current session

Use mdclt credentials whoami to get the current authorization state.

Clear all credentials

Use mdctl credentials flush to remove everything.

Environments

Export Environment

Note: You must have a credential already set

If you don't specify any additional parameter it will try to export current default env set on credentials.

mdctl env export

but you can specify any other credential to use by using any of the arguments that is used by that credential like

--env filters by environment
--username filters by username
--endpoint filters by endpoint
--apiKey filters by apiKey
mdctl env export --env medable

You can specify the output format JSON | Yaml, json is used by default

mdctl env export --env medable --format yaml

You can also specify where you want to export your org configurations

mdctl env export --env medable --format yaml --dir /User/my_user/exports/medable

It will create the folder if not present, if you don't set --dir it will use current location

Import Environment

Note: You must have a credential already set

If you don't specify any additional parameter it will try to export current default env set on credentials.

mdctl env import

but you can specify any other credential to use by using any of the arguments that is used by that credential like

--env filters by environment
--username filters by username
--endpoint filters by endpoint
--apiKey filters by apiKey

You can also specify where you want to take org configs from, by setting --dir option

mdctl env export --env medable  --dir /User/my_user/exports/medable

if you don't set --dir it will use current location and try to import from it.

Current Tags

  • 1.0.54                                ...           latest (2 months ago)

55 Versions

  • 1.0.54                                ...           2 months ago
  • 1.0.53                                ...           2 months ago
  • 1.0.52                                ...           2 months ago
  • 1.0.51                                ...           3 months ago
  • 1.0.50                                ...           3 months ago
  • 1.0.49                                ...           3 months ago
  • 1.0.48                                ...           3 months ago
  • 1.0.47                                ...           3 months ago
  • 1.0.46                                ...           4 months ago
  • 1.0.45                                ...           4 months ago
  • 1.0.44                                ...           4 months ago
  • 1.0.43                                ...           5 months ago
  • 1.0.42                                ...           5 months ago
  • 1.0.41                                ...           5 months ago
  • 1.0.40                                ...           5 months ago
  • 1.0.39                                ...           5 months ago
  • 1.0.38                                ...           6 months ago
  • 1.0.37                                ...           6 months ago
  • 1.0.36                                ...           6 months ago
  • 1.0.35                                ...           6 months ago
  • 1.0.34                                ...           7 months ago
  • 1.0.33                                ...           7 months ago
  • 1.0.32                                ...           7 months ago
  • 1.0.31                                ...           8 months ago
  • 1.0.30                                ...           8 months ago
  • 1.0.29                                ...           8 months ago
  • 1.0.28                                ...           8 months ago
  • 1.0.27                                ...           8 months ago
  • 1.0.26                                ...           9 months ago
  • 1.0.25                                ...           9 months ago
  • 1.0.24                                ...           9 months ago
  • 1.0.23                                ...           9 months ago
  • 1.0.22                                ...           10 months ago
  • 1.0.21                                ...           10 months ago
  • 1.0.20                                ...           a year ago
  • 1.0.19                                ...           a year ago
  • 1.0.18                                ...           a year ago
  • 1.0.17                                ...           a year ago
  • 1.0.16                                ...           a year ago
  • 1.0.15                                ...           a year ago
  • 1.0.14                                ...           a year ago
  • 1.0.13                                ...           a year ago
  • 1.0.12                                ...           a year ago
  • 1.0.11                                ...           a year ago
  • 1.0.10                                ...           a year ago
  • 1.0.9                                ...           a year ago
  • 1.0.8                                ...           a year ago
  • 1.0.7                                ...           a year ago
  • 1.0.6                                ...           a year ago
  • 1.0.5                                ...           a year ago
  • 1.0.4                                ...           a year ago
  • 1.0.3                                ...           a year ago
  • 1.0.2                                ...           a year ago
  • 1.0.1                                ...           a year ago
  • 1.0.0                                ...           a year ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 26
Dev Dependencies (12)
Dependents (1)

Copyright 2014 - 2016 © taobao.org |