{"id":19453416,"url":"https://github.com/barionlp/commandsystem","last_synced_at":"2025-09-11T09:34:23.062Z","repository":{"id":190787673,"uuid":"658852000","full_name":"BarionLP/CommandSystem","owner":"BarionLP","description":"An automated and extendable command system as Unity package","archived":false,"fork":false,"pushed_at":"2025-04-20T07:58:49.000Z","size":69,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-21T23:11:19.121Z","etag":null,"topics":["csharp","dotnet","unity"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BarionLP.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-06-26T16:09:16.000Z","updated_at":"2025-04-20T07:58:53.000Z","dependencies_parsed_at":"2024-01-09T14:32:22.759Z","dependency_job_id":"ccbc0087-d6b9-4a4b-93c1-aa0879b779df","html_url":"https://github.com/BarionLP/CommandSystem","commit_stats":null,"previous_names":["barionlp/commandsystem"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/BarionLP/CommandSystem","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BarionLP%2FCommandSystem","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BarionLP%2FCommandSystem/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BarionLP%2FCommandSystem/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BarionLP%2FCommandSystem/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BarionLP","download_url":"https://codeload.github.com/BarionLP/CommandSystem/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BarionLP%2FCommandSystem/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274609465,"owners_count":25316621,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-11T02:00:13.660Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["csharp","dotnet","unity"],"created_at":"2024-11-10T17:04:24.637Z","updated_at":"2025-09-11T09:34:23.018Z","avatar_url":"https://github.com/BarionLP.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Command System\nA system for calling funcions via text input \n(made for Unity, can be used outside)\n\n## Usage (Unity)\n- (optional) install UpmGitExtension package (https://github.com/mob-sakai/UpmGitExtension.git)\n- install Command Sytem package (https://github.com/BarionLP/CommandSystem.git)\n\n### Run Commands\n```csharp\nCommandManager.Execute(\"command\");\n```\n\n### Set Logger\n```csharp\nCommandManager.SetLogger(new UnityDebugCommandLogger()); //print logs in the unity console\n\n// Custom Logger\npublic class CustomLogger : ICommandLogger\n{\n  public void Log(string message) =\u003e Debug.Log(message);\n  public void LogWarning(string message) =\u003e Debug.LogWarning(message);\n  public void LogError(string message) =\u003e Debug.LogError(message);\n}\n```\n\n### Simple Commands\n```csharp\nCommandManager.Commands.Register(new SimpleCommand(\"test\", ()-\u003e{\n  //Do something\n\n  //Log\n  CommandManager.Log();\n  CommandManager.LogWarning();\n  CommandManager.LogError();\n}));\n```\n\n### Advanced Commands\n```csharp\n//register static methods with the Command attribute\n// atomatically generates syntax hints\nCommandManager.Commands.Register\u003cTestCommands\u003e();\n\n//register command \"cmd\" with the methods as subcommands (e.g. \"cmd add 4 2\")\nCommandManager.Commands.RegisterGroup\u003cTestCommands\u003e(\"cmd\");\n\npublic class TestCommands\n{\n  [Command(\"add\")] //automatically parses primitive arguments\n  public static void Add(int left, int right) =\u003e CommandManager.Log($\"{left} + {right} is {left+right}\");\n        \n  [Command(\"wait\")] // supports async\n  public static async Task Test(float seconds) =\u003e await Task.Delay((int)(seconds*1000));\n        \n  [Command(\"give\")] //other objects require custom parsers (see below)\n  public static void GiveItem(Item item) =\u003e Player.Give(item);\n}\n```\n\n### Parsers\n```csharp\n//has built in parsers for most primitives (float, int, uint, short, ...) see in `ArgumentParser.cs`\n\nArgumentParsers.Register\u003cCustomType\u003e(new CustomParser()); // register a custom parser\nArgumentParsers.Register\u003cCustomEnum\u003e(new EnumArgumentParser\u003cCustomEnum\u003e()); //generates an enum parser (parses by name)\n\npublic class CustomParser : IArgumentParser\u003cCustomType\u003e\n{\n  public CustomType Parse(ReadOnlySpan\u003cchar\u003e raw) =\u003e //however you want, e.g. from a registry (`null` if fails)\n  public IEnumerable\u003cstring\u003e GetSuggestions() =\u003e Enumerable.Empty\u003cstring\u003e(); //or all possible values\n}\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbarionlp%2Fcommandsystem","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbarionlp%2Fcommandsystem","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbarionlp%2Fcommandsystem/lists"}