Skip to content

Expose CLI commands to JS api #2238

Open
@kedrzu

Description

@kedrzu

Is your feature request related to a problem? Please describe.

Sometimes there is a need to use CLI command in a JS script, for example, in a custom CI pipeline.
Currently, we have to do it with running the CLI as a child process (ie. using execa). We even do it in our own code to retrieve stack output (check this https://github.com/webiny/webiny-js/blob/next/packages/cli-plugin-deploy-pulumi/utils/getStackOutput.js#L14).

Describe the solution you'd like.

We should have all of our CLI commands inside our packages to be used programmatically. CLI should be merely a wrapper to access these commands from a terminal.

Describe alternatives you've considered.

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions