diff --git a/cli.js b/cli.js
index <HASH>..<HASH> 100755
--- a/cli.js
+++ b/cli.js
@@ -23,6 +23,7 @@ var optimist = require('optimist')
 
 var couchjs = require('./couchjs')
 var console = require('./console')
+var LineStream = require('./stream')
 
 var INPUT = { 'waiting': false
             , 'queue'  : []
@@ -54,11 +55,13 @@ function main() {
     if(er)
       throw er
 
+    var stdin = new LineStream
+    stdin.on('data', couchjs.stdin)
+
     process.stdin.setEncoding('utf8')
-    process.stdin.on('data', couchjs.stdin)
+    process.stdin.pipe(stdin)
     process.stdin.resume()
 
-
     ; [Error, Function].forEach(function(type) {
       type.prototype.toSource = type.prototype.toSource || toSource
       type.prototype.toString = type.prototype.toString || toSource
Pipe stdin through the LineStream