A credential tells MMT how to connect to a store: its JSON API URL plus either an API token and signing key, or an admin user’s SSH key. Credentials are stored in your user profile (~/.mmt/config.json).
mmt credential list#
Lists your credentials. API tokens are printed in plain text; passwords and signing keys aren’t.
mmt credential list
This command takes no arguments.
mmt credential add#
Adds a credential. Give either --token and --signing-key, or --ssh-username and --ssh-private-key, not both. Add --http-basic-auth-username if the store is behind HTTP basic authentication; MMT asks for the password if you leave out --http-basic-auth-password.
mmt credential add --url URL [--http-basic-auth-username HTTP_BASIC_AUTH_USERNAME] [--http-basic-auth-password HTTP_BASIC_AUTH_PASSWORD] [--token TOKEN] [--signing-key SIGNING_KEY] [--ssh-username SSH_USERNAME] [--ssh-private-key SSH_PRIVATE_KEY] key
| Argument | Short | Required | Description |
|---|---|---|---|
--url URL |
-u |
Yes | Your store’s JSON API endpoint, for example https://www.example.com/mm5/json.mvc. |
--http-basic-auth-username HTTP_BASIC_AUTH_USERNAME |
-m |
No | HTTP Basic Authentication username. |
--http-basic-auth-password HTTP_BASIC_AUTH_PASSWORD |
-w |
No | HTTP Basic Authentication password (if the username argument is present and the password argument is omitted, you will be prompted for the password) |
--token TOKEN |
-t |
No | The API token used to make API requests. |
--signing-key SIGNING_KEY |
-s |
No | The API signing key used to sign API requests. |
--ssh-username SSH_USERNAME |
-n |
No | The Miva Merchant username associated with the SSH credential. |
--ssh-private-key SSH_PRIVATE_KEY |
-k |
No | The filepath to the SSH private key. |
key |
Yes | A name for this credential. Remotes refer to it by this name. |
Example:
mmt credential add -u https://www.example.com/mm5/json.mvc -t YOUR_TOKEN -s YOUR_SIGNING_KEY mystore
mmt credential add -u https://www.example.com/mm5/json.mvc -n admin_username -k ~/.ssh/miva_rsa mystore-ssh
mmt credential update#
Changes the fields you give. A credential can’t be switched between token and SSH; add a new one instead. An empty -m or -w value removes the HTTP basic authentication login.
mmt credential update [--credential-key CREDENTIAL_KEY] [--url URL] [--http-basic-auth-username HTTP_BASIC_AUTH_USERNAME] [--http-basic-auth-password HTTP_BASIC_AUTH_PASSWORD] [--token TOKEN] [--signing-key SIGNING_KEY] [--ssh-username SSH_USERNAME] [--ssh-private-key SSH_PRIVATE_KEY] key
| Argument | Short | Required | Description |
|---|---|---|---|
--credential-key CREDENTIAL_KEY |
-c |
No | Rename the credential. Remotes that use the old name aren’t updated. |
--url URL |
-u |
No | A new JSON API endpoint. |
--http-basic-auth-username HTTP_BASIC_AUTH_USERNAME |
-m |
No | HTTP Basic Authentication username. |
--http-basic-auth-password HTTP_BASIC_AUTH_PASSWORD |
-w |
No | HTTP Basic Authentication password (if the username argument is present and the password argument is omitted, you will be prompted for the password) |
--token TOKEN |
-t |
No | The API token used to make API requests. |
--signing-key SIGNING_KEY |
-s |
No | The API signing key used to sign API requests. |
--ssh-username SSH_USERNAME |
-n |
No | The Miva Merchant username associated with the SSH credential. |
--ssh-private-key SSH_PRIVATE_KEY |
-k |
No | The filepath to the SSH private key. |
key |
Yes | The credential to change. |
mmt credential delete#
Deletes a credential.
mmt credential delete key
| Argument | Short | Required | Description |
|---|---|---|---|
key |
Yes | Delete credential associated with the key. |
Credentials are stored in plain text
MMT writes API tokens, signing keys and HTTP basic authentication passwords to ~/.mmt/config.json unencrypted. For SSH, it stores the path to your private key, not the key. Keep the file private, and don’t copy it into a project folder or source control.
Renaming or deleting a credential doesn’t update remotes that use it. Update them with mmt remote update.