box
.install fw1-commands
.fw1 create app
To get started quickly, FW/1 Commands comes with a create app
command that can be used to generate a ready-to-go application skeleton for you.
fw1 create app MyApp Basic
To break it down further, fw1
is the alias used that tells CommandBox that we are using FW/1 Commands. create app
is instructing to use the app
command located in the create
driectory (check out the actual file structure of the command bundle to get a better idea). MyApp
is the first parameter to be passed to the app
command. This is the name of your application. Basic
is the skeleton we chose to use as the base medium for out application structure.
create app
create app
can take up to 5 parameters.name
(type: string) - The name of your application. Defaults to "My FW/1 App" if no name is supplied.skeleton
(type: string) - The skeleton structure to generate. Defaults to basic
.directory
(type: string) - The directory to generate the application skeleton in. If it does not exist, it will be created. Defaults to the current working directory.installFW1
(type: boolean) - Flags whether to install the latest version FW/1. Defaults to false
.package
(type: boolean) - Flags whether to create a box.json
. Defaults to true
.fw1 create app myApp examples
fw1 create app myApp skeleton
fw1 create app myApp basic
fw1 create app myApp subsystem
fw1 create app myApp subsystem-legacy
By default, FW/1 Commands assumes that the current directory you are in on the command line is your current working directory and will generate the application in said directory. Should you need to install elsewhere, you can override this by passing in a path as the third parameter.
fw1 create app MyApp basic path/to/my/directory
By default, FW/1 is not included with generated skeletons. The option to to use the master or development release is up to you.
create app
comes with a fourth parameter, installFW1
, that when set to true
will install the latest stable releast of FW/1. When you are in the working directory you want FW/1 to be installed in, you can pass the parmaeter in with double dashes.
Create in current working directory. -
fw1 create app MyApp basic --installFw1
Create in a specified directory. -fw1 create app MyApp basic path/to/directory true
To manually install the latest version of FW/1 all you need to do is enter this command in the command line: install fw1
. To include the dev release, it's the same command but with that release's version number. For example: install fw1-4.0.0
. Note that the version number must reflect what is available on ForgeBox. To install directly from Github you can do this: install https://github.com/framework-one/fw1/archive/develop.zip
.
To follow in the CommandBox/ForgeBox scheme of things, a box.json
with basic package information is generated with your application. This makes your app capable of being added to ForgeBox for others to use and also makes installing it with CommandBox super simple.
By default this option is set to true
but can be altered like so: fw1 create app MyApp basic / false false
fw1 create view
create view
takes up to 2 parameters.name
(type: string, required) - The name of your view.directory
(type: string) - The directory to generate the view in. If it does not exist, it will be created. Defaults to looking for the views
directory in your current working directory.Create in current working directory. -
fw1 create view myView
Create in specified directory. -fw1 create view myView my/directory
fw1 create controller
create controller
takes up to 6 parameters.name
(type: string, required) - The name of your controller.actions
(type: string) - The actions to be included in your controller. A comma delimited list of action names can be passed to create multiple actions. By default, only default
is generated in the controller.directory
(type: string) - The directory to generate the controller in. If it does not exist, it will be created. Defaults to looking for the controllers
directory in your current working directory.views
(type: boolean) - A flag to determine whether to generate views for each action. Defaults to true
.viewsDirectory
(type: string) - The directory to generate the controller's views in. If it does not exist, it will be created. Defaults to looking for the views
directory in path supplied to the directory
parameter.open
(type: boolean) - A flag to determine whether to open the generated controller for editing right away. Opens in your machine's default editor. Defaults to false
.Create in current working directory. -
fw1 create controller myController
Create with multiple actions. -fw1 create controller myController list,add,edit,delete
Create and open in editor. -fw1 create controller myController myAction --open
Create in specified directory.fw1 create controller myController myAction my/controller/directory
Create and generate views for each action. -fw1 create controller myController myAction controllers true
Create controller, views and specify the views directory. -fw1 create controller myController myAction controllers true my/view/directory
Create controller, views and open in editor. -fw1 create controller myController myAction controllers true my/view/directory true
fw1 create layout
create layout
takes up to 2 parameters.name
(type: string, required) - The name of your layout.directory
(type: string) - The directory to generate the layout in. If it does not exist, it will be created. Defaults to looking for the layouts
directory in your current working directory.Create in current working directory. -
fw1 create layout myLayout
Create in specified directory.fw1 create layout myLayout my/layouts
fw1 create bean
create bean
takes up to 4 parameters.name
(type: string, required) - The name of your bean. A comma delimited list of beans can be passed to be created in bulk. To specify "package" directorys, include the base path to be found/generated. Example: package/path/to/Bean.directory
(type: string) - The directory to generate the bean in. If it does not exist, it will be created. Defaults to looking for the model/beans
directory in your current working directory.camelCase
(type: boolean) - A flag to determine the naming convention of the bean file to be in camel case format. For example: MyBean.cfc. Defaults to true
.open
(type: boolean) - A flag to determine whether to open the generated bean for editing right away. Opens in your machine's default editor. Defaults to false
.Create in current working directory. -
fw1 create bean MyBean
Create and open in editor. -fw1 create bean MyBean --open
Create and specify package directory structure. -fw1 create bean package/path/for/MyBean
Create multiple beans. -fw1 create bean MyBean,MyOtherBean
Create in specified directory. -fw1 create bean MyBean path/to/beans
Create without camel case formatted file name. -fw1 create bean MyBean model/beans false
Create without camel case formatted file name and open in editor. -fw1 create bean MyBean model/beans false true
fw1 create service
create service
takes up to 4 parameters.name
(type: string, required) - The name of your service. A comma delimited list of services can be passed to be created in bulk. To specify "package" directorys, include the base path to be found/generated. Example: package/path/to/Service.directory
(type: string) - The directory to generate the service in. If it does not exist, it will be created. Defaults to looking for the model/services
directory in your current working directory.camelCase
(type: boolean) - A flag to determine the naming convention of the service file to be in camel case format. For example: MyService.cfc. Defaults to true
.open
(type: boolean) - A flag to determine whether to open the generated service for editing right away. Opens in your machine's default editor. Defaults to false
.Create in current working directory. -
fw1 create service MyService
Create and open in editor. -fw1 create service MyService --open
Create and specify package directory structure. -fw1 create service package/path/for/MyService
Create multiple services. -fw1 create service MyService,MyOtherService
Create in specified directory. -fw1 create service MyService path/to/services
Create without camel case formatted file name. -fw1 create service MyService model/services false
Create without camel case formatted file name and open in editor. -fw1 create service MyService model/services false true
fw1 create subsystem
create subsystem
takes up to 2 parameters and will generate a bare bones subsytem file structure.name
(type: string, required) - The name of your subsystem.directory
(type: string) - The directory to generate the subsystem in. If it does not exist, it will be created. Defaults to looking for the subsystems
directory in your current working directory based on the Subsystem 2.0 convention released with FW/1 3.5.Create from current working directory. -
fw1 create subsystem mysubsystem
Create in specified directory. -fw1 create subsystem mysubsystem my/subsystems
fw1 create clj-controller
create clj-controller
takes up to 4 parameters.name
(type: string, required) - The name of your controller.actions
(type: string) - The actions to be included in your controller. A comma delimited list of action names can be passed to create multiple actions. By default, only default
is generated in the controller.directory
(type: string) - The directory to generate the controller in. If it does not exist, it will be created. Defaults to looking for the controllers
directory in your current working directory.open
(type: boolean) - A flag to determine whether to open the generated controller for editing right away. Opens in your machine's default editor. Defaults to false
.Create in current working directory.
fw1 create clj-controller my-controller
Create with multiple actions. -fw1 create clj-controller my-controller list,add,edit,delete
Create and open in editor. -fw1 create clj-controller my-controller --open
Create in specified directory. -fw1 create clj-controller my-controller my-action my/controller/directory
Create, specify actions, directory and open in editor. -fw1 create clj-controller my-controller my-action controllers true
fw1 create clj-service
create clj-service
takes up to 3 parameters.name
(type: string, required) - The name of your service. A comma delimited list of services can be passed to be created in bulk. To specify "package" directorys, include the base path to be found/generated. Example: package/path/to/Service.directory
(type: string) - The directory to generate the service in. If it does not exist, it will be created. Defaults to looking for the services
directory in your current working directory.open
(type: boolean) - A flag to determine whether to open the generated service for editing right away. Opens in your machine's default editor. Defaults to false
.Create in current working directory. -
fw1 create clj-service my-service
Create and open in editor. -fw1 create clj-service my-service --open
Create and specify package directory structure. -fw1 create clj-service package/path/for/my-service
Create multiple services. -fw1 create clj-service my-service,my-other-service
Create in specified directory. -fw1 create clj-service my-service path/to/services
Create, specify directory and open in editor. -fw1 create clj-service my-service services true