If you have root-level access to the server you can follow this guide to install WP CLI on your WHM/cPanel server: https://blog.cpanel.com/wp-cli-install-and-manage-wordpress-on-the-command-line/
If you don’t have access to the root account nor can run sudo, but still have a user/level access to the terminal like from the cPanel terminal let’s say, then you can still install and use wp-cli.
cd /home/USERNAME/public_html/ curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar chmod +x wp-cli.phar
and then use the full path to the wp-cli.phar file:
/home/USERNAME/public_html/wp-cli.phar config list
- USERNAME – is your cPanel username
- /home/USERNAME/public_html/ – is the path to your WordPress installation
- config list – is an example command for WP-CLI