The input string represents the literal command entered in the terminal, like some-command --flag --arg1=0 --arg2 'TEXT 1' --arg3="TEXT WITH SPACE".
Is there a tool that can split this to an array of strings (like process.argv)?
Then the result can be passed to a command line parser package (like commander.js) and some logic will be implemented there.