| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
The Ionic command line interface (CLI) is your go-to tool for developing Ionic apps.
Use the ionic help command for more detailed task information.
📣 Support/Questions?: Please see our Support Page for general support questions. The issues on GitHub should be reserved for bug reports and feature requests.
❤️ Want to contribute?: Please see CONTRIBUTING.md.
$ npm install -g ionic📝 Note: For a global install of -g ionic, OSX/Linux users may need to prefix the command with sudo or can setup proper file permissions on OSX for npm to install without sudo.
We have rewritten the CLI from the ground up. Our main focus was to:
In doing so we decided to take a new approach to the CLI's structure. The base CLI installation now ships with global commands that are common to all Ionic apps.
Cordova commands have been namespaced and put into a CLI plugin, which is installed by default with new Ionic projects and can be installed in existing Ionic projects with npm i --save @ionic/cli-plugin-cordova. For full details, see below.
Here is a brief summary of changes in CLI 3. For more details and reasoning, see CHANGELOG.md.
$ ionic start --list$ npm install -g ionic@latest
$ ionic start myNewProject
$ cd ./myNewProject
$ ionic serve$ npm install -g ionic@latest
$ npm install --save-dev --save-exact @ionic/cli-plugin-ionic-angular@latest @ionic/cli-plugin-cordova@latest
$ ionic help$ npm install -g ionic@latest
$ ionic start myNewProject blank --type ionic1
$ cd ./myNewProject
$ ionic serve$ npm install -g ionic@latest
$ npm install --save-dev --save-exact @ionic/cli-plugin-ionic1@latest @ionic/cli-plugin-cordova@latest
$ ionic helpIntegrate Ionic with Cordova to bring native capabilities to your app.
$ npm install -g cordova
$ npm install --save-dev --save-exact @ionic/cli-plugin-cordova@latest
$ ionic cordova --help
$ ionic cordova run iosThe serve command can add some proxies to the http server. These proxies are useful if you are developing in the browser and you need to make calls to an external API. With this feature you can proxy request to the external api through the ionic http server preventing the No 'Access-Control-Allow-Origin' header is present on the requested resource error.
In the ionic.config.json file you can add a property with an array of proxies you want to add. The proxies are object with the following properties:
{
"name": "appname",
"email": "",
"app_id": "",
"proxies": [
{
"path": "/v1",
"proxyUrl": "https://api.instagram.com/v1"
}
]
}
Using the above configuration, you can now make requests to your local server at http://localhost:8100/v1 to have it proxy out requests to https://api.instagram.com/v1
To proxy CLI requests, you will need to install the global CLI proxy plugin:
$ npm install -g @ionic/cli-plugin-proxyThen, set any of the following environment variables:
$ export http_proxy=http://internal.proxy.com
$ export HTTP_PROXY=http://internal.proxy.com
$ export PROXY=http://internal.proxy.com
$ export IONIC_HTTP_PROXY=http://internal.proxy.comFor example:
$ HTTP_PROXY=http://internal.proxy.com ionic startTo open Ionic documentation from the Ionic CLI, use ionic docs.
The old version of the CLI can be installed with the legacy tag:
npm install -g ionic@legacy| Back | FazBrowse Home | New Git URL |