# @capacitor/cli

> Capacitor: Cross-platform apps with JavaScript and the web

Latest version **8.5.2** (published 2026-09-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install @capacitor/cli
pnpm add @capacitor/cli
yarn add @capacitor/cli
bun add @capacitor/cli
```

Provides the commands `cap`, `capacitor`.

## Health

**Score 75/100 (B)** — status: active.

Positive: has types; no vulnerabilities; has provenance; recently updated; high maintenance score; high quality score; popular repo.

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 8.5.2 |
| Published | 2026-09-11 |
| First published | 2018-01-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=22.0.0 |
| Dependencies | 18 |
| Unpacked size | 890.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 16649 |
| Author | Ionic Team |
| Maintainers | itschaced, ionicjs, jcesarmobile, vmfo, jpender, mark-ionic, chuckytuh, alexgerardojacinto, os-pedrobilro, harvdoggy, jpender-os, ndr, kepatoto, rui.mendes, markemer, capacitor-plugin-bot, eric-ionic, os-ruialves |
| Keywords | ionic, ionic framework, capacitor, universal app, progressive web apps, cross platform |

## Links

- npm: https://www.npmjs.com/package/@capacitor/cli
- Repository: https://github.com/ionic-team/capacitor
- Homepage: https://capacitorjs.com
- Issues: https://github.com/ionic-team/capacitor/issues
- npm.io page: https://npm.io/package/@capacitor/cli

## Dependencies (18)

- [tar](https://npm.io/package/tar.md) ^7.5.3
- [open](https://npm.io/package/open.md) ^8.4.0
- [debug](https://npm.io/package/debug.md) ^4.4.0
- [kleur](https://npm.io/package/kleur.md) ^4.1.5
- [plist](https://npm.io/package/plist.md) ^3.1.0
- [tslib](https://npm.io/package/tslib.md) ^2.8.1
- [xcode](https://npm.io/package/xcode.md) ^3.0.1
- [rimraf](https://npm.io/package/rimraf.md) ^6.0.1
- [semver](https://npm.io/package/semver.md) ^7.6.3
- [xml2js](https://npm.io/package/xml2js.md) ^0.6.2
- [prompts](https://npm.io/package/prompts.md) ^2.4.2
- [fs-extra](https://npm.io/package/fs-extra.md) ^11.2.0
- [commander](https://npm.io/package/commander.md) ^12.1.0
- [env-paths](https://npm.io/package/env-paths.md) ^2.2.0
- [native-run](https://npm.io/package/native-run.md) ^2.0.3
- [@ionic/utils-terminal](https://npm.io/package/@ionic/utils-terminal.md) ^2.3.5
- [@ionic/utils-subprocess](https://npm.io/package/@ionic/utils-subprocess.md) ^3.0.1
- [@ionic/cli-framework-output](https://npm.io/package/@ionic/cli-framework-output.md) ^2.2.8

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 8.5.2 (latest) — 2026-09-11
- 8.5.3-nightly-20260915T151242.0 (nightly) — 2026-09-15
- 6.2.2 (latest-6) — 2026-08-31
- 7.6.9 (latest-7) — 2026-08-31
- 8.4.3 (latest-8.4) — 2026-08-31
- 9.0.0-alpha.6 (next) — 2026-07-14
- 9.0.0-dev-20260319T162951.0 (dev) — 2026-03-19
- 5.7.8 (latest-5) — 2024-08-07
- 4.8.2 (latest-4) — 2024-03-15
- 4.7.2-dev-20230330T154908.0 (dev-4) — 2023-03-30
- 3.9.0 (latest-3) — 2022-10-21
- 2.5.0 (latest-2) — 2021-09-07
- 8.5.3-nightly-20260914T151356.0 — 2026-09-14
- 8.5.3-nightly-20260911T151232.0 — 2026-09-11
- 8.5.2-nightly-20260910T151316.0 — 2026-09-10
- … 1409 more at https://npm.io/package/@capacitor/cli/versions

## README

# Capacitor CLI

The Capacitor command-line interface (CLI) is a tool for creating and managing Capacitor applications. While it can be installed globally, it's recommended to install it locally in your project and execute through `npm` scripts.

## Installation

### Project Installation (Recommended)

Install the CLI locally in your project:

```bash
npm install @capacitor/cli --save-dev
```

### Global Installation

While not recommended for project use, you can install the CLI globally:

```bash
npm install -g @capacitor/cli
```

## Using Capacitor CLI

The CLI can be used through the `capacitor` or `cap` command. When installed locally, use it through your project's `npm` scripts or `npx`.

Common commands:

- `cap init`: Initialize a new Capacitor project
- `cap add`: Add a native platform (ios, android)
- `cap sync`: Sync your web code to your native projects

For detailed information, consult the [Getting Started guide](https://capacitorjs.com/docs/getting-started).

## Local Development

If you're contributing to the Capacitor CLI or testing local changes:

1. Clone and setup:

   ```bash
   git clone https://github.com/ionic-team/capacitor.git
   cd cli
   npm install
   ```

2. Build the CLI:

   ```bash
   npm run build
   ```

3. Create a local link:

   ```bash
   npm link
   ```

4. Development workflow:
   - Run `npm run watch` to automatically rebuild on changes
   - Use `capacitor` or `cap` commands to test your changes
   - Run `npm test` to execute the test suite

## Debugging

### Using VS Code Launch Configurations

The CLI includes VS Code launch configurations for debugging. To debug a CLI command:

1. Open the project in VS Code
2. Right now we don't have debugging working in the ts files, so select one of the .js files inside of /dist/\*\*.js
3. Place a breakpoint
4. Press F5 or go to Run > Start Debugging
5. Select a launch config and run filling out the path you want to run the cli in, and the command that you want run.

You can add more configurations by copying and modifying the existing ones in `.vscode/launch.json`.

## Contributing

Contributions are welcome! Please read our [Contributing Guide](https://github.com/ionic-team/capacitor/blob/main/CONTRIBUTING.md) for details.

### License

- [MIT](https://github.com/ionic-team/capacitor/blob/HEAD/LICENSE)

---
_Source: https://npm.io/package/@capacitor/cli · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
