{"id":13728848,"url":"https://github.com/Voltstro-Studios/UnityCommandLineParser","last_synced_at":"2025-05-08T01:30:23.317Z","repository":{"id":106360078,"uuid":"294947836","full_name":"Voltstro-Studios/UnityCommandLineParser","owner":"Voltstro-Studios","description":"Simple command line argument parser for Unity","archived":false,"fork":false,"pushed_at":"2022-08-12T10:11:32.000Z","size":207,"stargazers_count":41,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-30T00:04:39.472Z","etag":null,"topics":["commandlineparser","csharp","unity","unity-package","unity-script","unity-scripts","unity2d","unity3d"],"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/Voltstro-Studios.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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}},"created_at":"2020-09-12T13:19:45.000Z","updated_at":"2024-10-21T19:37:12.000Z","dependencies_parsed_at":null,"dependency_job_id":"9de89729-6bc4-41c5-81eb-26371a526872","html_url":"https://github.com/Voltstro-Studios/UnityCommandLineParser","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Voltstro-Studios%2FUnityCommandLineParser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Voltstro-Studios%2FUnityCommandLineParser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Voltstro-Studios%2FUnityCommandLineParser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Voltstro-Studios%2FUnityCommandLineParser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Voltstro-Studios","download_url":"https://codeload.github.com/Voltstro-Studios/UnityCommandLineParser/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252981355,"owners_count":21835413,"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","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":["commandlineparser","csharp","unity","unity-package","unity-script","unity-scripts","unity2d","unity3d"],"created_at":"2024-08-03T02:00:51.248Z","updated_at":"2025-05-08T01:30:23.031Z","avatar_url":"https://github.com/Voltstro-Studios.png","language":"C#","readme":"# UnityCommandLineParser\n\n[![License](https://img.shields.io/github/license/Voltstro-Studios/UnityCommandLineParser.svg)](/LICENSE)\n[![Discord](https://img.shields.io/badge/Discord-Voltstro-7289da.svg?logo=discord)](https://discord.voltstro.dev) \n[![YouTube](https://img.shields.io/badge/Youtube-Voltstro-red.svg?logo=youtube)](https://www.youtube.com/Voltstro)\n\nA command line parser for Unity.\n\nOne of the issues that plague most C# command line parsers is that they are designed to be run from `Program.Main(string[] args);` and basically take over as the entry point of your C# app. However, Unity doesn't have the standard C# entry point. So we created this project, a command line parser for Unity that is easy to use.\n\nThis project uses [McMaster.Extensions.CommandLineUtils](https://github.com/natemcmaster/CommandLineUtils) as its underlying parsing library and provides attributes to mark fields that can be filled out by an argument. You can use any field type that [CommandLineUtils](https://github.com/natemcmaster/CommandLineUtils/blob/main/src/CommandLineUtils/Abstractions/ValueParserProvider.cs) supports by default.\n\n## Features\n\n- Parses launch arguments when the player is launched.\n- Supports commands and arguments\n\n## Getting Started\n\n### Package Installation\n\n#### Prerequisites\n\n```\nUnity 2020.3.x\n```\n\n### Installation Methods\n\nThere are three main sources on how you can install this package. Pick which ever one suites you the best!\n\n#### Voltstro UPM\n\nYou can install this package from our custom UPM registry. To setup our registry, see [here](https://github.com/Voltstro/VoltstroUPM#setup).\n\nOnce you have the registry added to your project, you can install it like any other package via the package manager.\n\n#### OpenUPM\n\nYou can install this package via [OpenUPM](https://openupm.com/).\n\nTo install it, use their CLI:\n\n```bash\nopenupm-cli add dev.voltstro.unitycommandlineparser\n```\n\n#### Git\n\nTo install it via the package manager with git you will need to:\n\n1. Setup [UnityNuGet](https://github.com/xoofx/UnityNuGet#unitynuget-)\n2. Open up the package manager via Windows **-\u003e** Package Manager\n3. Click on the little + sign **-\u003e** Add package from git URL...\n4. Type `https://github.com/Voltstro-Studios/UnityCommandLineParser.git` and add it\n5. Unity will now download and install the package\n\nPlease note that you will have to manually check for updates, and replace the hash (or tag version) in your project's `packages-lock.json` file.\n\n### Usage\n\nMark a static field with a `[CommandLineArgument]` attribute to be able to be set as a command line argument.\n\nOr you can mark a static method with a `[CommandLineCommand]` attribute to be able to run a method as a command line argument.\n\n#### Examples\n\n```csharp\n[CommandLineArgument(\"name\", \"Sets the name of the player\")]\npublic static string Name = \"Voltstro\";\n\n[CommandLineArgument(\"fps\", \"Sets the fps of the game.\")]\npublic static int Fps = 60;\n\n[CommandLineCommand(\"weapons\", \"Adds all default weapons to the player on load\")]\npublic static void AddDefaultWeapons()\n{\n     //Do some cool stuff\n}\n```\n\nIf this example was to be run with the commands: `./UnityPlayer -fps 420 -name \"EternalClickbait Suxs\" -weapons`, it would set the `Fps` variable to `420`, set the `Name` variable to `EternalClickbait Suxs` and run the method `AddDefaultWeapons()` on startup.\n\n## Authors\n\n**Voltstro** - *Initial Work* - [Voltstro](https://github.com/Voltstro)\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE.md](/LICENSE.md) file for details.\n","funding_links":[],"categories":["C#"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FVoltstro-Studios%2FUnityCommandLineParser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FVoltstro-Studios%2FUnityCommandLineParser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FVoltstro-Studios%2FUnityCommandLineParser/lists"}