We've just published a new version of the Office 365 CLI with new commands for working with and managing Office 365 tenants and SharePoint Framework projects on any platform.
Manage Office 365 and SharePoint Framework projects on any platform
Office 365 CLI is a cross-platform CLI that allows you to manage various configuration settings of Office 365 and SharePoint Framework projects no matter which operating system or shell you use.
While building solutions for Office 365 expands beyond the Windows operating system, managing many of the platform settings is possible only through PowerShell on Windows. As more and more users work on non-Windows machines, it's inconvenient for them to have to use a Windows virtual machine to configure their tenants. With the Office 365 CLI you can configure your tenant no matter which operating system you use. Additionally, using the Office 365 CLI, you can manage your SharePoint Framework projects.
New version of Office 365 CLI - v1.6.0
New version of the Office 365 CLI with a few new commands and extended support for upgrading SharePoint Framework projects.
Add fields to content types
Continuing the work from the previous releases, we extended the Office 365 CLI with the ability to add fields to content types. After you've provisioned fields and content types, the next step is to combine them and this is now possible using this latest version of the Office 365 CLI.
To add an existing site column to a content type, execute:
spo contenttype field set --webUrl https://contoso.sharepoint.com/sites/portal --contentTypeId 0x01007926A45D687BA842B947286090B8F67D --fieldId ebe7e498-44ff-43da-a7e5-99b444f656a5
For more information about working with list- and site columns using the Office 365 CLI, see the documentation at aka.ms/o365-cli.
Get information about modern page sections
When managing modern pages using the Office 365 CLI, you will likely need to get information about sections on the particular page. Sections are the base building block of a modern page that contain columns with components.
For this release of the Office 365 CLI, fellow SharePoint MVP - Rodrigo Romano contributed two commands to get information about sections of the particular page. To list all sections of the particular page, execute:
spo page section list --webUrl https://contoso.sharepoint.com/sites/team-a --name home.aspx
To get more information about the particular section, execute:
spo page section get --webUrl https://contoso.sharepoint.com/sites/team-a --name home.aspx --section 1
For more information about working with modern pages using the Office 365 CLI, see the documentation at aka.ms/o365-cli.
Manage Microsoft Teams
In this latest release, we are proud to announce, that the Office 365 CLI adds support for a new workload - Microsoft Teams. Microsoft Teams is a powerful solution for facilitating collaboration that is a part of Office 365. As Microsoft Teams evolve, so does the need to manage them. For this version of the Office 365 CLI, fellow-MVP Wictor Wilén contributed a command to list Teams available in your tenant. You can do this, by executing:
graph teams list
Wictor continues working on additional commands for managing Microsoft Teams which you should see in the future versions of the Office 365 CLI.
For more information about working with Microsoft Teams using the Office 365 CLI, see the documentation at aka.ms/o365-cli.
Extended support for upgrading SharePoint Framework projects
Recently, we've extended the Office 365 CLI to help you with upgrading your SharePoint Framework projects to newer versions of the SharePoint Framework. Regularly, Microsoft publishes new versions of the SharePoint Framework. Depending on the version, sometimes the upgrade is as easy as installing the latest npm packages. But sometimes, you need to adjust your project config files or other settings. Because there are no step-by-step instructions, you either end up missing steps and having a broken project, or spending precious time manually trying to determine what has changed in the latest version of the SharePoint Framework. Office 365 CLI significantly simplifies the upgrade process, by providing you with a report with upgrade instructions tailored to your project.
For this version of the SharePoint Framework, fellow-MVP Vincent Biret and Velin Georgiev, did an awesome job in closing the gap in the versions of the SharePoint Framework covered by the project upgrade command. Thanks to their effort, the Office 365 CLI supports now upgrading SharePoint Framework projects created using all versions from 1.0.0 to 1.5.1.
If you haven't done it yet, try upgrading your SharePoint Framework projects using the Office 365 CLI and tell us what you think!
This release wouldn't be possible without the help of (in alphabetical order) Stefan Bauer, Vincent Biret, Velin Georgiev, Rodrigo Romano and Wictor Wilén.
Thank you all for the time you chose to spend on the Office 365 CLI and your help to advance it!
Work in progress
Here are some things that we're currently working on.
Setup script for the PnP SharePoint Starter Kit
Recently, the SharePoint PnP team released the SharePoint Starter Kit: an end-to-end solution illustrating how to use the latest capabilities to build a modern intranet on Office 365. This starter kit will keep evolving as new capabilities are added to Office 365.
To help you setup the solution in your tenant, the PnP team released a setup script based on PnP PowerShell. Due to the current limitations of PnP PowerShell this script can be used only on Windows.
What if we had an equivalent script built in bash, using the Office 365 CLI which you could use on any platform?
I've already started working on this script in a separate repo. The basic structure is almost in place and ready for external contributions. Would you be interested in helping out with it?
More commands, what else
Office 365 is evolving and new capabilities are being released every day. With the Office 365 CLI we aim to help you manage your tenant on any platform in a consistent way, no matter which part of Office 365 you interact with. So far, we barely scratched the surface with what's possible in Office 365. In the upcoming versions of the Office 365 CLI, you can expect us to add more commands across the different workloads in Office 365.
Try it today
Get the latest release of the Office 365 CLI from npm by executing in the command line:
npm i -g @pnp/office365-cli
If you need more help getting started or want more details about the commands, the architecture or the project, go to aka.ms/o365cli. If you see any room for improvement, please, don't hesitate to reach out to us either on GitHub, on twitter with the #office365cli hashtag or on gitter.