[Command] Move project directory logic to its own module