bolto-cli v1.0.11
This is serving tool for applications based on bolto framework.
Install
Installation is simple as usual:
[sudo] npm install -g bolto-cli
After installation util will be globally available as bolto
command.
Usage
To use application call:
bolto <command> <params>
Generate new project
Fast start is cool.
This util will generate base project, including directories tree, core files, default settings,
it will also install framework and
autoload plugin, some common assets. Also it will initialize git repo
in project dir, add generated files to initial commit and create new development
brunch.
To generate new project, run:
bolto init [options...]
Available options
-r
or--reset
- Empty working folder before generating. Default value isfalse
.
Generate code
It's boring to create models, resources, routers and other stuff from scratch. You can generate model, service, resource and router automatically for each new entity. To generate code for specified entities, run:
bolto add <entities...> [options...]
Available options
-a
or--all
- Generate entity model, service, resource and router. Default value isfalse
.-r
or--router
- Generate entity router. Default value isfalse
.-s
or--service
- Generate entity service. Default value isfalse
.-c
or--resource
- Generate entity resource. Default value isfalse
.-v
or--views <folder>
- Specify views folder. Default value isfalse
.-b
or--base <url>
- Specify base URL. Default value is/
.-d
or--disabled
- Generated files disabled by default (_
added before generated files names). Default value isfalse
.-o
or--overwrite
- Overwrite existing files. Default value isfalse
.NOTE: entity model will be always generated.
Run commands
You can run command scripts to serve the project.
Scripts runs one-by-one.
Commands, specified in arguments are just names of files without .js
extension.
To run command scripts from %project_dir%/commands folder, run:
bolto exec <commands...>
Dump application
You can print information about application: defined models, services, resources, routers, plugins, available commands etc. Do dump application info, run:
bolto dump
Examples
Run commands defined in %project_dir%/commands/add-admin.js
and
%project_dir%/commands/add-test-data.js
files:
# Run separately
bolto exec add-admin
bolto exec add-test-data
# Run sequentially
bolto exec add-admin add-test-data
Generate only model for entity Cat:
bolto add Cat
# %project_dir%/app/models/Cat.js
Generate model, service, resource and router for entity Cat:
bolto add Cat -a
# %project_dir%/app/models/Cat.js
# %project_dir%/app/services/CatService.js
# %project_dir%/app/resource/CatResource.js
# %project_dir%/app/routers/CatRouter.js
Generate model, service, resource and router for multiple entities - Cat and Dog:
bolto add Cat Dog -a
# %project_dir%/app/models/Cat.js
# %project_dir%/app/services/CatService.js
# %project_dir%/app/resource/CatResource.js
# %project_dir%/app/routers/CatRouter.js
# %project_dir%/app/models/Dog.js
# %project_dir%/app/services/DogService.js
# %project_dir%/app/resource/DogResource.js
# %project_dir%/app/routers/DogRouter.js
Generate model and service for entity Cat, disabled by default:
bolto add Cat --service --disabled
# or in short form
bolto add Cat -s -d
# %project_dir%/app/models/_Cat.js
# %project_dir%/app/services/_CatService.js
Author
Alex Chugaev (email me)
License
MIT