{"id":22731487,"url":"https://github.com/kakacoding/csxtoolbox","last_synced_at":"2026-05-19T04:11:29.880Z","repository":{"id":228914277,"uuid":"775254795","full_name":"kakacoding/CsxToolbox","owner":"kakacoding","description":null,"archived":false,"fork":false,"pushed_at":"2024-03-21T04:16:58.000Z","size":53,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-25T19:40:51.011Z","etag":null,"topics":["command-line-tool","tools","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/kakacoding.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}},"created_at":"2024-03-21T03:19:01.000Z","updated_at":"2024-03-21T04:11:01.000Z","dependencies_parsed_at":"2024-03-21T04:44:54.299Z","dependency_job_id":null,"html_url":"https://github.com/kakacoding/CsxToolbox","commit_stats":null,"previous_names":["kakacoding/csxtoolbox"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kakacoding/CsxToolbox","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kakacoding%2FCsxToolbox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kakacoding%2FCsxToolbox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kakacoding%2FCsxToolbox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kakacoding%2FCsxToolbox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kakacoding","download_url":"https://codeload.github.com/kakacoding/CsxToolbox/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kakacoding%2FCsxToolbox/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266828728,"owners_count":23991220,"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-07-24T02:00:09.469Z","response_time":99,"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":["command-line-tool","tools","unity"],"created_at":"2024-12-10T19:27:57.834Z","updated_at":"2026-05-19T04:11:24.840Z","avatar_url":"https://github.com/kakacoding.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# C#脚本命令框架\n- 通过CSharp Script实现的一套命令行调用框架，支持传参提示。即改即用，不用发布。\n- 非常适合统一Unity项目的工具语言，还可通过宏共用项目代码(参考ExportDataFromExcel.csx)。\n\n# 环境\n\n- 安装：需要依赖 net7.0 的 `dotnet script`，用其他版本会在发布时会报错 `dotnet publish failed with result '1'`。\n  - `dotnet tool install dotnet-script --version 1.5.0 --framework net7.0 -g`\n- 卸载\n  - `dotnet tool uninstall dotnet-script -g`\n- 查看 `dotnet-script` 依赖的 net 版本\n  - `dotnet-script --info`\n- 自动完成\n  - 依赖 `omnisharp.json` 中的 `defaultTargetFramework`。\n- 调试\n  - 依赖 `launch.json` 的配置。\n\n# 发布\n\n- 发布为 exe (exe 文件包含所有依赖库) : `dotnet-script publish Entry.csx`\n- 发布为 dll : `dotnet-script publish Entry.csx --dll`\n- 可使用 -n 参数命名发布文件 : `dotnet-script publish Entry.csx -n ProjTools`\n- 其它发布参数可参考[链接](https://github.com/dotnet-script/dotnet-script)。\n\n# 执行模式\n\n- 脚本执行，注意第二种方式的命令名实际上是文件名:\n  - 通过入口脚本执行: `dotnet-script Entry.csx CommandName -paramName1 paramValue1 -paramName2 paramValue2`\n  - 直接执行脚本: `dotnet-script path_to_command.csx -paramName1 paramValue1 -paramName2 paramValue2`\n- 发布后执行 (假设发布为 `Entry.exe`):\n  - `Entry.exe CommandName -paramName1 paramValue1 -paramName2 paramValue2`\n\n# 其他说明\n\n- 在 `Entry.csx` 中使用 `#load xx.csx` 注册命令后，运行 `Entry.exe` 或 `dotnet-script Entry.csx` 可以列出所有注册过的命令及其参数说明。\n- ![](img/FromEntry.png \"通过Entry入口执行命令\")\n- 命令脚本末尾需要调用 `CmdReg.CommandRun` 才能被正确调用。否则需要在脚本末尾写显示代码进行调用。\n- 命令参数错误时会自动提示。\n- ![](img/ErrorHint.png \"传参错误提示\")\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkakacoding%2Fcsxtoolbox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkakacoding%2Fcsxtoolbox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkakacoding%2Fcsxtoolbox/lists"}