In my automated environment, I launch a 'DUT object' that is mapped to the device being tested...I communicate with the CLI, etc all through this object.
This object gets created whenever I launch a config using a proc called 'readTestConfig'...this reads the config file, and spawns the DUT...