1.0.11 • Published 8 years ago

bolto-cli v1.0.11

Weekly downloads
-
License
MIT
Repository
-
Last release
8 years ago

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 is false.

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 is false.
  • -r or --router - Generate entity router. Default value is false.
  • -s or --service - Generate entity service. Default value is false.
  • -c or --resource - Generate entity resource. Default value is false.
  • -v or --views <folder> - Specify views folder. Default value is false.
  • -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 is false.
  • -o or --overwrite - Overwrite existing files. Default value is false.

    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

1.0.11

8 years ago

1.0.10

8 years ago

1.0.9

8 years ago

1.0.8

8 years ago

1.0.7

8 years ago

1.0.6

8 years ago

1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago