Currently, connection information is persisted in memory while running the CLI. In order for the CLI to support non-interactive mode in the future and be used for building scripts, the connection information must be persisted so that it can be used across the different commands, where each command runs in a separate process.
Azure CLI has implementation for cross-platform storage of credentials (https://github.com/Azure/azure-xplat-cli/blob/bea341b53149246fb61b95883aa34b72a7e980f2/lib/util/authentication/adalAuth.js#L32). We could reuse that code to implement storing credentials in the O365 CLI as well. Once we have that, we could adapt the CLI to run in non-immersive mode which can be used for building scripts.
Currently, connection information is persisted in memory while running the CLI. In order for the CLI to support non-interactive mode in the future and be used for building scripts, the connection information must be persisted so that it can be used across the different commands, where each command runs in a separate process.
Azure CLI has implementation for cross-platform storage of credentials (https://github.com/Azure/azure-xplat-cli/blob/bea341b53149246fb61b95883aa34b72a7e980f2/lib/util/authentication/adalAuth.js#L32). We could reuse that code to implement storing credentials in the O365 CLI as well. Once we have that, we could adapt the CLI to run in non-immersive mode which can be used for building scripts.