I have a sample script which is doing a custom CLI command
import pexpect child = pexpect.spawn(\'kubectl login --server=\'+ cluster +\' --insecure-skip-t