But then, it also didn’t.
And that can be confusing, in particular when you are updating after a new release. So, let’s find out how the Unified CLI works.
The Big Picture
Let’s start with an image that might very well say enough and if it doesn’t, will help us as we go through the different components of the Unified CLI.
The global appcelerator NPM package that you install via
[sudo] npm i -g appcelerator or Studio is pretty much an empty shell as you can see on its repo. All it needs to do is handle installing and switching between different core packages. Very similar (but not entirely identical) to what Grunt does.
We’ve done this to make it easier to switch between versions that work together on specific versions of the Titanium SDKs and deployments of Arrow Cloud.
appc use to list all available versions and
appc use <version> to install or switch to one.
NOTE: Be aware that
appc -vwill get you the version of the active core package, not the installer. To get the version of the installer as well, run
appc -v -o json.
The Core Package
The core package has a plugin architecture. When you use
appc run, either the Arrow or Titanium plugin will volunteer to handle the request, depending on the type of project you’re in. When you run
appc new then both plugins will offer options to select from.
The Titanium plugin depends on the original Titanium and Alloy CLI, as does Arrow on the ACS CLI. These are local dependencies, so there’s no need to install the original CLIs to build a Titanium or Arrow app via the Unified CLI.
NOTE: Be aware that the global Titanium CLI does share its configuration (in
~/.titanium) with the one embedded in the active core.
Switching Node.js versions
If you install or switch between Node.js versions that have different APIs, these addons will need to be rebuild. Since 4.2.2 of the Appcelerator Installer we try to detect and do this for you automatically. If you somehow still run into
[Error: Module did not self-register.] and similar messages, you can force a reinstall of a core package by adding the
appc use 5.2.0 --force
Access to the embedded Titanium, Alloy and ACS CLIs
You can still access the original CLIs as they are embedded in the active core package. Simply prefix the command with
appc <cli> <command>. For example:
appc alloy generate controller my-controller
This also allows you to get the versions of the embedded CLIs:
appc ti -v(also included in
appc alloy -v
appc acs -v
NOTE: We prefer to use
appc cloud, which is simply an alias of