[BZ-1054313] implement CommandBasedEntryPoint
(cherry picked from commit 823eacefdf0fc264f02864fcd94902e8053371d1)