To get started with working in the mabl CLI, follow these installation instructions:
- Check your Node version
- Install the mabl CLI
- Authenticate the mabl CLI
- Configure forwarding proxies (if needed)
Check your Node version
The mabl CLI is a Node.js package. Installation requires an actively supported Node.js LTS version, currently version 20 or higher. To check if Node is installed and view the current version, open your terminal or command prompt and run node -v
.
Install the mabl CLI
Run the following command to install the mabl CLI:
npm install -g @mablhq/mabl-cli
This command uses Node Package Manager (npm) to install the mabl CLI globally on your machine.
To confirm the mabl CLI is successfully installed, run mabl --version
. If the installation was successful, the mabl CLI should return the version of your CLI installation.
If the installation was not successful, see the troubleshooting article for tips on how to address common installation issues.
For more information on installing the mabl CLI in a CI environment, check out this article.
Authenticate the mabl CLI
To start using the mabl CLI, run the following command to authenticate:
mabl auth login
This command prompts the mabl CLI to open the mabl login page in a browser window. Take the following steps to complete authentication:
- Log into mabl using your usual method: username and password, Google auth, or SSO.
- Copy the authorization code from the browser window.
- Paste the authorization code in the mabl CLI.
- Press enter to finish logging in.
Run the following command to confirm whether you are successfully authenticated:
mabl auth info Logged in as user [john@company.com] Login expires in [3 hours, 23 minutes]
To explore commands, run mabl -h
. Add the -h
option to any command to learn more about it. If you’re new to CLI tools, check out this article for a more detailed walkthrough on how mabl CLI commands work.
Configure forwarding proxies
If you’re using the mabl CLI in a network that uses a forward proxy, you can use the mabl config
command to set up forwarding proxies.
# add a proxy with no credentials on port 3128 mabl config set http.proxy http://proxy.mycompany.com:3128 # add a proxy using credentials on port 3128 mabl config set http.proxy http://“username:password”@proxy.mycompany.com:3128 # delete the current proxy setting mabl config delete http.proxy
If you receive an error that the URL you are specifying is invalid, please confirm that you are using Node.js version 20 or greater. If you receive a 407 error when logging in, this is a proxy authentication error. Ensure your password and username have been set correctly above.
Depending on the type of proxy, you can also add the following configuration settings using mabl config set
:
Option | Description | Default value |
http.proxyMode | Specify which traffic should use the proxy | mabl |
http.sslVerify | Enable of disable SSL verification | true |
http.proxyType | Specify which proxy implementation to use | legacy |
Unset values use the default
If a configuration option is not set, it will appear in the mabl config list table as — and use the default value(s) which are listed in the previous table.
Similarly, if you remove a proxy config value with the command mabl config delete, the option will appear as unset (—) and use the default values.
http.proxyMode
By default, only mabl-specific requests will go through the forwarding proxy. You can use the http.proxyMode
config flag to specify which traffic to apply the proxy on.
http.proxyMode | description |
mabl | Applies to mabl traffic only (default setting) |
test | Applies to test traffic only |
all | Applies to both mabl and test traffic |
none | Do not apply the proxy at all. |
Changing the proxy mode
http.proxyMode none
could be useful for testing proxy settings or to turn off a proxy when switching work environments (e.g. office vs. home).
http.sslVerify
By default, the CLI verifies server certificates are issued by a known certificate authority. Certificate verification may fail if your proxy is intercepting HTTPS traffic. If you are using a proxy and SSL verification is failing, you can disable certificate verification as shown below. We suggest you do this only if required.
# disable SSL verification mabl config set http.sslVerify false # delete the current ssl verification setting to use the default mabl config delete http.sslVerify
http.proxyType
There is a known issue with the legacy proxy library that prevents it from honoring the http.sslVerify setting. Instead, it will always verify the SSL certificates, causing errors with proxies that use self-signed certificates. To address this issue, we have added a new proxy implementation with the correct certificate validation behavior. The http.proxyType setting lets you switch between these different proxy implementations. The accepted values are current and legacy (default).
- current: the proxy library that correctly implements the http.sslVerify flag.
- legacy: the existing proxy implementation; does not respect the http.sslVerify flag.
We suggest using the current setting in all cases and only falling back to the legacy setting if the current setting does not work with your proxy configuration.
System requirements
We don’t currently support running the CLI from the Windows Subsystem for Linux (WSL).
Uninstalling the CLI
To remove the mabl CLI, run the following command:
npm remove -g @mablhq/mabl-cli