add cli tool
code formatting
fix some parse errors