|
| 1 | +# Authentication Commands |
| 2 | + |
| 3 | +Use these commands to initialize wallet mode, sign in, inspect authentication status, and clear local session state. |
| 4 | + |
| 5 | +## `init` Command |
| 6 | + |
| 7 | +Initialize the project by selecting wallet mode and trading mode. |
| 8 | + |
| 9 | +### Syntax |
| 10 | + |
| 11 | +```bash |
| 12 | +mm-dev init [--wallet <mode>] [--mode <mode>] [--mnemonic <phrase>] [--password <password>] |
| 13 | +``` |
| 14 | + |
| 15 | +### Supported Flags |
| 16 | + |
| 17 | +| Name | Required | Description | |
| 18 | +| ------------ | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | |
| 19 | +| `--wallet` | No | Wallet mode: `server-wallet` or `byok` | |
| 20 | +| `--mode` | No | Trading mode: `guard` or `beast` (server-wallet only) | |
| 21 | +| `--mnemonic` | No | BIP-39 mnemonic phrase for BYOK wallet. Never pass inline — set `MM_MNEMONIC` env var instead. | |
| 22 | +| `--password` | No | Password to encrypt the BYOK mnemonic at rest. Never pass inline — set `MM_PASSWORD` env var instead. If omitted in interactive mode, the CLI prompts. If omitted in non-interactive mode, mnemonic is stored unencrypted. | |
| 23 | + |
| 24 | +### Example |
| 25 | + |
| 26 | +```bash |
| 27 | +mm-dev init |
| 28 | +mm-dev init --wallet server-wallet --mode beast |
| 29 | +export MM_MNEMONIC="word1 word2 ..." |
| 30 | +mm-dev init --wallet byok |
| 31 | + |
| 32 | +export MM_MNEMONIC="word1 word2 ..." |
| 33 | +export MM_PASSWORD="mypassword" |
| 34 | +mm-dev init --wallet byok |
| 35 | +``` |
| 36 | + |
| 37 | +## `init show` Command |
| 38 | + |
| 39 | +Display the current initialization settings (wallet mode, trading mode, policies). |
| 40 | + |
| 41 | +### Syntax |
| 42 | + |
| 43 | +```bash |
| 44 | +mm-dev init show |
| 45 | +``` |
| 46 | + |
| 47 | +### Supported Flags |
| 48 | + |
| 49 | +This command does not support additional flags beyond output format options. |
| 50 | + |
| 51 | +### Example |
| 52 | + |
| 53 | +```bash |
| 54 | +mm-dev init show |
| 55 | +``` |
| 56 | + |
| 57 | +## `login` Command |
| 58 | + |
| 59 | +Sign in to the CLI. Defaults to QR / browser flow. |
| 60 | + |
| 61 | +### Syntax |
| 62 | + |
| 63 | +```bash |
| 64 | +mm-dev login [qr | google | email] [--token <token>] [--timeout <seconds>] [--no-wait] |
| 65 | +``` |
| 66 | + |
| 67 | +### Supported Flags |
| 68 | + |
| 69 | +| Name | Required | Description | |
| 70 | +| ----------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | |
| 71 | +| `--token` | No | Pre-minted CLI token in `cliToken:cliRefreshToken` format [env: `MM_CLI_TOKEN`] | |
| 72 | +| `--timeout` | No | Seconds to wait for QR or browser callback | |
| 73 | +| `--no-wait` | No | Print the sign-in URL and exit without waiting (for non-interactive/CI use). Not supported with QR login. Complete later with `mm-dev login --token` | |
| 74 | + |
| 75 | +### Example |
| 76 | + |
| 77 | +```bash |
| 78 | +mm-dev login --no-wait |
| 79 | +mm-dev login qr |
| 80 | +mm-dev login google --no-wait |
| 81 | +mm-dev login email --no-wait |
| 82 | +mm-dev login --token "cliToken:cliRefreshToken" |
| 83 | +``` |
| 84 | + |
| 85 | +### Note |
| 86 | + |
| 87 | +Use `--no-wait` for non-interactive mode except QR flow. It prints the sign-in URL and exits immediately; complete authentication later with `mm-dev login --token`. |
| 88 | + |
| 89 | +## `auth status` Command |
| 90 | + |
| 91 | +Show the current authentication status. |
| 92 | + |
| 93 | +### Syntax |
| 94 | + |
| 95 | +```bash |
| 96 | +mm-dev auth status [--toon] |
| 97 | +``` |
| 98 | + |
| 99 | +### Supported Flags |
| 100 | + |
| 101 | +This command does not support additional flags beyond output format options. |
| 102 | + |
| 103 | +### Example |
| 104 | + |
| 105 | +```bash |
| 106 | +mm-dev auth status |
| 107 | +mm-dev auth status --toon |
| 108 | +``` |
| 109 | + |
| 110 | +## `logout` Command |
| 111 | + |
| 112 | +Sign out and clear auth credentials while keeping settings. |
| 113 | + |
| 114 | +### Syntax |
| 115 | + |
| 116 | +```bash |
| 117 | +mm-dev logout |
| 118 | +``` |
| 119 | + |
| 120 | +### Supported Flags |
| 121 | + |
| 122 | +This command does not support flags. |
| 123 | + |
| 124 | +### Example |
| 125 | + |
| 126 | +```bash |
| 127 | +mm-dev logout |
| 128 | +``` |
| 129 | + |
| 130 | +## `reset` Command |
| 131 | + |
| 132 | +Clear the local CLI session entirely. |
| 133 | + |
| 134 | +### Syntax |
| 135 | + |
| 136 | +```bash |
| 137 | +mm-dev reset |
| 138 | +``` |
| 139 | + |
| 140 | +### Supported Flags |
| 141 | + |
| 142 | +This command does not support flags. |
| 143 | + |
| 144 | +### Example |
| 145 | + |
| 146 | +```bash |
| 147 | +mm-dev reset |
| 148 | +``` |
| 149 | + |
| 150 | +## `wallet password set` Command |
| 151 | + |
| 152 | +Set a password to encrypt the BYOK mnemonic at rest. Only available in BYOK mode when the mnemonic is currently unencrypted. |
| 153 | + |
| 154 | +### Syntax |
| 155 | + |
| 156 | +```bash |
| 157 | +mm-dev wallet password set [--new <password>] |
| 158 | +``` |
| 159 | + |
| 160 | +### Supported Flags |
| 161 | + |
| 162 | +| Name | Required | Description | |
| 163 | +| ------- | -------- | -------------------------------------------------------- | |
| 164 | +| `--new` | No | New password. If omitted, the CLI prompts interactively. | |
| 165 | + |
| 166 | +### Example |
| 167 | + |
| 168 | +```bash |
| 169 | +mm-dev wallet password set |
| 170 | +mm-dev wallet password set --new "mypassword" |
| 171 | +``` |
| 172 | + |
| 173 | +## `wallet password change` Command |
| 174 | + |
| 175 | +Change the BYOK mnemonic encryption password. Only available when the mnemonic is currently encrypted. |
| 176 | + |
| 177 | +### Syntax |
| 178 | + |
| 179 | +```bash |
| 180 | +mm-dev wallet password change [--current <password>] [--new <password>] |
| 181 | +``` |
| 182 | + |
| 183 | +### Supported Flags |
| 184 | + |
| 185 | +| Name | Required | Description | |
| 186 | +| ----------- | -------- | ------------------------------------------------------------ | |
| 187 | +| `--current` | No | Current password. If omitted, the CLI prompts interactively. | |
| 188 | +| `--new` | No | New password. If omitted, the CLI prompts interactively. | |
| 189 | + |
| 190 | +### Example |
| 191 | + |
| 192 | +```bash |
| 193 | +mm-dev wallet password change |
| 194 | +mm-dev wallet password change --current "oldpassword" --new "newpassword" |
| 195 | +``` |
| 196 | + |
| 197 | +## `wallet password remove` Command |
| 198 | + |
| 199 | +Remove the BYOK mnemonic encryption password, storing the mnemonic as plaintext. Only available when the mnemonic is currently encrypted. |
| 200 | + |
| 201 | +### Syntax |
| 202 | + |
| 203 | +```bash |
| 204 | +mm-dev wallet password remove [--current <password>] |
| 205 | +``` |
| 206 | + |
| 207 | +### Supported Flags |
| 208 | + |
| 209 | +| Name | Required | Description | |
| 210 | +| ----------- | -------- | ------------------------------------------------------------ | |
| 211 | +| `--current` | No | Current password. If omitted, the CLI prompts interactively. | |
| 212 | + |
| 213 | +### Example |
| 214 | + |
| 215 | +```bash |
| 216 | +mm-dev wallet password remove |
| 217 | +mm-dev wallet password remove --current "mypassword" |
| 218 | +``` |
| 219 | + |
| 220 | +## Wallet Modes |
| 221 | + |
| 222 | +| Mode | Behavior | |
| 223 | +| --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | |
| 224 | +| `server-wallet` | Keys hosted by MetaMask infrastructure. Signing and transaction operations may return async job handles. | |
| 225 | +| `byok` | Bring your own local mnemonic. Operation results are returned immediately. If the mnemonic is encrypted with a password, the CLI requires `--password` or interactive prompt to unlock before any operation that needs the private key. | |
0 commit comments