LinuxCommandLibrary

ionic

Develop, build, and run Ionic applications

TLDR

Create a new project

$ ionic start
copy

Start a local dev server for app dev/testing
$ ionic serve
copy

Generate new app component, directive, page, pipe, provider, or tabs
$ ionic g [page]
copy

Run app on an Android/iOS device
$ ionic cordova run [android|ios] --device
copy

Check the health of an Ionic app
$ ionic doctor [check]
copy

Display versions of Ionic, Cordova, environment, etc.
$ ionic info
copy

SYNOPSIS

ionic [command] [options]

PARAMETERS

-d, --debug
    Output debugging information

-e, --verbose
    More verbose logs (implies --debug)

--no-interactive
    Skip user prompts (deprecated, use --no-prompt)

--no-color
    Disable colored output

--help
    Print help for command

--version
    Display CLI version

--profiler
    Enable performance profiling

--config-file <path>
    Use custom Ionic config file

DESCRIPTION

The ionic command-line interface (CLI) is the official tool for the Ionic Framework, an open-source SDK for building performant, cross-platform mobile apps and Progressive Web Apps (PWAs) using web technologies like HTML, CSS, JavaScript/TypeScript, Angular, React, or Vue.

It simplifies workflows by providing commands to scaffold projects, develop with live reload, build optimized bundles, and deploy to iOS, Android, or web. Key capabilities include integration with Capacitor (native runtime) or Cordova (plugins), UI component generation, and testing tools.

Developers use it to ionic start new apps from templates (blank, tabs, sidemenu), ionic serve for hot-reloading previews, ionic build for production, and ionic capacitor run for native emulation. The CLI handles TypeScript compilation, bundling with webpack/Vite, and environment configurations, making hybrid app development efficient without native code.

CAVEATS

Requires Node.js (≥14) and npm; install via npm i -g @ionic/cli. Node module, not native binary. Subcommands like start, serve have additional options (run ionic <cmd> --help).

INSTALLATION

npm install -g @ionic/cli
Verify: ionic --version

CORE COMMANDS

start: New project from template
serve: Dev server with live reload
build: Production build
generate (g): Pages, components
capacitor: Native iOS/Android sync

HISTORY

Released in 2013 with Ionic v1 for Cordova apps. Evolved through v2-6 with Angular focus, now v7+ (2022+) emphasizes Capacitor, web-first PWAs, and frameworks like React/Vue. Maintained by Ionic Team.

SEE ALSO

npm(1), node(1)

Copied to clipboard