|
| 1 | +@contentstack/cli-auth |
| 2 | +=== |
| 3 | + |
| 4 | +Authenticate yourself with the CLI |
| 5 | + |
| 6 | +[](https://oclif.io) |
| 7 | +[](https://npmjs.org/package/cli) |
| 8 | +[](https://npmjs.org/package/cli) |
| 9 | +[](https://github.com/contentstack/cli/blob/master/package.json) |
| 10 | + |
| 11 | +<!-- toc --> |
| 12 | +* [Usage](#usage) |
| 13 | +* [Commands](#commands) |
| 14 | +<!-- tocstop --> |
| 15 | +# Usage |
| 16 | +<!-- usage --> |
| 17 | +```sh-session |
| 18 | +$ npm install -g @contentstack/cli-auth |
| 19 | +$ csdx COMMAND |
| 20 | +running command... |
| 21 | +$ csdx (-v|--version|version) |
| 22 | +@contentstack/cli-auth/0.0.1 darwin-x64 node-v10.19.0 |
| 23 | +$ csdx --help [COMMAND] |
| 24 | +USAGE |
| 25 | + $ csdx COMMAND |
| 26 | +... |
| 27 | +``` |
| 28 | +<!-- usagestop --> |
| 29 | +# Commands |
| 30 | +<!-- commands --> |
| 31 | +* [`csdx auth:login`](#csdx-authlogin) |
| 32 | +* [`csdx auth:logout`](#csdx-authlogout) |
| 33 | +* [`csdx auth:tokens`](#csdx-authtokens) |
| 34 | +* [`csdx auth:tokens:add`](#csdx-authtokensadd) |
| 35 | +* [`csdx auth:tokens:remove`](#csdx-authtokensremove) |
| 36 | +* [`csdx auth:whoami`](#csdx-authwhoami) |
| 37 | + |
| 38 | +## `csdx auth:login` |
| 39 | + |
| 40 | +Login to Contentstack and save the session for further use |
| 41 | + |
| 42 | +``` |
| 43 | +USAGE |
| 44 | + $ csdx auth:login |
| 45 | +
|
| 46 | +OPTIONS |
| 47 | + -u, --username=username Email address of your Contentstack account |
| 48 | +
|
| 49 | +ALIASES |
| 50 | + $ csdx login |
| 51 | +``` |
| 52 | + |
| 53 | +_See code: [src/commands/auth/login.js](https://github.com/contentstack/cli/blob/v0.0.1/src/commands/auth/login.js)_ |
| 54 | + |
| 55 | +## `csdx auth:logout` |
| 56 | + |
| 57 | +Log out from Contentstack and clear the session |
| 58 | + |
| 59 | +``` |
| 60 | +USAGE |
| 61 | + $ csdx auth:logout |
| 62 | +
|
| 63 | +OPTIONS |
| 64 | + -f, --force Exclude confirmation to logout |
| 65 | +
|
| 66 | +ALIASES |
| 67 | + $ csdx logout |
| 68 | +``` |
| 69 | + |
| 70 | +_See code: [src/commands/auth/logout.js](https://github.com/contentstack/cli/blob/v0.0.1/src/commands/auth/logout.js)_ |
| 71 | + |
| 72 | +## `csdx auth:tokens` |
| 73 | + |
| 74 | +Use to list all existing management tokens |
| 75 | + |
| 76 | +``` |
| 77 | +USAGE |
| 78 | + $ csdx auth:tokens |
| 79 | +
|
| 80 | +OPTIONS |
| 81 | + -x, --extended show extra columns |
| 82 | + --columns=columns only show provided columns (comma-separated) |
| 83 | + --csv output is csv format [alias: --output=csv] |
| 84 | + --filter=filter filter property by partial string matching, ex: name=foo |
| 85 | + --no-header hide table header from output |
| 86 | + --no-truncate do not truncate output to fit screen |
| 87 | + --output=csv|json|yaml output in a more machine friendly format |
| 88 | + --sort=sort property to sort by (prepend '-' for descending) |
| 89 | +
|
| 90 | +ALIASES |
| 91 | + $ csdx tokens |
| 92 | +``` |
| 93 | + |
| 94 | +_See code: [src/commands/auth/tokens/index.js](https://github.com/contentstack/cli/blob/v0.0.1/src/commands/auth/tokens/index.js)_ |
| 95 | + |
| 96 | +## `csdx auth:tokens:add` |
| 97 | + |
| 98 | +Adds management/delivery tokens to your session to use it with further Contentstack/CLI command |
| 99 | + |
| 100 | +``` |
| 101 | +USAGE |
| 102 | + $ csdx auth:tokens:add |
| 103 | +
|
| 104 | +OPTIONS |
| 105 | + -a, --alias=alias |
| 106 | + -d, --delivery Set this while saving delivery token |
| 107 | + -e, --environment=environment Environment name for delivery token |
| 108 | + -f, --force Exclude confirmation to replace existing alias |
| 109 | + -k, --api-key=api-key Stack API key for the token |
| 110 | + -m, --management Set this while saving management token |
| 111 | +
|
| 112 | + -t, --token=token Sets token. Can be set via environment variable 'TOKEN'. We recommend to use env |
| 113 | + variable |
| 114 | +
|
| 115 | +DESCRIPTION |
| 116 | + by default it adds management token if either of management or delivery flags are not set |
| 117 | +
|
| 118 | +ALIASES |
| 119 | + $ csdx tokens:add |
| 120 | +``` |
| 121 | + |
| 122 | +_See code: [src/commands/auth/tokens/add.js](https://github.com/contentstack/cli/blob/v0.0.1/src/commands/auth/tokens/add.js)_ |
| 123 | + |
| 124 | +## `csdx auth:tokens:remove` |
| 125 | + |
| 126 | +Removes stored tokens |
| 127 | + |
| 128 | +``` |
| 129 | +USAGE |
| 130 | + $ csdx auth:tokens:remove |
| 131 | +
|
| 132 | +OPTIONS |
| 133 | + -a, --alias=alias Alias (name) of the token to remove |
| 134 | +
|
| 135 | + -i, --ignore Ignores if token not present. Command shows show list of available aliases with multi select option |
| 136 | + to delete tokens from that list. |
| 137 | +
|
| 138 | +ALIASES |
| 139 | + $ csdx tokens:remove |
| 140 | +``` |
| 141 | + |
| 142 | +_See code: [src/commands/auth/tokens/remove.js](https://github.com/contentstack/cli/blob/v0.0.1/src/commands/auth/tokens/remove.js)_ |
| 143 | + |
| 144 | +## `csdx auth:whoami` |
| 145 | + |
| 146 | +Display current users email address |
| 147 | + |
| 148 | +``` |
| 149 | +USAGE |
| 150 | + $ csdx auth:whoami |
| 151 | +
|
| 152 | +ALIASES |
| 153 | + $ csdx whoami |
| 154 | +``` |
| 155 | + |
| 156 | +_See code: [src/commands/auth/whoami.js](https://github.com/contentstack/cli/blob/v0.0.1/src/commands/auth/whoami.js)_ |
| 157 | +<!-- commandsstop --> |
0 commit comments