{"id":13902900,"url":"https://github.com/vrn-deco/cli","last_synced_at":"2025-05-16T04:05:38.138Z","repository":{"id":40297017,"uuid":"290124616","full_name":"vrn-deco/cli","owner":"vrn-deco","description":"💻 Project scaffolding with command line tools. 🛠","archived":false,"fork":false,"pushed_at":"2025-05-08T16:48:11.000Z","size":1613,"stargazers_count":218,"open_issues_count":12,"forks_count":10,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-05-10T06:03:11.458Z","etag":null,"topics":["cli","nest","npm","typescript","vite","vue"],"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/vrn-deco.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,"zenodo":null}},"created_at":"2020-08-25T05:44:52.000Z","updated_at":"2024-12-29T00:25:36.000Z","dependencies_parsed_at":"2024-10-11T18:21:10.094Z","dependency_job_id":"82615be1-c150-4b30-b8ca-9113c2f131ac","html_url":"https://github.com/vrn-deco/cli","commit_stats":{"total_commits":158,"total_committers":3,"mean_commits":"52.666666666666664","dds":0.259493670886076,"last_synced_commit":"abb4b6f00e320dfa9cc5feb16f1465623e03d053"},"previous_names":["vrn-deco/vrn-cli"],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vrn-deco%2Fcli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vrn-deco%2Fcli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vrn-deco%2Fcli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vrn-deco%2Fcli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vrn-deco","download_url":"https://codeload.github.com/vrn-deco/cli/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254464895,"owners_count":22075570,"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":["cli","nest","npm","typescript","vite","vue"],"created_at":"2024-08-06T22:01:29.278Z","updated_at":"2025-05-16T04:05:33.126Z","avatar_url":"https://github.com/vrn-deco.png","language":"TypeScript","funding_links":[],"categories":["cli"],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n\u003ca href=\"https://github.com/vrn-deco/cli\"\u003e\n\u003cimg src=\"./docs/images/cli-logo.png\" width=\"600\" alt=\"vrn-cli\" /\u003e\n\u003c/a\u003e\n\n![GitHub Actions Status](https://github.com/vrn-deco/cli/actions/workflows/ci.yml/badge.svg)\n[![codecov](https://codecov.io/gh/vrn-deco/cli/branch/main/graph/badge.svg?token=9PA5BCTSFB)](https://codecov.io/gh/vrn-deco/cli)\n[![npm package](https://badgen.net/npm/v/@vrn-deco/cli)](https://www.npmjs.com/package/@vrn-deco/cli)\n![GitHub language](https://img.shields.io/github/languages/top/vrn-deco/cli.svg)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n[![pnpm](https://img.shields.io/badge/maintained%20with-pnpm-f49033.svg)](https://pnpm.io/)\n\n[简体中文](./README_zh.md)\n\n\u003c/div\u003e\n\n`@vrn-deco/cli` is an automated command line tool whose core feature is to help you quickly build an engineered project via `boilerplate`. It supports multiple creation modes, you can get `boilerplate` from the sources we provide, or you can specify a third party or your own source.\n\n\u003e ⚠️ Please make sure your **Node.js version \u003e=18.0.0**\n\n## Quick Start\n\nIf you are using it for the first time, we recommend `npm create` to quickly create it without installing the CLI globally\n\n![create-demo-gif](https://cdn.jsdelivr.net/gh/cphayim/oss@main/images/2022/04/23/233707mdKhKf.gif)\n\n```sh\n# npm\nnpm create vrn@latest\n# yarn\nyarn create vrn\n# pnpm\npnpm create vrn\n```\n\nThen follow the prompts, you can create a project with the preset `boilerplate-package`!\n\n### Install CLI\n\nIf you need to use it frequently, or plan to learn the follow-up advanced guide, then please install `@vrn-deco/cli` globally\n\n```sh\n# npm\nnpm install -g @vrn-deco/cli\n# yarn\nyarn add --global @vrn-deco/cli\n# pnpm\npnpm install -g @vrn-deco/cli\n```\n\nLet's create another project, this time by executing `vrn create` command\n\n```sh\nvrn create my-app\n```\n\nFollow the prompts to complete the project creation\n\n\u003e Since the dependencies of services other than the ontology are dynamically managed, checks and incremental installations are performed during use\n\n## Advanced Guide\n\nHere is the advanced content, you will know the following:\n\n- Global configuration `vrn config` command\n  - Turn on or off update check\n  - Toggle NPM registry\n  - Toggle package manager\n- Boilerplate service `vrn boi` command\n  - Package Mode creation\n    - Interactive and non-interactive\n    - Custom `manifest-package`\n  - HTTP Mode creation\n    - Interactive and non-interactive\n    - Custom `api-url`\n  - Git Mode creation\n    - `post-git` Post-processing\n  - List of available packages\n\n### Config Command\n\n`config` is the command used to manage the global configuration of the CLI, which is entered into interactive mode with the following command:\n\n```sh\n# Interactively view configuration items or modify them\nvrn config\n```\n\nThe CLI will show all the configurations that can be changed and their current values in a list, and you can modify it by selecting one of the configurations\n\n#### Update Check\n\n`checkUpdateEnabled`: `boolean` (default: `true`)\n\nExecute update check before command scheduling. If there is a new version, a tip log will be output in the terminal, which will not affect subsequent program execution. **The default check period is 1 day**\n\nYou can set `checkUpdateEnabled: false` to disable update check\n\n#### NPM registry\n\n`npmRegistry`: `string` (default: `'https://registry.npmmirror.com'`)\n\nThe CLI used npm registry, from which version update checks and subsequent incremental dependency installations are fetched\n\nProvide two preset values:\n\n- `NPM`: `https://registry.npmjs.org`\n- `TAOBAO`: `https://registry.npmmirror.com`\n\nSince it is difficult for Chinese users to access `NPM` registry, the default is `TAOBAO` registry, you can change it to `NPM` registry or custom registry (ensure accessibility by yourself)\n\n\u003e It is important to note that this item only affects the npm registry used by the CLI and does not modify the global config of npm\n\n#### Package manager\n\n`packageManager`: `'npm' | 'yarn' | 'pnpm'` (default: `'npm'`)\n\nThe CLI used package manager, subsequent incremental dependencies will be operated using the specified package manager\n\nSupport three mainstream package managers: `npm`, `yarn`, `pnpm`, you can specify it as your usual package manager (except `npm`, you need to install it globally)\n\n\u003e Due to the different dependency directory structures and generated lock files installed by different package managers, do not switch this configuration frequently\n\n### Boilerplate Command\n\nThis command provides `boilerplate` related services whose implementation follows the [@vrn-deco/boilerplate-protocol](https://github.com/vrn-deco/boilerplate/tree/main/protocol) specification. Since `boilrplate` is really long, we define a shorter alias `boi` for it, see the help with the `-h` option:\n\n```sh\nvrn boi -h\n# Equivalent to\nvrn boilerplate -h\n```\n\nThe core feature is the `boi create` subcommand, which can also be viewed through the `-h` option:\n\n```sh\nvrn boi create -h\n```\n\nMaybe you remembered the example from the \"Quick Start\". yes, `create` is a shortened alias for `boi create`\n\n```sh\nvrn create my-app\n# Equivalent to\nvrn boi create my-app\n```\n\nThe above command will perform an interactive build using `package` mode! What is `package` mode? Get to know it now!\n\n#### Creation Mode\n\nAccording to the [@vrn-deco/boilerplate-protocol](https://github.com/vrn-deco/boilerplate/tree/main/protocol) specification, we provide the creation of the `package` mode, additionally two modes : `http` and `git`\n\nModes mean how `boilerplate` is provided. Here are the characteristics of the three modes:\n\n- `package`: Provide boilerplate through npm package, which we call `boi-package`\n  - Publish all available `boi-package` via a `manifest-package`\n  - `manifest-package` and `boi-package` are dynamic dependencies and are incrementally installed\n  - `boilerplate` itself is stored in `boi-package`\n  - `boi-package` is responsible for describing and installing its own `boilerplate`\n  - Support custom script hooks, more flexible and powerful\n- `http`：Pack and compress the `boilerplate` (usually `.tgz`), we call it `packed-boi`, and distribute it through the Server interface or CDN\n  - Describe all available `packed-boi` via an interface or `manifest.json` file\n  - Unpack installation by CLI, only support specific compression formats\n  - Fastest, but doesn't support extra operations on the inside of `boilerplate`\n- `git`：`git clone` an existing repository\n  - Supports arbitrary origin and post-processing\n\n#### Package Mode creation\n\n`package` mode supports interactive and non-interactive creation\n\n##### Interactive creation\n\nThe CLI will ask for various required parameters and show you all available `boi-package`, choose one to complete the creation\n\n```sh\n# By default, you only need to pass in one parameter \u003cfolder_name\u003e\nvrn boi create my-app\n\n# If you are in a Monorepo, you can pass in the second parameter [base_directory]\nvrn boi create my-app ./packages\n```\n\nBy default all optional `boi-package` are provided through `@vrn-deco/boilerplate-manifest` package, if you want to use your own `manifest-package` to provide `boi-package`, you can use `- -manifest-package` option specified\n\n```sh\n# Get `boi-package` available via @your-scope/your-manifest-package\nvrn boi create my-app --manifest-package @your-scope/your-manifest-package\n```\n\n##### Non-interactive creation\n\nMaybe you want to create via script, or make the \"create\" part of an automated task, then you should use a non-interactive create, it will directly complete the creation or fail\n\n\u003e The command can be called in a shell script or Node.js child_process\n\n```sh\nvrn boi create my-app --yes \\\n   --name=my-app --version=1.0.0 --author=cphayim \\\n   --target @vrn-deco/boilerplate-javascript-vue # For example only, the package may not exist\n```\n\nThese options are all required:\n\n- `--yes`：Non-interactive\n- `--name`: Project name\n- `--version`：Version\n- `--author`：Author\n- `--target, --target-boilerplate`：Specify `boi-package`\n  - Must be full package name\n  - Must conform to the definition of `boi-package` in [@vrn-deco/boilerplate-protocol](https://github.com/vrn-deco/boilerplate/tree/main/protocol#boilerplate-packages)\n  - Does not verify that `target` is in `manifest`\n\nNode.js call example:\n\n```js\nawait execaCommand(\n  `\n  vrn create ${PROJECT_NAME} --yes \\\n    --name=${PROJECT_NAME} --version=${PROJECT_VERSION} \\\n    --author=${execaCommandSync('git config --global user.name').stdout}\n    --target @vrn-deco/boilerplate-typescript-vue3-varlet-h5plus\n`,\n  {\n    stdio: 'inherit',\n    cwd: process.cwd(),\n  },\n)\n```\n\n#### HTTP Mode creation\n\n\u003e The `http` mode exists to complement specific scenarios, we still recommend that you use the `package` mode.\n\n`http` mode also support interactive and non-interactive creation\n\n##### Interactive creation\n\n```sh\n# You need to pass `--mode=http` to enable it, as 'package' mode is default\nvrn boi create my-app --mode=http\n\n# If you are in a Monorepo, you can pass in the second parameter [base_directory]\nvrn boi create my-app ./packages --mode=http\n```\n\nBy default all optional `packed-boi` are provided through `https://vrndeco.cn/boilerplate`, if you want to use your own interface to provide `packed-boi`, you can use `--api-url` ` option specifies the BaseURL of the request\n\n```sh\nvrn boi create my-app --mode=http --api-url=https://yoursite.com/boilerplate\n```\n\n##### Non-interactive creation\n\n```sh\nvrn boi create my-app --mode=http --yes \\\n  --name=my-app --version=1.0.0 --author=cphayim \\\n  --target boilerplate-typescript-vue3-varlet.tgz\n# There is no `--api-url` passed here, take the default value,\n# it will download https://vrndeco.cn/boilerplate/boilerplate-typescript-vue3-varlet.tgz\n\nvrn boi create my-app --mode=http --yes \\\n  --name=my-app --version=1.0.0 --author=cphayim \\\n  --target https://yoursite.com/boilerplate/boilerplate-typescript-vue3-varlet.tgz\n\n# Equivalent to\nvrn boi create myapp --mode=http --yes \\\n  --name=myapp --version=1.0.0 --author=cphayim \\\n  --api-url= https://yoursite.com/boilerplate \\\n  --target boilerplate-typescript-vue3-varlet.tgz\n```\n\nExcept for the value of the `target` option, it is the same as the `package` mode:\n\n- `--target, --target-boilerplate`: Specify the `packed-boi` filename\n  - Can be a filename or a full URL path\n  - Does not verify that `target` is in the `manifest` returned by the interface\n\n#### Git Mode creation\n\n\u003e Do not use git mode in Monorepo!\n\n`git` mode is created by `clone` a repository to the local\n\n```sh\n# You need to pass `--mode=git` to enable it, as 'package' mode is default\n# `--target` is repository url, support `HTTPS` and `SSH`\nvrn boi create my-app --mode=git --target=https://github.com/vrn-deco/xxx.git\nvrn boi create my-app --mode=git --target=git@github.com:vrn-deco/xxx.git\n```\n\nYou can also use `--post-git` to tell the CLI what to do with the original commit after cloning\n\n- `--post-git`: (default: `'retain'`)\n  - `retain`: Keep the original record\n  - `remove`: Remove the local repository\n  - `rebuild`: Rebuild the local repository\n\n```sh\n# keep origin record\nvrn boi create my-app --mode=git --post-git=retain --target=git@github.com:vrn-deco/xxx.git\n# rm -rf .git\nvrn boi create my-app --mode=git --post-git=remove --target=git@github.com:vrn-deco/xxx.git\n# rm -rf .git \u0026\u0026 git init \u0026\u0026 git add . \u0026\u0026 git commit -m \"chore: init repository\"\nvrn boi create my-app --mode=git --post-git=rebuild --target=git@github.com:vrn-deco/xxx.git\n```\n\n#### List\n\nUse the `boi list` command to list all available `boi-package`, alias `boi ls`:\n\n```sh\nvrn boi ls\nvrn boi ls --json # output json\nvrn boi ls --json --out-file ./boilerplate.json # output json and write file\nvrn boi ls --yaml\t# output yaml\nvrn boi ls --yaml --out-file ./boilerplate.yaml # output yaml and write file\n\n# List all `boi-package` in @your-scope/your-manifest-package\nvrn boi ls --manifest-package @your-scope/your-manifest-package\n```\n\n\u003e Note that the `list` command can only list the packages available in `package` mode, it does not support `http` and `git` modes\n\n## Migration from v0.x\n\nYou or your team may be using the `v0.x` version and have deployed the corresponding `boilerplate` interface\n\nIf you want to migrate to `v1.x` or keep the `v0.x` version, see [Migration Guide](./docs/migration.md)\n\n## Changelogs\n\n[CHANGELOG.md](./CHANGELOG.md)\n\n## License\n\n[MIT](./LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvrn-deco%2Fcli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvrn-deco%2Fcli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvrn-deco%2Fcli/lists"}