{"id":14984986,"url":"https://github.com/jiawei397/deno_cli","last_synced_at":"2025-07-23T18:39:43.232Z","repository":{"id":57675514,"uuid":"373465778","full_name":"jiawei397/deno_cli","owner":"jiawei397","description":"some deno cli","archived":false,"fork":false,"pushed_at":"2025-03-27T09:05:05.000Z","size":116,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-10T23:14:27.885Z","etag":null,"topics":["deno","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/jiawei397.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-06-03T10:17:37.000Z","updated_at":"2025-03-27T09:05:08.000Z","dependencies_parsed_at":"2024-08-22T07:49:48.289Z","dependency_job_id":"1e17dc19-f9fe-4573-8c1f-39a5889f67af","html_url":"https://github.com/jiawei397/deno_cli","commit_stats":{"total_commits":73,"total_committers":1,"mean_commits":73.0,"dds":0.0,"last_synced_commit":"9bc855afb517b0f21365992bc54c3fa5d454fe42"},"previous_names":[],"tags_count":41,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jiawei397%2Fdeno_cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jiawei397%2Fdeno_cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jiawei397%2Fdeno_cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jiawei397%2Fdeno_cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jiawei397","download_url":"https://codeload.github.com/jiawei397/deno_cli/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248312134,"owners_count":21082638,"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":["deno","typescript"],"created_at":"2024-09-24T14:10:02.621Z","updated_at":"2025-04-10T23:14:50.146Z","avatar_url":"https://github.com/jiawei397.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 存放一些Deno的小工具\n\n- [x] 给Deno或Node.js或Rust项目打标签\n- [x] 下载资源\n- [x] 脚手架，安装基于oak_nest、mongo的简单web工程\n- [x] 切换当前工程的Git用户\n- [x] 简易文件服务器\n\n## 给Deno或Node.js或Rust项目打标签，并推送到远程\n\n安装：\n\n```bash\ndeno install -g --allow-read --allow-write --allow-run --unstable --import-map https://deno.land/x/jw_cli@v1.2.1/import_map.json -n tag -f https://deno.land/x/jw_cli@v1.2.1/cli/tag/mod.ts\n```\n\n### Node.js项目\n\n在项目根目录下，执行\n\n```bash\ntag\n```\n\n### Deno项目\n\n在项目根目录下执行：\n\n```bash\ntag -V 0.0.1\ntag --version 0.0.1\n```\n\n或者\n\n```bash\ntag\ntag patch # 与上面等价\ntag minor\ntag major\n```\n\n会更新根目录下以下文件的版本号：`deno.jsonc`或`deno.json`文件，以及`README.md`，如果后者有使用前三者之一中配置的`name`，将会对应替换。\n\n比如本工程的名称为`jw_cli`，那么本文件中`jw_cli@v1.2.1`都会对应替换为新的版本。\n\n#### 版本号不以v开头\n\n假设你推送的tag版本号不想以v开头，那么可以添加一个参数-L或者--local：\n\n```bash\ntag patch -L\n```\n\n#### 添加自定义信息\n\n打标签时默认提交信息是版本号，如果想自定义信息，可以使用-M或者--msg：\n\n```bash\ntag minor -M \"feat: change some\"\n```\n\n#### 更新所有目录的README.md文件\n\n如果想要更新所有目录的README.md文件，可以使用-D或者--deep：\n\n```bash\ntag -D\n```\n\n## 下载资源\n\n```bash\ndeno install -g --allow-write --allow-read --allow-net --unstable --import-map https://deno.land/x/jw_cli@v1.2.1/import_map.json -n deno_down -f https://deno.land/x/jw_cli@v1.2.1/cli/download.ts\n```\n\n之后执行：\n\n```bash\ndeno_down\n```\n\n输入下载地址和名称即可。\n\n也可以编译为可执行文件：\n\n```bash\ndeno compile --unstable --allow-write --allow-read --allow-net --import-map https://deno.land/x/jw_cli@v1.2.1/import_map.json --target x86_64-pc-windows-msvc https://deno.land/x/jw_cli@v1.2.1/cli/download.ts\ndeno compile --unstable --allow-write --allow-read --allow-net --import-map https://deno.land/x/jw_cli@v1.2.1/import_map.json https://deno.land/x/jw_cli@v1.2.1/cli/download.ts\n```\n\n## 下载deno模板工程\n\n模板工程是依赖于`oak`与`oak_nest`，包含日志、全局异常捕获以及我们的业务`sso`校验，数据库使用`mongodb`，`CICD`配置了`.gitlab-ci.yaml`文件，可自动发布部署到我们的`gitlab`。\n\n```bash\ndeno install -g --allow-write --allow-read --allow-net --allow-run --unstable --import-map https://deno.land/x/jw_cli@v1.2.1/import_map.json -n deno_cli -f https://deno.land/x/jw_cli@v1.2.1/cli/project.ts\n```\n\n之后执行：\n\n```bash\ndeno_cli 你的工程名称\n\n# 或者在交互页面里输入工程名称\ndeno_cli\n```\n\n或者跳过全局安装，直接执行：\n\n```bash\ndeno run --allow-write --allow-read --allow-net --allow-run --unstable --import-map https://deno.land/x/jw_cli@v1.2.1/import_map.json  https://deno.land/x/jw_cli@v1.2.1/cli/project.ts 你的工程名称\n```\n\n## 增加Git Commit hook\n\n安装\n\n```bash\ndeno install  -g --allow-write --import-map https://deno.land/x/jw_cli@v1.2.1/import_map.json  -n deno_hook -f  https://deno.land/x/jw_cli@v1.2.1/cli/git/git_hook.ts\n```\n\n之后运行：\n\n```bash\ndeno_hook\n```\n\n也可以直接运行：\n\n```bash\ndeno run --allow-write --import-map https://deno.land/x/jw_cli@v1.2.1/import_map.json https://deno.land/x/jw_cli@v1.2.1/cli/git/git_hook.ts\n```\n\n## 增加git push\n\n安装\n\n```bash\ndeno install  -g --allow-run --import-map https://deno.land/x/jw_cli@v1.2.1/import_map.json  -n push -f  https://deno.land/x/jw_cli@v1.2.1/cli/git/push.ts\n```\n\n## 切换当前工程的Git用户\n\n主要为解决工作中使用工作账户和GitHub上使用个人账户的问题。\n\n```bash\ndeno install -g --allow-run --allow-net --allow-read --allow-write --allow-env --unstable --import-map https://deno.land/x/jw_cli@v1.2.1/import_map.json -n gum  -f https://deno.land/x/jw_cli@v1.2.1/cli/git/user_change.ts\n```\n\n展示列表：\n\n```bash\n$ gum \n# 等同于\n$ gum list\n\n┌───────┬──────────┬─────────────────┬─────────┐\n│ Alias │ UserName │ Email           │ Current │\n├───────┼──────────┼─────────────────┼─────────┤\n│ xx    │ xxxxx    │ xxxxx@126.com   │ ✓       │\n├───────┼──────────┼─────────────────┼─────────┤\n│ xxxx  │ xxxx     │ xxxxxx@xxxx.com │         │\n└───────┴──────────┴─────────────────┴─────────┘\n```\n\n增加：\n\n```bash\n$ gum add \n\n? Set a username › test\n? Set a email › test\n? Set an alias (test) › test\nGit user added\n```\n\n使用：\n\n```bash\n$ gum use test\n```\n\n删除：\n\n```bash\n$ gum del test\n```\n\n## 清理MacOS下被占用的端口\n\n安装：\n\n```bash\ndeno install -g --allow-run -n dk -f https://deno.land/x/jw_cli@v1.2.1/cli/kill.ts\n```\n\n使用：\n\n```bash\ndk 8080\n```\n\n## 启动简易文件服务器\n\n快速在当前目录启动一个文件服务器，方便本地文件预览和共享。\n\n安装：\n\n```bash\ndeno install -g --allow-net --allow-read -n serve -f https://deno.land/x/jw_cli@v1.2.1/cli/file_server.ts\n```\n\n使用：\n\n```bash\n# 默认在8000端口启动服务\nserve .\n\n# 指定端口启动服务\nserve .  --port 9000\n```\n\n服务启动后，可以通过浏览器访问 `http://localhost:端口号` 来浏览和下载文件。\n\n特性：\n\n- 自动生成目录列表\n- TypeScript (.ts) 文件会以 JavaScript 文件形式显示，不会被下载\n- 支持大多数常见文件类型的预览\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjiawei397%2Fdeno_cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjiawei397%2Fdeno_cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjiawei397%2Fdeno_cli/lists"}