Add cli, support buffer