support the missing commands and improved the stability, and test code cover the
code, baed on `pytest`.