メインコンテンツまでスキップ
Version: v6

ionic init

Initialize existing projects with Ionic

$ ionic init [options]

This command will initialize an Ionic app within the current directory. Usually, this means an ionic.config.json file is created. If used within a multi-app project, the app is initialized in the root ionic.config.json.

ionic init will prompt for a project name and then proceed to determine the type of your project. You can specify the name argument and --type option to provide these values via command-line.

If the --multi-app flag is specified, this command will initialize your project as a multi-app project, allowing for apps within monorepos and unconventional repository structures. See the multi-app docs for details. Once a multi-app project is initialized, you can run ionic init again within apps in your project to initialize them.

Examples

$ ionic init 
$ ionic init "My App"
$ ionic init "My App" --type=angular
$ ionic init --multi-app

Inputs

name

Description

The name of your project (e.g. myApp, "My App")

Options

--type =<type>

Description

Type of project (e.g. angular, react, vue, custom)

--force

Description

Initialize even if a project already exists

Aliases-f

--multi-app

Description

Initialize a multi-app project

Advanced Options

--project-id =<slug>

Description

Specify a slug for your app

--default

Description

Mark the initialized app as the default project