Key count command implementation.
Execute the command and return the output string.
Error if the command fails
Key count command implementation.