Git Product home page Git Product logo

navi-cli's Introduction

navi-cli

使用

npm i -g @navi-cli/cli

安装之后,你就可以在命令行中访问navi命令。你可以通过简单运行navi,看看是否展示出了一份所有可用命令的帮助信息,来验证它是否安装成功。

你也可以选择添加自己的命令,让navi更好的工作。

查看帮助:

navi
# OR
navi -h
# OR
navi --help

检查版本:

navi -v
# OR
navi --version

你也可以选择vue-cli或者是create-react-app来创建。

navi init

运行以下命令来创建一个新项目:

navi init hello-world

vue-cli or create-react-app

运行以下命令来创建一个新项目:

navi vue hello-world
# OR
navi react hello-world

使用图形化界面

运行以下命令来启动ui:

navi ui

添加自己的模板

您需要将模板发布npm

模板包应当有如下结构

|- package
|-- template
|-- package.json
|-- setting.json

template

模板内容需要放在template文件夹中,为了生成项目name与项目存放文件夹一致,package.jsonname项的值应当为<%= projectName %>

您可以在除html的任意文件中使用<%= key %>的指定渲染。

setting.json

setting.json:

{
  "installCommand": "npm install",
  "startCommand": "npm run serve",
  "buildCommand": "npm run build",
  "template": [{
    "name": "title",
    "message": "请输入 title:",
    "tip": "请输入 title"
  }],
  "ignore": ["**/public/**", "**.png"]
}

参数介绍:

  • template:
    • name: 模板渲染位置字段。
    • message: 交互说明字段。
    • tip: 校验提示字段。
  • ignore: 忽略文件,参考glob

导入模板

navi add -T

添加命令

function command(options) {

}
  • options
  • cmds: 命令参数
  • args: 选项值
  • command: command对象

导入命令

navi add 
# OR
navi add -C
# OR
navi add -T
# 参数T为命令添加本地调试路径

创建更多模板

开发中

navi-cli's People

Contributors

cvopen avatar

Stargazers

Madinah avatar open avatar ITWangCode avatar  avatar WnagoiYy avatar  avatar  avatar  avatar  avatar Dino avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.