cmd2app v1.22.0
cmd2app - Convert you command line client to electron app.
Install
(sudo) npm install cmd2app -gHow to convert?
Complete your command line client.
Add some field to
package.jsonto describe your command line client.All options as follow example.
/* package.json */ { "name": "cmd2app example", // ... "cmd2app" : { "repository": "https://github.com/gomeplusFED/meixin-h5-proxy", // your repo address "title": "美信H5 CDN代理模块", // title your want to show "bin": ["proxy", "test"], // bin entrance "globalOptions": { // global options "dir": { // option detail "desc": "the catalog to be proxyed" // option desc }, "port": { "desc": "http portal, default 80" }, "ports": { "desc": "https portal, default 443" }, "foreign": { "desc": "public dependencies path" }, "path": { "desc": "middle path,default /m/app/src" }, "raw": { "desc": "raw path" } }, "command": { // command "new": { // key "params": [{ //parmas "desc": "repo address" // params desc }, { "desc": "local path" }], "options": { // command options "con": { "desc": "con desc" }, "abc": { "desc": "abc desc" } }, "desc": "this is test cmd" // command desc }, "test": { "params": [{ "desc": "test params" }], "options": { "dir": "the catalog to be proxyed" }, "desc": "# create a new app with an official repo" } } } }For example.
bin + global options
proxy --dir="/c" --path="/b" --foreign="/a" --port=8011proxy -> bin
dir/path/foreign/port -> global optionsbin + global options + command + command options
proxy --port=8001 new a b --con=123proxy -> bin
port -> global option
new -> command
a -> command params 1
b -> command params 2
con -> command optionUse
cmd2appto build your app.(sudo) npm install cmd2app -g cmd2app new [author/repo] [path] cd [path] && npm install electron [path]/src/main/app.babel.js # you should global install electronNote:
Final file not a full app, it's just source code what can run by
electron.If you want run your app, you should install electron environment, and use some package tools to package your app, like electron-builder / electron-packager and so on.
Also, you can wrap your app further to a plugin for FET. FET is a plugin plataform, you can easily wrap your app to a plugin. More in here
Some images .
Main

With all options

Run

Run result

9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago