1 | Setting up the Xplat CLI repo
|
2 |
|
3 |
|
4 | * Create a fork from the [repo](https://github.com/Azure/azure-xplat-cli)
|
5 | * Clone the forked repo at a location say “D:\sdk”
|
6 | ```
|
7 | git clone git@github.com:your-github-username/azure-xplat-cli.git
|
8 | cd azure-xplat-cli
|
9 | git checkout dev
|
10 | git remote add upstream git@github.com:Azure/azure-xplat-cli.git
|
11 | git pull upstream dev
|
12 | git push origin dev (if there are any updates)
|
13 |
|
14 | Note: It is a best practice to create a separate branch for your feature from the dev branch. In this way the dev branch in your fork can always be synced easily with upstream and is not polluted with your current changes.
|
15 | git checkout -b mybranch
|
16 | git push origin mybranch
|
17 | ```
|
18 |
|
19 | * Installing the required npm modules from the root directory [```npm install```](https://docs.npmjs.com/cli/install)
|
20 | * It looks at the file "azure-xplat-cli/package.json" and will install all the module dependencies specified in it.
|
21 | * Xplat-CLI depends on [azure-sdk-for-node](https://github.com/Azure/azure-sdk-for-node), specified as ```"azure": "x.x.x",``` under dependencies. The node SDK contains the autogenerated service clients that make the underlying REST request when a command is executed from the cmd prompt.
|
22 | * Generate the metadata for help
|
23 | * Execute the command ```node bin/azure --gen```
|
24 | * **Optional** Installing this source code at a global location. From the root directory execute```npm install -g .```
|
25 | * Thus, when a command is executed ```azure site list```, it is executing the code that was installed from the repo at the global location
|
26 | * If this optional step is not performed, then the commands can be executed from the root directory of the current repo like this ```node bin/azure site list```
|
27 |
|
28 | * To verify the installation, execute the following commands:
|
29 | ```
|
30 | azure -v # It should display the current version number of xplat cli, mentioned in package.json
|
31 | azure -h # It should display the help for different commands supported by xplat cli
|
32 | ```
|
33 |
|
34 | Now, the CLI is ready for executing current commands and developing new commands.
|
35 |
|
\ | No newline at end of file |