add support for interactive mode

Solves #12210