If you call SQLCLI in multiple line mode, SQLCLI stores all commands in an internal command buffer.
More information: Multiple Line Mode
Displaying the contents of the command buffer: \p
Deleting the contents of the command buffer: \r
Executing the command buffer: \g