If you’ve ever struggled to remember the syntax of the Oracle JET tooling commands, help is at hand!
The Oracle JET command line tooling has been significantly enhanced with the release of the ojet-cli module that provides a consistent, easy-to-use command line interface (CLI) for scaffolding, building, serving and managing JET apps.
This CLI has been released together with JET 3.1.0, but is not yet documented in the JET documentation while we ask you to install it, use it and provide feedback on it.
Installation
The ojet-cli open source module is fully supported by the Oracle JET team and can be installed as follows:
[sudo] npm –g install ojet-cli
Note: Download the LTS version of Node.js from https://nodejs.org and make sure npm is v3 or v4, since npm v5 has known issues.
Usage
Once installed, the ojet CLI makes use of the installed Oracle JET Yeoman generators and Grunt tasks, as well as the Cordova CLI.
The syntax is:
ojet <task> [scope] [parameters] [options]
The available tasks are:
add ........................... Adds platforms, plugins, themes and more to a JET app build ......................... Builds a JET app create ........................ Creates a new JET app help .......................... Displays command line help list .......................... Lists platforms and plugins within a JET app remove ........................ Removes platforms and plugins from a JET app restore ....................... Restores a JET app serve ......................... Serves a JET app to an emulator, device or the browser
Examples
Scaffold a new web app with:
ojet create MyApp --template=navdrawer
Scaffold a new hybrid mobile app with:
ojet create MyApp --hybrid --platform ios --template navbar --appid com.mycompany.MyApp
Build and serve the app with:
ojet serve ios --device
Add platforms and Cordova plugins with:
ojet add platform android ojet add plugin cordova-plugin-camera
Help
You can get help at a high level, or for specific commands, by invoking commands such as the following:
ojet help ojet help remove ojet help remove plugin
Give it a go!
We encourage you to install and play with the new ojet-cli module and provide your feedback via the Oracle JET Community. And we hope it makes your life easier when creating Oracle JET web and hybrid mobile apps.