The Platypi CLI is the primary way to create and manage Platypi apps. It can be used to create new projects as well as add different components (models, repositories, services, injectables, and controls) to the app.
Use npm
to install this package.
Globally (preferred)
npm install platypi-cli -g
or, Locally
npm install platypi-cli --save-dev
All commands are run with plat <command>
. You can run plat <command> -h
for further help. The help menus cascade.
So plat create app -h
will show you a different help menu than plat create -h
or plat create viewcontrol -h
.
Creates a new project or component in the specified directory. Walks you through a series of prompts to determine the project specifications.
NOTE: You can use
plat c
as an alias forplat create
Create a new project in the current directory:
plat create
Create a new project MyProject in its own directory
plat create -n MyProject --dir myproject
Create a ViewControl component in the project-specified default location for viewcontrols (e.g. ./app/viewcontrols/home)
plat create viewcontrol -n Home
Create a ViewControl component in ./app/viewcontrols/posts/list
plat create viewcontrol -n List --dir posts/
Create a ViewControl component that extends another ViewControl
plat create viewcontrol -n PostsByTag --extends ../list/list.vc
NOTE: When extending components, the exact path you specify will be used as the import path. The path specified must have the component listed as its default export.
When specifying components you can choose to use their full name or an alias:
viewcontrol | vc
templatecontrol | tc
attributecontrol | ac
model | mdl
repository | repo
service | svc
injectable | inj
-n, --name <name> Specifies the name of the file
-d, --dir <directory> Used to specify the directory in which to create the project or component
You can run plat cordova
from anywhere in your project, and it will run cordova
commands from within the scope of the /cordova
folder of your project.
Run your cordova project on an Android device from the /cordova folder of your project.
cordova run android --device
Run your cordova project on an Android device from the / folder of your project.
plat cordova run android --device
This will work with any cordova command. You can type plat cordova -h
for more information.