- First, make sure you have CommandBox installed.
- Fire up your terminal and drop into CommandBox by entering
box
. - Install FW/1 Commands by entering
install fw1-commands
. - Done!
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.
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 tobasic
.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 tofalse
.package
(type: boolean) - Flags whether to create abox.json
. Defaults totrue
.
- Examples: (the examples and introduction folders from the FW/1 repo) -
fw1 create app myApp examples
- Skeleton: (the skeleton folder from the FW/1 repo) -
fw1 create app myApp skeleton
- Basic: (a bare bones setup for a single application) -
fw1 create app myApp basic
- Subsystem: (a bare bones setup for a application using subsystems 2.0 released with FW/1 3.5) -
fw1 create app myApp subsystem
- Subsystem Legacy: (a bare bones setup for a application using subsystems prior to 2.0) -
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
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 theviews
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
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, onlydefault
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 thecontrollers
directory in your current working directory.views
(type: boolean) - A flag to determine whether to generate views for each action. Defaults totrue
.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 theviews
directory in path supplied to thedirectory
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 tofalse
.
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
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 thelayouts
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
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 themodel/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 totrue
.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 tofalse
.
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
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 themodel/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 totrue
.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 tofalse
.
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
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 thesubsystems
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
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, onlydefault
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 thecontrollers
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 tofalse
.
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
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 theservices
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 tofalse
.
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