Skip to content

Commit

Permalink
Renames 'Office 365 CLI' to 'CLI for Microsoft 365'. Closes #1635
Browse files Browse the repository at this point in the history
  • Loading branch information
waldekmastykarz committed Jul 24, 2020
1 parent a5b65f3 commit c2c0c9c
Show file tree
Hide file tree
Showing 4,918 changed files with 1,291 additions and 1,294 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
16 changes: 8 additions & 8 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
defaults: &defaults
working_directory: ~/office365-cli
working_directory: ~/cli-microsoft365
docker:
- image: circleci/node:12.14.0

Expand All @@ -10,7 +10,7 @@ jobs:
steps:
- checkout
- attach_workspace:
at: ~/office365-cli
at: ~/cli-microsoft365
- restore_cache:
key: dependency-cache-{{ checksum "package.json" }}
- run:
Expand All @@ -30,7 +30,7 @@ jobs:
<<: *defaults
steps:
- attach_workspace:
at: ~/office365-cli
at: ~/cli-microsoft365
- run:
name: Test
command: npm test
Expand All @@ -47,7 +47,7 @@ jobs:
<<: *defaults
steps:
- attach_workspace:
at: ~/office365-cli
at: ~/cli-microsoft365
- run:
name: Write .npmrc
command: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
Expand All @@ -61,7 +61,7 @@ jobs:
<<: *defaults
steps:
- attach_workspace:
at: ~/office365-cli
at: ~/cli-microsoft365
- run:
name: Write .npmrc
command: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
Expand All @@ -75,20 +75,20 @@ jobs:
<<: *defaults
steps:
- attach_workspace:
at: ~/office365-cli
at: ~/cli-microsoft365
- run:
name: Write .npmrc
command: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
- run:
name: Publish
command: npm publish --access public
deploy_docs:
working_directory: ~/office365-cli/docs/manual
working_directory: ~/cli-microsoft365/docs/manual
docker:
- image: circleci/python:3.6.6-jessie-node
steps:
- attach_workspace:
at: ~/office365-cli
at: ~/cli-microsoft365
- add_ssh_keys:
fingerprints:
- "06:39:32:e4:a1:64:01:19:0e:61:a0:ad:6a:53:37:32"
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ assignees: ''
### Environment

> Provide details of the environment in which this issue was discovered, please include the operating system, shell and version of CLI used (`o365 version`), for example, "_MacOS Catalina, bash, 2.0.0_"
> Provide details of the environment in which this issue was discovered, please include the operating system, shell and version of CLI used (`m365 version`), for example, "_MacOS Catalina, bash, 2.0.0_"
>
> _(DELETE THIS PARAGRAPH AFTER READING)_
>
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/sample.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: Sample Script
about: Created an awesome script using the Office 365 CLI? Let us know by submitting it to our Sample Scripts gallery
about: Created an awesome script using the CLI for Microsoft 365? Let us know by submitting it to our Sample Scripts gallery
title: 'New sample script: <short description>'
labels: ''
assignees: ''
Expand Down
6 changes: 3 additions & 3 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ Closes #
>
> For example, a pull request for adding 'teams tab add' command, would include...
>
> - src/o365/teams/commands.ts
> - src/o365/teams/commands/tab/teams-tab-add.ts
> - src/o365/teams/commands/tab/teams-tab-add.spec.ts
> - src/m365/teams/commands.ts
> - src/m365/teams/commands/tab/teams-tab-add.ts
> - src/m365/teams/commands/tab/teams-tab-add.spec.ts
> - docs/manual/mkdocs.yml
> - docs/manual/docs/cmd/teams/tab/tab-add.md
>
Expand Down
30 changes: 15 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,53 +1,53 @@
<img src="./docs/manual/docs/images/pnp-office365-cli-blue.svg" alt="Office 365 CLI" height=78 />
<img src="./docs/manual/docs/images/pnp-cli-microsoft365-blue.svg" alt="CLI for Microsoft 365" height=78 />

