Ionic-cli VS cordova-cli


#1

When using the ionic CLI (v1.0.9) this are the available tasks:

serve - Start a local development server for easy app development and testing
start - Start a new Ionic project with the given name.
emulate - Emulate an ionic project on a simulator or emulator.
run - Run an ionic project on a connected device.
build - Locally build an ionic project for a given platform
platform - Configure platform targets for building an Ionic app
login - Login to the Ionic Platform
upload - Upload an Ionic project to the Ionic Platform (requires login)

Does it makes sense to build a separate CLI from Cordova one? In the Cordova CLI I can do the following which I can’t in ionic, so I guess it is not wrapping all cordova-cli tasks.

/Workspace/ionic-sidemenu$ ionic platform list
Running platform task...
Adding platform list
Platform "list" not recognized as a core cordova platform. See "platform list".
Unable to add platform list. Please see console for more info.
~/Workspace/ionic-sidemenu$ cordova platform list
Installed platforms: android 3.4.0
Available platforms: amazon-fireos, blackberry10, firefoxos, ios

In addition to this, I’m wondering about the recommended build process. In my case I have a grunt-watcher looking for source changes and then executing cordova prepare, which triggers before_prepare trigger which does some preparation tasks as compiling SASS, copying splashscreens, etc.

Does any of the ionic-cli task adds or extends functionality of a cordova-cli task?


#2

Ionic’s CLI is built on top of cordova’s CLI, so they both have some of the same functionality. But because cordova is built at a low-level to be pretty simple, others can build on top of it and add functionality, like we did with our CLI.

After we finish up things with the framework and get it nice and stable, we’re working on offering some services that you can access with our CLI. Think phonegap build but better and more geared to our needs :wink:

Hope this clears things up!


#3

Hi! Could anyone tell me if it is possible to upgrade the version of ionic starting the CLI?


#4

The cli actually pulls from a github repo, and that version of ionic is actually updated ever release (beta 1, beta 2, etc)
The best way to keep up to date with the nightlies is by using a package manager like bower


#5

I was not clear, sorry. I refer to myself in this beta 3 and want to upgrade to beta 4. Something like “ionic update”.


#6

The latest version of the ionic cli wraps the cordova cli one-for-one. So whatever you can do in cordova you can now also do in ionic using the same commands. This will also allow the hooks to run as you described.