cli-agent Setup npm install cli-agent --save-dev Using // @see testsconst interaction = new CLIAgent(/* path to program */);let year;const result = await interaction.wait(/hello/i) .wait(/question/i) .send('2014\n') .wait(/year is (\d+)/, (matches) => { year = matches[1]; }) .start();