minor detect realm and env from current directory