```ruby
# encoding: utf-8

require 'tty-command'

cmd = TTY::Command.new

stdin = StringIO.new
stdin.puts "hello"
stdin.puts "world"
stdin.rewind

out, _ = cmd.run(:cat, :in => stdin)

puts "#{out}"
```

Change example to use cli exec
user
```ruby
# encoding: utf-8

require 'tty-command'
require 'pathname'

cli = Pathname.new('examples/cli.rb')
cmd = TTY::Command.new

stdin = StringIO.new
stdin.puts "hello"
stdin.puts "world"
stdin.rewind

out, _ = cmd.run(cli, :in => stdin)

puts "#{out}"
```
assistant