To allow integrating CLI for Microsoft 365 in other tools we should export CLI's API for executing commands in the CLI's npm package. This will allow other tools that want to use CLI get a direct access to the API and not need to rely on executing CLI as a child process and interact with it through stdout, stderr and exit codes. When you install CLI for M365 as a dependency in your Node.js project, you should be able to do import { executeCommandWithOutput } from '@pnp/cli-microsoft365 and use the executeCommandWithOutput function to execute the specified command with its arguments and capture its output.
After we add this, we should also add a new page about integrating CLI in other tools in our documentation.
To allow integrating CLI for Microsoft 365 in other tools we should export CLI's API for executing commands in the CLI's npm package. This will allow other tools that want to use CLI get a direct access to the API and not need to rely on executing CLI as a child process and interact with it through stdout, stderr and exit codes. When you install CLI for M365 as a dependency in your Node.js project, you should be able to do
import { executeCommandWithOutput } from '@pnp/cli-microsoft365and use theexecuteCommandWithOutputfunction to execute the specified command with its arguments and capture its output.After we add this, we should also add a new page about integrating CLI in other tools in our documentation.