ionic-team / capacitor

Build cross-platform Native Progressive Web Apps for iOS, Android, and the Web ⚡️
https://capacitorjs.com
MIT License
12.11k stars 1k forks source link

feat: Capacitor CLI - Javascript API #5718

Open Marcoru97 opened 2 years ago

Marcoru97 commented 2 years ago

Feature Request

Description

Would it be possible to also access the CLI commands via a Javascript API? At the moment only the type definitions are "officially" exposed and it is only possible somehow through hacky solutions.

Platform(s)

Preferred Solution

Exposed JS functions within the @capacitor/cli package, with their CLI arguments and configs as parameters.

Alternatives

Additional Context

cgrabmann commented 1 year ago

This feature would be really nice.

Was trying to create a little script that syncs a modified config with the server.url set with the appropriate address when serving my Angular app locally.
That way I would not need to temporarily modify the capacitor.config.ts file.