<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def run_shell(args: dict) -> int: """Run the shell sub command"""


    if args.get('project_directory'):
        return run_batch(args)

    shell = CauldronShell()

    if in_project_directory():
        shell.cmdqueue.append('open "{}"'.format(os.path.realpath(os.curdir)))

    shell.cmdloop()
    return 0