{"id":13661651,"url":"https://github.com/wlgys8/UnityShell","last_synced_at":"2025-04-25T03:30:40.647Z","repository":{"id":39840587,"uuid":"246581286","full_name":"wlgys8/UnityShell","owner":"wlgys8","description":"execute shell command in Unity Editor","archived":false,"fork":false,"pushed_at":"2022-05-25T02:49:10.000Z","size":23,"stargazers_count":53,"open_issues_count":0,"forks_count":12,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-10T16:45:46.500Z","etag":null,"topics":["command-line","shell","unity"],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wlgys8.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-03-11T13:39:14.000Z","updated_at":"2024-06-08T02:13:14.000Z","dependencies_parsed_at":"2022-07-26T15:32:04.210Z","dependency_job_id":null,"html_url":"https://github.com/wlgys8/UnityShell","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/wlgys8%2FUnityShell","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wlgys8%2FUnityShell/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wlgys8%2FUnityShell/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wlgys8%2FUnityShell/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wlgys8","download_url":"https://codeload.github.com/wlgys8/UnityShell/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250747659,"owners_count":21480687,"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":["command-line","shell","unity"],"created_at":"2024-08-02T05:01:38.670Z","updated_at":"2025-04-25T03:30:40.317Z","avatar_url":"https://github.com/wlgys8.png","language":"C#","readme":"# UnityShell\n\nExecute shell commands in Unity Editor, support osx \u0026 windows\n\n在Editor下执行windows和osx的命令行\n\n\n# Install \n\nadd follow line to `Packages/manifest.json`\n\n在项目 `Packages/manifest.json` 配置如下的依赖\n\n    \"com.ms.shell\":\"https://github.com/wlgys8/UnityShell.git\",\n\n# Examples\n\n- execute command  `ls`\n\n``` csharp\n\nvar operation = EditorShell.Execute(\"ls\");\noperation.onExit += (exitCode)=\u003e{\n    \n};\noperation.onLog += (EditorShell.LogType LogType,string log)=\u003e{\n    Debug.Log(log);\n};\n\nint exitCode = await operation; //support async/await\n```\n\n* use `Options`\n\n``` csharp\n\nvar options = new EditorShell.Options(){\n    workDirectory = \"./\",\n    encoding = System.Text.Encoding.GetEncoding(\"GBK\"), \n    environmentVars = new Dictionary\u003cstring, string\u003e(){\n        {\"PATH\",\"usr/bin\"},\n    }\n};\n\nvar operation = EditorShell.Execute(\"ls\",options);\noperation.onExit += (exitCode)=\u003e{\n    \n};\noperation.onLog += (EditorShell.LogType LogType,string log)=\u003e{\n    Debug.Log(log);\n};  \n\n```  \n\n# Advanced\n\n## Encoding 编码\n\nBy default, EditorShell use `UTF8` for encoding. If you get unrecognizable characters, please check your shell app's (`bash` in osx and `cmd.exe` in windows) encoding, and config options.encoding same as that.\n\n在中文版的Windows上运行时，可能会出现乱码。 因为cmd采用了GBK编码，而UnityShell默认使用UTF8编码。 只要在Options里将encoding设置为GBK编码即可\n\n\n## Environment Vars 环境变量\n\nBy default, environment vars is empty. You can config it in options.environmentVars.\n\n默认情况下， 使用EditorShell执行命令行时是不带环境变量的。 你可以通过Options.environmentVars 字段来配置自己需要的环境变量。\n\n\n","funding_links":[],"categories":["C\\#"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwlgys8%2FUnityShell","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwlgys8%2FUnityShell","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwlgys8%2FUnityShell/lists"}