Code Monkey home page Code Monkey logo

bpanel-cli's Introduction

bPanel CLI

A simple CLI utility for use with bpanel

Installation

npm install -g @bpanel/bpanel-cli

Usage

Passing no arguments, or --help, will return the help menu.

$bpanel-cli --help

Currently supports:

  • create / c: create a plugin boilerplate project for local development
  • list / l: list all currently installed plugins
  • install / i: install a new plugin to your local bPanel
  • uninstall / u: uninstall a plugin from your local bPanel
  • search / s: search available plugins you can install with bpanel-cli i

Create a Plugin Boilerplate

The create command will walk you through the steps to create a plugin boilerplate.

In your terminal:

bpanel-cli create

Then just answer the questions. The initial questions will setup your bPanel metadata, as well as necessary information to initialize your project as an npm module. This means that when you're happy with your plugin and want to share it with the world, all you have to do is run npm publish from your project directory.

Most of the questions are self-explanatory, but if this is your first time creating a bPanel plugin some additional information might be helpful.

Names

The first question is about primary name of your plugin. This will set the name of your directory and the name of your plugin on npm. Because npm uses package names in the registry's url, only url friendly names can be used. We use validate-npm-package-name to validate names, so you can see their readme for specific rules. If there's anything wrong, you will be asked to pick a new name. This does not check for the existence of an npm package with the same name, so double check this on your own first.

You can learn more about plugin names [here](http://bcoin.io/bpanel-docs/docs/api-metadata.html#details.

Dependency Check

The question "Will your plugin depend on any other published bPanel plugins" has to do with whether you will be bundling or requiring any other bPanel compliant plugins (i.e. they must follow the API rules). You can read more about plugin bundling here.

To see what plugins are available to be bundled run the following in another terminal:

$ bpanel-cli search

This will search the npm registry for any plugins tagged with the bpanel keyword (all plugins created with bpanel-cli will automatically add this keyword).

Making a Theme

You can read more about making a theme in bPanel here. If you answer "y" to this, bpanel-cli will mock out the necessary files and exports to create a theme.

Additional Modules

By default, bpanel-cli will only expose the metadata export from the entry point of your app. If you have a good idea of what you want to start building, you can choose "y" to the question of "Would you like to add any additional module templates". This will mock out in your lib/index.js what these modules should look like.

Scroll through the options with your arrow keys (or vim navigation), select with the space bar, and press enter when you're done.

If any of the modules selected need to specify a component they will decorate (e.g. Footer, Header, Sidebar, or Panel), you will be asked to select which in the next step. You can add more later.

To learn more about building plugins and about the module API, check out the bPanel documentation website.

License

  • Copyright (c) 2018, Bcoin Devs (MIT License).

See LICENSE for more info.

bpanel-cli's People

Contributors

bucko13 avatar pinheadmz avatar tynes avatar

Watchers

 avatar  avatar  avatar

bpanel-cli's Issues

When passing --prefix, misinterprets "i" as a plugin name

This operation completed correctly (local plugin bwallet was installed into bpanel) but I also got this funny error, bpanel looking for i in local_plugins.

I imagine the error might come from the order I passed the args?

$ bpanel-cli --prefix=/Users/pinhead/Desktop/work/install/app/data/bpanel i -l bwallet
[warning] i does not exist in local plugins directory /Users/pinhead/Desktop/work/install/app/data/bpanel/local_plugins. Please include it before installing to bPanel.
[info] bwallet: Valid name, adding to config
[info] Plugin installation done

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.