Atlas CLI — thin wrapper around the Atlas runtime.
Provides a terminal interface that mirrors the MCP tool's single-string
input model. All routing goes through the same Atlas runtime class used
by the MCP server.
Usage
atlas # e.g. "atlas python", "atlas init", "atlas add ruff"
atlas # prints current status / help
defrun(raw:str,project_dir:str|None=None)->int:"""Parse *raw*, route to Atlas, print the result. Returns 0 on success, 1 on error. """atlas=Atlas(project_dir)parsed=parse_input(raw)ifparsed.verbisNone:result=atlas.query(parsed.contexts,parsed.message)elifparsed.verb=="init":result=atlas.init(parsed.args)elifparsed.verb=="add":result=atlas.add_modules(parsed.args)elifparsed.verbin("create","edit","remove")andparsed.resource_type:result=atlas.manage_resource(parsed.verb,parsed.resource_type,parsed.args)elifparsed.verb=="remove":result=atlas.remove_module(parsed.args[0]ifparsed.argselse"")elifparsed.verb=="list":result=atlas.list_resources(parsed.args[0]ifparsed.argselse"all")elifparsed.verb=="just":result=atlas.just(parsed.args[0]ifparsed.argselse"",parsed.args[1:],)elifparsed.verb=="vcs":result=atlas.vcs(parsed.args)elifparsed.verb=="crud":result=atlas.crud(parsed.args)elifparsed.verb=="sync":result=atlas.sync(parsed.args)else:result=error_result("INVALID_ARGUMENT",f"Unknown verb: {parsed.verb}")_print_result(result)ifisinstance(result,dict)andresult.get("ok")isFalse:return1return0
defmain()->None:"""Console script entry point: ``atlas``."""# Join all CLI arguments as a single space-separated string,# matching the MCP tool's single-string-input model.raw=" ".join(sys.argv[1:])sys.exit(run(raw))