# custom-cli **Repository Path**: laddish/custom-cli ## Basic Information - **Project Name**: custom-cli - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-03-26 - **Last Updated**: 2021-03-26 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README - 先创建可执行的脚本 #! /usr/bin/env node - 配置package.json中的bin字段 配置别名链接 - npm link 链接到本地环境 产生全局执行命令 C:\nodejs\npmglobal - npm unlink 取消软连接 - npm link --force 强制链接 - link相当于将当前本地模块链接到npm目录下 这个npm目录可以直接访问 所以当前包就可以直接访问了 ```text up to date in 1.274s found 0 vulnerabilities C:\nodejs\npmglobal\lad -> C:\nodejs\npmglobal\node_modules\lad\bin\lad C:\nodejs\npmglobal\node_modules\lad -> C:\mycode\custom-cli ``` 1. 配置可执行命令 1. commander 2. 2. 做一个命令行交互的功能 1. inquirer 2. 3. 将模板下载下来 1. download-git-repo 4. 根据用户的选择动态生成内容 1. mitalsmith ```javascript yarn add commander ```