refactor(core) pass cwd as option