Implement the "variable" CLI command

fixes #7370