func Tesses.CrossLang.Shell.Tool(dd)
{
    var dir = Env.CrossLangConfig / "Tools";
    if(dd.Arguments.Length == 1)
    {
        Console.WriteLine("List of tools:");
		if(FS.Local.DirectoryExists(dir))
        each(var item : FS.Local.EnumeratePaths(dir))
        {
            Console.WriteLine(Tesses.CrossLang.GetNameAndDescription(item / item.GetFileName() + ".crvm"));
        }
        return 0;
    }
	else if(dd.Arguments.Length >= 2)
	{
		var toolname = dd.Arguments[1];
		var toolpath = dir / toolname / toolname + ".crvm";

		if(FS.Local.FileExists(toolpath))
		{
		
    		var env = VM.CreateEnvironment({});
		    env.RegisterEverything();
    		env.LockRegister();

	    	env.LoadFileWithDependencies(FS.Local,toolpath);
	    	var myArgs = [];
		    for(var i = 2; i < dd.Arguments.Count; i++)
    		{
    	    	myArgs.Add(dd.Arguments[i]);
		    }
    		return env.GetDictionary().RunTool({
	    	    Arguments=myArgs,
    	    	Options = dd.Options,
	        	Flags = dd.Flags,
		        ToolName = toolname
    		});
		}
		else {
			Console.WriteLine($"Could not find tool with name {toolname}.");
			return 1;
		}
	}

}