-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Interactive] Integrate Recommendation capability into interactive
#5950
Changes from 150 commits
69ec809
c44ad4b
f4b3418
3ab962d
054f41a
1a95347
1c2bbab
3fe0217
1aa754e
8e255d5
985207d
952ff46
ad59383
fae609b
282a956
296f1e7
6985a2a
95b522a
59d8f95
3cd44a4
fe27250
9abcb4f
8cb5e9f
4857f4e
a5946ef
db8dec7
acac613
f39dff6
c755bd0
baf7a42
eb338d5
21ee2f0
cc440f1
97ed38e
a88d9f4
42b015c
a53cbec
603f3bc
4b43533
098ce28
5bfdc1b
24f8f86
466a02a
6ecf237
74f6bf7
794121f
7806242
a13f128
bd2b584
9648608
5c12cc0
a0719ab
379bde6
3ba7136
4e80631
a821ea9
327e5c4
b1767c3
ebc9030
55524ff
db1e640
2e89078
2604a2e
3fba464
2767657
2e4be77
5a67e63
c7feb0e
8bb883c
1c648b4
5817d18
9c7b5a2
46c742b
ffd4b6e
0ac9860
784c84b
5337408
eb3e52b
7ad2376
0169eb3
1c9221e
b3deb0f
5bc63d9
d5b4e54
9a69737
a0330ae
e4a8ef3
1b920ae
913c7d5
ba749b9
f92b355
70cdd9c
bd0efe8
06cfd09
9d6ab82
1ad7742
203168e
d3a4cf3
9c13df1
7605fa8
0f75e52
608bdd0
13e8ff7
8834dee
86dcec9
174edce
5264c2b
cf62a6d
5194737
5bd5380
9dc1d32
ef2dfbb
2d99b1b
99f9280
b225a28
e60a00f
889b165
5f62201
d9541cf
7696917
7accab6
92f3926
5e4c1e0
7d16473
65dbc33
7365e1b
5c165e0
4472932
704229e
aa5e2fb
788eac9
2119d41
5c717c5
09f8ba0
c43fcb7
9b9ba59
c72c6db
6bf0358
41a530f
50c1fc6
3d35f92
6d7cbc0
d7ee0b7
9f2e8c4
127f75b
ca0dc63
3f341e4
375c16b
b7dfb8c
09a6890
dbe7777
8699c85
5b0e5f7
ecb65ec
e595896
81c2f7e
bf0b238
615411e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,9 @@ | |
|
||
## The interactive mode for Microsoft Azure CLI (Command Line Interface) | ||
|
||
- Recommend Commands and Scenarios Based on Previous Commands | ||
- Search for Scenarios | ||
- Value Completion in Scenario Mode | ||
- Interactive Tutorials | ||
- Lightweight Drop Down Completions | ||
- Auto Cached Suggestions | ||
|
@@ -63,6 +66,12 @@ To undefault a value | |
$ %% .. | ||
``` | ||
|
||
To Search for a scenario | ||
|
||
```bash | ||
$ /[keywords] | ||
``` | ||
|
||
## Use Examples | ||
|
||
Type a command, for example: | ||
|
@@ -104,3 +113,94 @@ Only clears the appended suggestion when you restart the interactive shell | |
``` | ||
|
||
The color option will be saved. | ||
|
||
# Intelligent AZ Interactive (Revolutionary Change) | ||
## Recommendation | ||
|
||
We have integrated the cli recommendation to make the completion ability more intelligent and provide the scenario completion. This is a revolutionary change. Users can enable or disable the recommendation feature by running the following commands: | ||
|
||
``` | ||
$ az config set interactive.enable_recommender=True # Default, try the new recommendation feature | ||
$ az config set interactive.enable_recommender=False # Disable the recommendation feature | ||
``` | ||
Here is a demo video demonstrating the main features of the new az interactive: | ||
|
||
[![intelligent_az_interactive](docs/intelligent_az_interactive.png)](docs/intelligent_az_interactive.mp4 "intelligent_az_interactive") | ||
|
||
### Command Recommendation | ||
|
||
Command recommendation uses an intelligent algorithm to suggest the most relevant and frequently used command for the user based on their historical command inputs. By analyzing the user's input history and matching it with the highest relevant commands, Intelligent Az Interactive can assist Azure CLI beginners in making quick and informed decisions, saving them time and effort. | ||
|
||
The command recommendation feature can also be a good way to broaden users' knowledge boundaries and help them recognize and learn commands that are related to their common commands but never used before. | ||
|
||
When you don't know what to do next, you can enter Space, and it will recommend the next command which is most used in other similar sessions. | ||
wu5bocheng marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
<img align=center src="docs/command_recommendation.gif" width = "70%" alt="command_recommendation"> | ||
|
||
### Scenario Identification | ||
|
||
Scenario identification is another powerful feature that automatically recognizes the user's current scenario and recommends a set of commands that are most relevant to the user's needs. This feature is based on our extensive database of over 600+ business scenarios, which cover a wide range of use cases across various scenes. By analyzing the user's input history, Intelligent Az Interactive can identify the relevant scenario and suggest the most appropriate command set, helping new CLI users to quickly accomplish their tasks with confidence and ease. | ||
wu5bocheng marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
You can enter Space and select the scenario you want to use. It will automatically execute the commands in the scenario and help you complete the task. | ||
wu5bocheng marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
<img align=center src="docs/scenario_recommendation.gif" width = "70%" alt="scenario_recommendation"> | ||
|
||
## Search for Scenarios | ||
wu5bocheng marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
We have added the ability to help users search for scenarios based on keywords. When the user enters some keywords or descriptions, we will recommend the scenarios that are most likely to be used based on the keywords and descriptions of the functions the user wants to implement. | ||
|
||
You can use the natural language keywords with prefix "/" to search for the commands and usage scenarios you need, and smoothly create and execute corresponding CLI tasks. | ||
wu5bocheng marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
<img align=center src="docs/scenario_search.gif" width = "70%" alt="scenario_search"> | ||
|
||
``` | ||
$ az interactive // initialize the az interactive | ||
$ /connect a mongodb to web app // Search for scenario by starting with / and entering keywords | ||
>> output | ||
[1] Connect an app to MongoDB (Cosmos DB). (5 Commands) | ||
Connect an app to MongoDB (Cosmos DB). | ||
|
||
[2] Tutorial to create and connect Web App to Azure Database for MySQL Flexible Server in a virtual network (6 Commands) | ||
Tutorial to create and connect Web App to Azure Database for MySQL Flexible Server in a virtual network | ||
|
||
[3] Connect an app to SQL Database. (7 Commands) | ||
Connect an app to SQL Database. | ||
|
||
[4] Connect an app to a storage account. (5 Commands) | ||
Connect an app to a storage account. | ||
|
||
[5] Deploy an ASP.NET Core web app to Azure App Service and connect to an Azure SQL Database. (8 Commands) | ||
Deploy an ASP.NET Core web app to Azure App Service and connect to an Azure SQL Database. | ||
|
||
? Please select your option (if none, enter 0): | ||
$ 1 // Select the scenario you want to use | ||
``` | ||
wu5bocheng marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
## Loading Bar | ||
|
||
The loading bar is a feature that we have implemented to provide users with a more stable and predictable experience while using our platform. Its primary function is to prevent command parameter detection errors that may occur due to incomplete loading. By displaying the progress of initialization through the loading bar, users can be assured that the initialization process is ongoing and they can expect to see a fully loaded interface once the bar reaches 100%. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Our loading bar feature is automatically enabled, and users can turn it off by |
||
|
||
Additionally, the loading bar helps prevent user interface lagging or freezing due to insufficient memory. By preloading the necessary resources and data, users can avoid encountering these issues when inputting commands. The loading bar is an essential tool that improves the user experience by ensuring that all necessary components have been loaded before usage, thereby reducing the risk of encountering errors and providing a smoother, more stable platform. | ||
|
||
If you want to disable the loading bar, you can run the following command: | ||
```bash | ||
$ az config set enable_preloading=False | ||
``` | ||
Please refer to the following gif to see the loading bar in action: | ||
|
||
<img src="docs/loading_bar.gif" width = "70%" alt="loading_bar" align=center> | ||
|
||
|
||
## Value Completion in Scenarios | ||
|
||
We added a completion mechanism for parameter values in scenarios to improve the completion ability of param value in | ||
scenarios. In multiple commands of the same scenario, once the user enters a parameter value, we store the value entered by | ||
wu5bocheng marked this conversation as resolved.
Show resolved
Hide resolved
|
||
the user based on the scenario sample value and some special global parameters, and automatically recommend the completion | ||
of these parameter values in subsequent commands. | ||
|
||
## Telemetry Feedback Optimization | ||
|
||
To collect data and facilitate the optimization and tuning of the cli recommendation model, we have optimized the | ||
telemetry feedback function. We have added `CLIRecommendation` to the `properties` of telemetry feedback. For details, | ||
please refer | ||
to [cli-recommendation](https://github.com/hackathon-cli-recommendation/cli-recommendation/blob/master/Docs/feedback_design.md). | ||
wu5bocheng marked this conversation as resolved.
Show resolved
Hide resolved
|
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# -------------------------------------------------------------------------------------------- | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. See License.txt in the project root for license information. | ||
# -------------------------------------------------------------------------------------------- | ||
|
||
from azure.cli.core.azclierror import ClientRequestError | ||
|
||
|
||
# pylint: disable=unnecessary-pass | ||
class ScenarioSearchError(ClientRequestError): | ||
""" The client error raised by `Scenario Search`. """ | ||
pass | ||
Comment on lines
+10
to
+12
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am not sure whether it's necessary to save some error messages here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The purpose of defining the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it enabled by default?