cli: flush output on write