{"id":15813299,"url":"https://github.com/lvqq/command-alias","last_synced_at":"2026-05-08T03:02:09.022Z","repository":{"id":162790136,"uuid":"573098152","full_name":"lvqq/command-alias","owner":"lvqq","description":"Generate alias for different command system","archived":false,"fork":false,"pushed_at":"2023-05-07T04:20:48.000Z","size":64,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-12T23:02:11.550Z","etag":null,"topics":["alias","bash","command","windows-powershell","zsh"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/lvqq.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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}},"created_at":"2022-12-01T17:36:55.000Z","updated_at":"2023-11-22T08:54:37.000Z","dependencies_parsed_at":"2023-06-19T13:58:18.239Z","dependency_job_id":null,"html_url":"https://github.com/lvqq/command-alias","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/lvqq/command-alias","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lvqq%2Fcommand-alias","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lvqq%2Fcommand-alias/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lvqq%2Fcommand-alias/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lvqq%2Fcommand-alias/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lvqq","download_url":"https://codeload.github.com/lvqq/command-alias/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lvqq%2Fcommand-alias/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":284122919,"owners_count":26951149,"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-11-12T02:00:06.336Z","response_time":59,"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":["alias","bash","command","windows-powershell","zsh"],"created_at":"2024-10-05T04:01:52.039Z","updated_at":"2025-11-12T22:29:50.179Z","avatar_url":"https://github.com/lvqq.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# command-alias\n\n[![npm version](https://img.shields.io/npm/v/command-alias.svg)](https://www.npmjs.com/package/command-alias) ![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/lvqq/command-alias/ci.yml?branch=main) [![Coverage Status](https://coveralls.io/repos/github/lvqq/command-alias/badge.svg?branch=main)](https://coveralls.io/github/lvqq/command-alias?branch=main) ![GitHub](https://img.shields.io/github/license/lvqq/command-alias)\n\nGenerate alias for different command system, support `zsh/bash` and `Windows Command/PowerShell`.\n\n## Usage\n### Installation\n```bash\n# npm\nnpm install command-alias --save-dev\n\n# yarn\nyarn add command-alias --dev\n\n# pnpm \npnpm add command-alias --save-dev\n```\n\n### Api\nUsing the following api will generate a few alias file under output directory throught `alias.yaml`:\n```typescript\nimport { transform } from 'command-alias'\n\ntransform('alias.yaml', 'output')\n```\n\n\n### Params\n```typescript\ntype generateCommandAliasByPlugin =  (\n  source: string,\n  outDir: string,\n  options?: Options\n) =\u003e Promise\u003cvoid\u003e\n\ntype Options = {\n  filename?: string;\n  plugins?: string[];\n}\n```\n#### source\nAlias config filepath, support `json/yaml` format.\n\n- source file yaml [example](https://github.com/x-toolkit/command-alias/blob/main/test/fixtures/alias.yaml):\n```yaml\npart1:\n  sa: short alias\npart2:\n  saa: short alias with optionA\n  sab: short alias with optionB\n```\n\n- source file json [example](https://github.com/x-toolkit/command-alias/blob/main/test/fixtures/alias.json):\n```json\n{\n  \"part1\": {\n    \"sa\": \"short alias\"\n  },\n  \"part2\": {\n    \"saa\": \"short alias with optionA\",\n    \"sab\": \"short alias with optionB\"\n  }\n}\n```\n\n#### outDir\nAlias output directory, all alias files will be placed under outDir.\n\n#### options\nOptional configs.\n##### options.filename\nDefine the output filename, default is `alias`.\n##### options.plugins\nDefine the using plugins to generate, without specifying will use all plugins by default. \n\nSupport options:\n- `sh`: for bash-like command, like `zsh/bash`\n- `bat`: for `Windows Command`\n- `ps1`: for `Windows PowerShell`\n\n## Development\nInstall dependencies:\n```bash\npnpm install\n```\n\nMake changes and run tests:\n```bash\npnpm run test\n```\n\n# License\n[MIT](https://github.com/x-toolkit/command-alias/blob/main/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flvqq%2Fcommand-alias","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flvqq%2Fcommand-alias","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flvqq%2Fcommand-alias/lists"}