@latest/@next (master) |
:--------------: |
[![CircleCI](https://circleci.com/gh/pnp/office365-cli/tree/master.svg?style=shield&circle-token=ce99e8046a231e1959248a61e7e32f9ae1abc8cf)](https://circleci.com/gh/pnp/office365-cli/tree/master)|
[![Coverage Status](https://coveralls.io/repos/github/pnp/office365-cli/badge.svg?branch=master)](https://coveralls.io/github/pnp/office365-cli?branch=master)|

# Office 365 CLI
# CLI for Microsoft 365

Using the Office 365 CLI, you can manage your Microsoft Office 365 tenant and SharePoint Framework projects on any platform. No matter if you are on Windows, macOS or Linux, using Bash, Cmder or PowerShell, using the Office 365 CLI you can configure Office 365, manage SharePoint Framework projects and build automation scripts.
Using the CLI for Microsoft 365, you can manage your Microsoft 365 tenant and SharePoint Framework projects on any platform. No matter if you are on Windows, macOS or Linux, using Bash, Cmder or PowerShell, using the CLI for Microsoft 365 you can configure Microsoft 365, manage SharePoint Framework projects and build automation scripts.

[![asciicast](https://asciinema.org/a/265151.png)](https://asciinema.org/a/265151)
[![asciicast](https://asciinema.org/a/346365.png)](https://asciinema.org/a/346365)

## Installation

The Office 365 CLI is distributed as an NPM package. To use it, install it globally using:
The CLI for Microsoft 365 is distributed as an NPM package. To use it, install it globally using:

```sh
npm i -g @pnp/office365-cli
npm i -g @pnp/cli-microsoft365
```

or using yarn:

```sh
yarn global add @pnp/office365-cli
yarn global add @pnp/cli-microsoft365
```

The beta version of the Office 365 CLI can be installed by using the `@next` tag:
The beta version of the CLI for Microsoft 365 can be installed by using the `@next` tag:

```sh
npm i -g @pnp/office365-cli@next
npm i -g @pnp/cli-microsoft365@next
```

## Getting started

Start managing the settings of your Office 365 tenant by logging in to it, using the `login` command, for example:
Start managing the settings of your Microsoft 365 tenant by logging in to it, using the `login` command, for example:

```sh
o365 login
m365 login
```

> Office 365 CLI will automatically detect the URL of your tenant based on the account that you use to sign in.
> CLI for Microsoft 365 will automatically detect the URL of your tenant based on the account that you use to sign in.
To list all available commands, type in the Office 365 CLI prompt `help`:
To list all available commands, type in the CLI for Microsoft 365 prompt `help`:

```sh
o365 help
m365 help
```

See the [User Guide](docs/manual/docs/user-guide/installing-cli.md) to learn more about the Office 365 CLI and its capabilities.
See the [User Guide](docs/manual/docs/user-guide/installing-cli.md) to learn more about the CLI for Microsoft 365 and its capabilities.

## Sharing is Caring

Expand Down
32 changes: 16 additions & 16 deletions docs/guides/adding-command.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
# Adding a command

Following article describes how to add a new command to the Office 365 CLI.
Following article describes how to add a new command to the CLI for Microsoft 365.

## Command files

Each command consists of three files:

- command implementation, located under **./src/o365/[service]/commands**, eg. *./src/o365/spo/commands/login.ts*
- command unit tests, located under **./src/o365/[service]/commands**, eg. *./src/o365/spo/commands/login.spec.ts*
- command implementation, located under **./src/m365/[service]/commands**, eg. *./src/m365/spo/commands/login.ts*
- command unit tests, located under **./src/m365/[service]/commands**, eg. *./src/m365/spo/commands/login.spec.ts*
- command documentation page, located under **./docs/manual/docs/cmd/[service]**, eg. *./docs/manual/docs/cmd/spo/login.md*

Additionally, each command is listed in:

- list of all commands for the given service, located in **./src/o365/[service]/commands.ts**, eg. *./src/o365/spo/commands.ts*
- list of all commands for the given service, located in **./src/m365/[service]/commands.ts**, eg. *./src/m365/spo/commands.ts*
- the documentation table of contents, located in **./docs/manual/mkdocs.yml**

## Add new files

Commands are organized by the Office 365 service, such as SharePoint Online (spo), that they apply to. Before building your command, find the right folder corresponding with your command in the project structure.
Commands are organized by the Microsoft 365 service, such as SharePoint Online (spo), that they apply to. Before building your command, find the right folder corresponding with your command in the project structure.

### Create new files

In the **./src/o365/[service]/commands** folder, create two files for your command: **my-command.ts** for the command implementation, and **my-command.spec.ts** for the unit tests.
In the **./src/m365/[service]/commands** folder, create two files for your command: **my-command.ts** for the command implementation, and **my-command.spec.ts** for the unit tests.

### Define command name constant

In the **./src/o365/[service]/commands.ts** file, define a constant with your command's name including the service prefix. You will use this constant to refer to the command in its implementation, unit tests, help, etc.
In the **./src/m365/[service]/commands.ts** file, define a constant with your command's name including the service prefix. You will use this constant to refer to the command in its implementation, unit tests, help, etc.

### Add the command manual page

Expand All @@ -35,7 +35,7 @@ In the **./docs/manual/docs/cmd/[service]** folder, create new file for your com
## Implement command

Each command in the Office 365 CLI is defined as a class extending the [Command](../../src/Command.ts) base class. At minimum a command must define `name`, `description`, `commandAction` and `commandHelp`:
Each command in the CLI for Microsoft 365 is defined as a class extending the [Command](../../src/Command.ts) base class. At minimum a command must define `name`, `description`, `commandAction` and `commandHelp`:

```ts
import config from '../../../config';
Expand Down Expand Up @@ -80,11 +80,11 @@ class MyCommand extends Command {
module.exports = new MyCommand();
```

Depending on your command and the service for which you're building the command, there might be a base class that you can use to simplify the implementation. For example for SPO, you can inherit from the [SpoCommand](../../src/o365/spo/SpoCommand.ts) base class. This class contains a number of helper methods simplifying your implementation.
Depending on your command and the service for which you're building the command, there might be a base class that you can use to simplify the implementation. For example for SPO, you can inherit from the [SpoCommand](../../src/m365/spo/SpoCommand.ts) base class. This class contains a number of helper methods simplifying your implementation.

### Tracking command usage

The Office 365 CLI tracks usage of the different commands using Azure Application Insights. By default, for each command the CLI tracks its name and whether it's been executed in debug/verbose mode or not. If your command has additional properties that should be included in the telemetry, you can define them by overriding the **getTelemetryProperties** property and adding your properties to the **telemetryProps** object:
The CLI for Microsoft 365 tracks usage of the different commands using Azure Application Insights. By default, for each command the CLI tracks its name and whether it's been executed in debug/verbose mode or not. If your command has additional properties that should be included in the telemetry, you can define them by overriding the **getTelemetryProperties** property and adding your properties to the **telemetryProps** object:

```ts
class SpoMyCommand extends Command {
Expand Down Expand Up @@ -142,7 +142,7 @@ class SpoMyCommand extends Command {
### Defining command help

Vorpal, the engine upon which the Office 365 CLI is built, renders rudimentary help for each command. In the Office 365 CLI we extend this basic information with additional remarks and examples to help users work with the CLI.
Vorpal, the engine upon which the CLI for Microsoft 365 is built, renders rudimentary help for each command. In the CLI for Microsoft 365 we extend this basic information with additional remarks and examples to help users work with the CLI.

When building command help, you can get the standard help from Vorpal by calling: `vorpal.find('commandname').helpInformation()`. Using the `log` method you can include additional information.

Expand Down Expand Up @@ -176,11 +176,11 @@ Finish the implementation of your command, by exporting the instance of the comm
module.exports = new SpoMyCommand();
```

On runtime, Office 365 CLI iterates through all JavaScript files in the **o365** folder and registers all exported command classes as commands in the CLI.
On runtime, CLI for Microsoft 365 iterates through all JavaScript files in the **m365** folder and registers all exported command classes as commands in the CLI.

### Additional command capabilities

When building Office 365 CLI commands, you can use additional features such as optional and required arguments, autocomplete or validation. For more information see the [Vorpal command API documentation](https://github.com/dthree/vorpal/wiki/API-%7C-vorpal.command).
When building CLI for Microsoft 365 commands, you can use additional features such as optional and required arguments, autocomplete or validation. For more information see the [Vorpal command API documentation](https://github.com/dthree/vorpal/wiki/API-%7C-vorpal.command).

## Implement unit tests

Expand All @@ -198,7 +198,7 @@ See the existing test files to get a better understanding of how they are struct
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
"args": [
"--colors",
"${workspaceFolder}/dist/o365/aad/commands/approleassignment/**/*.spec.js",
"${workspaceFolder}/dist/m365/aad/commands/approleassignment/**/*.spec.js",
],
"console": "integratedTerminal",
"protocol": "inspector",
Expand All @@ -212,10 +212,10 @@ Once you're done with your unit tests, run `npm test` to verify that you're cove

Each command has a corresponding manual page. The contents of this page are almost identical to the help implemented in the command itself. This way, users working with the CLI can get the help directly inside the CLI, while users interested in the capabilities of the CLI, can browse through the help pages published on the Internet.

Start filling the help page contents by starting the Office 365 CLI and requesting help for your command:
Start filling the help page contents by starting the CLI for Microsoft 365 and requesting help for your command:

```sh
o365$ spo my-command --help
m365$ spo my-command --help
```

Copy the output of the command and use as a starting point for creating the documentation page. The main difference between the help displayed in the CLI and the manual page is the formatting. In the command line, the CLI uses chalk to emphasize information. The manual uses Markdown to format the output. To maintain consistency, refer to other manual pages to see how they are structured and how the information is presented.
Expand Down
10 changes: 5 additions & 5 deletions docs/guides/mpa.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ Before you start contributing to this project, you will need Node.js `>= 12.0.0`
- run `npm i` to restore dependencies
- run `npm run build` to build the project
- run `npm test` to run test and check current code coverage
- run `npm link` to install the project locally. This is useful if you want to test your changes to the CLI in the CLI itself. After linking the local package, you can start your local version of the CLI by typing in the command line `office365`.
- run `npm link` to install the project locally. This is useful if you want to test your changes to the CLI in the CLI itself. After linking the local package, you can start your local version of the CLI by typing in the command line `m365`.

> If you installed the CLI globally using the `npm i -g @pnp/office365-cli` command, we recommend that you uninstall it first, before running `npm link`
> If you installed the CLI globally using the `npm i -g @pnp/cli-microsoft365` command, we recommend that you uninstall it first, before running `npm link`
After changing the code, run the `npm run build` command to rebuild the project and see your changes integrated in the local version of the CLI.

Expand All @@ -29,9 +29,9 @@ If you renamed files:

### Documentation

Office 365 CLI uses [MkDocs](http://www.mkdocs.org) to publish documentation pages. See more information about installing MkDocs on your operating system at [http://www.mkdocs.org/#installation](http://www.mkdocs.org/#installation).
CLI for Microsoft 365 uses [MkDocs](http://www.mkdocs.org) to publish documentation pages. See more information about installing MkDocs on your operating system at [http://www.mkdocs.org/#installation](http://www.mkdocs.org/#installation).

Office 365 CLI documentation uses the `mkdocs-material` theme. See more information about installing mkdocs-material on your operating system at [https://squidfunk.github.io/mkdocs-material](https://squidfunk.github.io/mkdocs-material).
CLI for Microsoft 365 documentation uses the `mkdocs-material` theme. See more information about installing mkdocs-material on your operating system at [https://squidfunk.github.io/mkdocs-material](https://squidfunk.github.io/mkdocs-material).

Once you have MkDocs installed on your machine, in the command line:

Expand All @@ -44,4 +44,4 @@ Alternatively, you can use the mkdocs-material Docker image to test documentatio
- run `cd ./docs/manual` to change directory to where the manual pages are stored
- run `docker run --rm -it -p 8000:8000 -v ${PWD}:/docs squidfunk/mkdocs-material:3.1.0` to start the local web server with MkDocs and view the documentation in the web browser
- on Windows:
- run `docker run --rm -it -p 8000:8000 -v c:/projects/office365-cli/docs/manual:/docs squidfunk/mkdocs-material:3.1.0` to start the local web server with MkDocs and view the documentation in the web browser
- run `docker run --rm -it -p 8000:8000 -v c:/projects/cli-microsoft365/docs/manual:/docs squidfunk/mkdocs-material:3.1.0` to start the local web server with MkDocs and view the documentation in the web browser
6 changes: 3 additions & 3 deletions docs/manual/docs/about/comparison-powershell.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Comparison to SharePoint and Office 365 PowerShell
# Comparison to SharePoint and Microsoft 365 PowerShell

Following table lists the different Office 365 CLI commands and how they map to PowerShell cmdlets for SharePoint and Office 365.
Following table lists the different CLI for Microsoft 365 commands and how they map to PowerShell cmdlets for SharePoint and Microsoft 365.

PowerShell Cmdlet|Source|Office 365 CLI command
PowerShell Cmdlet|Source|CLI for Microsoft 365 command
-----------------|------|----------------------
Add-SPOGeoAdministrator|Microsoft.Online.SharePoint.PowerShell|
Add-SPOHubSiteAssociation|Microsoft.Online.SharePoint.PowerShell|[spo hubsite connect](../cmd/spo/hubsite/hubsite-connect.md)
Expand Down

0 comments on commit c2c0c9c

Please sign in to comment.