|
| 1 | +GitHub Codespace gets you up and coding faster with fully configured, secure cloud development environments native to GitHub. |
| 2 | + |
| 3 | +## Create a codespace |
| 4 | +Currently, the dev container is available in [azure-cli-extensions](https://github.com/Azure/azure-cli-extensions), as it's the repository that our contributors mainly contribute to. However, we can still contribute codes to [azure-cli](https://github.com/Azure/azure-cli) based on it. |
| 5 | + |
| 6 | +In the repository of GitHub, we can create a codespace as follows: |
| 7 | + |
| 8 | + |
| 9 | +## Login account of GitHub |
| 10 | +Once codespace is started (take a couple of minutes), we will see the following prompt in the integrated terminal: |
| 11 | + |
| 12 | + |
| 13 | +It will help us log in to our account in an interactive way, after logging in, we don't need to do it again in the fresh terminals: |
| 14 | + |
| 15 | + |
| 16 | +## Run ./easy_setup |
| 17 | +As we can see, Python virtual environment has been automatically activated. We can directly execute the script to setup the development environment: |
| 18 | +```bash |
| 19 | +$ ./easy_setup |
| 20 | +``` |
| 21 | + |
| 22 | +Usually the whole process will take several minutes. When the following prompt is displayed, it means the whole setup process has been completed: |
| 23 | + |
| 24 | + |
| 25 | +## Fundamentals of codegen tool |
| 26 | +Once the development environment is setup, we can launch the codegen tool via: |
| 27 | +```bash |
| 28 | +$ aaz-dev run -c azure-cli -e azure-cli-extensions -s azure-rest-api-specs -a aaz |
| 29 | +``` |
| 30 | +> Above 4 parameters are the paths of the repositories, please feel free to modify them if you have other needs, e.g., your swagger source is `azure-rest-api-specs-pr`. |
| 31 | +
|
| 32 | +We can refer to the full document of codegen tool at https://azure.github.io/aaz-dev-tools/. However, the following will briefly introduce the 2 pages that we often interact with. |
| 33 | + |
| 34 | +### Workspace Editor |
| 35 | +[Workspace Editor](https://azure.github.io/aaz-dev-tools/pages/usage/workspace-editor/) is usually the start page to develop our command modules. We can open or create a workspace at: |
| 36 | + |
| 37 | + |
| 38 | +If everything is selected correctly, we will be redirected to the following UI. We can interactively edit our ideal command line interface based on that. |
| 39 | + |
| 40 | + |
| 41 | +### CLI Generator |
| 42 | +When we have completed all the editing in Workspace Editor and clicked EXPORT in its upper right corner. It's ready to switch to [CLI Generator](https://azure.github.io/aaz-dev-tools/pages/usage/cli-generator/) to generate code of Azure CLI. |
| 43 | + |
| 44 | +First, we need to select the target for generating code. If you don't know where to generate the code, usually Azure CLI Extension is all you need. |
| 45 | + |
| 46 | + |
| 47 | +Next, we can find the commands that we modified before in the following UI. Check the corresponding checkboxes, then click GENERATE in the upper right corner, and the code will be generated. |
| 48 | + |
| 49 | + |
| 50 | +> More advanced guides, such as [testing](https://azure.github.io/aaz-dev-tools/pages/usage/command-usage-testing/) and [customization](https://azure.github.io/aaz-dev-tools/pages/usage/customization/), are also explained in the full document. |
0 commit comments