|
1 |
| -# AISH |
| 1 | +# Welcome to the AISH repository |
2 | 2 |
|
3 |
| -This is a repository of various **AI** + **Sh**ell prototypes we have created to test out experiences and |
4 |
| -features. **AISH** is the latest and most finished prototype. It is a CLI tool that creates |
5 |
| -an interactive chat session with a registered Large Language Model. Currently we are in a **Private Preview** state and everything is subject to change. |
| 3 | +**AISH** is our latest CLI tool that provides an interactive shell session to chat with large |
| 4 | +language models. Users can use _agents_ to interact with different AI models, or other assistance |
| 5 | +providers, in a conversational manner. **AISH** also provides a framework for creating AI agents. |
6 | 6 |
|
7 |
| - |
| 7 | +This project is currently in an **alpha** state. Expect many significant changes to the code as we |
| 8 | +experiment and refine the user experiences of this tool. We appreciate your feedback and patience as |
| 9 | +we continue our development. |
8 | 10 |
|
9 |
| -## Installing and Using AISH |
| 11 | +![GIF showing demo of AISH][04] |
| 12 | + |
| 13 | +## Installing AISH |
10 | 14 |
|
11 | 15 | Some prerequisites for building AISH
|
12 |
| -- Build script requires PowerShell v7.2 or newer versions. [PowerShell v7.4](https://learn.microsoft.com/powershell/scripting/install/installing-powershell?view=powershell-7.4) is recommended. |
13 |
| -- [.NET SDK 8](https://dotnet.microsoft.com/en-us/download) is required to build the project. |
| 16 | + |
| 17 | +- Build script requires PowerShell v7.2 or newer versions |
| 18 | +- [PowerShell v7.4][11] is recommended |
| 19 | +- [.NET SDK 8][09] is required to build the project |
14 | 20 |
|
15 | 21 | Here are the steps to install and use AISH.
|
16 |
| -1. Clone this repository, `git clone https://github.com/PowerShell/ShellCopilot`; |
17 |
| -2. Run `./build.ps1` in the repository's root directory to build the project; |
18 |
| -3. After the build is complete, you can find the produced executable `aish` in the `out\debug` folder within the repository's root directory. You can add it to the `PATH` environment variable for easy access. |
19 | 22 |
|
20 |
| -> Note: Depending on your OS directory paths may be `\` on Windows or `/` on Mac. |
| 23 | +1. Clone this repository, `git clone https://github.com/PowerShell/AISH` |
| 24 | +2. Run `./build.ps1` in the repository's root directory to build the project |
| 25 | +3. After the build is complete, you can find the produced executable `aish` in the `out\debug\app` |
| 26 | + folder within the repository's root directory. You can add the location to the `PATH` environment |
| 27 | + variable for easy access. The full path is copied to your clipboard after successful build. |
21 | 28 |
|
22 |
| -## Agent Concept |
| 29 | +## AI Agents |
23 | 30 |
|
24 |
| -AISH has a concept of different AI Agents, these can be thought of like modules that users can use to interact with different AI models. Right now there are three supported agents |
25 |
| -- `az-cli` |
26 |
| -- `az-ps` |
27 |
| -- `openai-gpt` |
| 31 | +AISH provides a framework for creating and registering multiple AI Agents. The agents are libraries |
| 32 | +that you use to interact with different AI models or assistance providers. Currently, there are four |
| 33 | +supported agents in this repository. |
28 | 34 |
|
29 |
| -If you run `aish` you will get prompted to choose between the two. |
| 35 | +Agent README files: |
30 | 36 |
|
31 |
| -### Az-CLI Agent |
| 37 | +- [`az-cli` & `az-ps`][06] |
| 38 | +- [`openai-gpt`][08] |
| 39 | +- [`interpreter`][07] |
32 | 40 |
|
33 |
| -This agent is for talking specifically to an Az CLI endpoint tailored to helping users with Azure CLI questions. |
| 41 | +When you run `aish`, you are prompted to choose an agent. For more details about each agent, see the |
| 42 | +README in the each agent folder. |
34 | 43 |
|
35 |
| -Prerequisites: |
36 |
| -- Have [Azure CLI installed](https://learn.microsoft.com/cli/azure/install-azure-cli) |
37 |
| -- Login with an Azure account within the Microsoft tenant with `az login` command |
| 44 | +## How to use AISH |
38 | 45 |
|
39 |
| -### Az-PS Agent |
| 46 | +To start a chat session with the LLM, run `aish`, which starts a new session in your current window. |
| 47 | +Choose the agent you would like to use. Once you select an agent you can begin your conversation. |
40 | 48 |
|
41 |
| -This agent is for talking specifically to an Az PowerShell endpoint tailored to helping users with Azure PowerShell questions. |
| 49 | +We suggest using a split pane approach with the terminal of choice. In Windows Terminal, use the |
| 50 | +following command to start `aish` in a new split pane: |
42 | 51 |
|
43 |
| -Prerequisites: |
44 |
| -- Have [Azure PowerShell installed](https://learn.microsoft.com/powershell/azure/install-azure-powershell) |
45 |
| -- Login with an Azure account within the Microsoft tenant with `Connect-AzAccount` command |
| 52 | +```shell |
| 53 | +wt -w 0 sp aish |
| 54 | +``` |
46 | 55 |
|
| 56 | +You can bind this command to a key like `F3` in your PowerShell session. Add the following code to |
| 57 | +your `$PROFILE` script: |
47 | 58 |
|
48 |
| -### OpenAI-GPT Agent |
| 59 | +```powershell |
| 60 | +$PSReadLineSplat = @{ |
| 61 | + Chord = 'F3' |
| 62 | + ScriptBlock = { |
| 63 | + wt -w 0 sp --tabColor '#345beb'--size 0.4 -p $env:WT_PROFILE_ID --title 'AISH' <full-path-to-aish.exe> |
| 64 | + } |
| 65 | +} |
| 66 | +Set-PSReadLineKeyHandler @PSReadLineSplat |
| 67 | +``` |
49 | 68 |
|
50 |
| -This is a more generalized agent that users can bring their own instance of Azure OpenAI (or the public OpenAI) and a completely customizable system prompt. |
51 |
| -Right now, it is defaulted to an internal Azure OpenAI endpoint with a prompt to be an assistant for PowerShell commands. This is for internal private preview purposes only. |
| 69 | +### `/` commands |
52 | 70 |
|
53 |
| -## Getting an Azure OpenAI Endpoint Key |
| 71 | +By default, `aish` provides a base set of chat `/` commands used to interact with the responses from |
| 72 | +the AI model. To get a list of commands, use the `/help` command in the chat session. |
54 | 73 |
|
55 |
| -All the configuration is already included by default and on the first run of this agent you will be prompted to include a API key to be able to use this endpoint. |
| 74 | +``` |
| 75 | + Name Description |
| 76 | +──────────────────────────────────────────────────────────── |
| 77 | + /agent Command for agent management. |
| 78 | + /cls Clear the screen. |
| 79 | + /code Command to interact with the code generated. |
| 80 | + /dislike Dislike the last response and send feedback. |
| 81 | + /exit Exit the interactive session. |
| 82 | + /help Show all available commands. |
| 83 | + /like Like the last response and send feedback. |
| 84 | + /refresh Refresh the chat session. |
| 85 | + /retry Regenerate a new response for the last query. |
| 86 | +``` |
56 | 87 |
|
57 |
| -Guide for Signing Up For API Key |
58 |
| -1. Navigate to <https://pscopilot.developer.azure-api.net> |
59 |
| -2. Click `Sign Up` located on the top right corner of the page. |
60 |
| -3. Sign up for a subscription by filling in the fields (email, password, first name, last name). |
61 |
| -4. Verify the account (An email should have been sent from |
62 |
| - <[email protected]> to your email) |
63 |
| -5. Click `Sign In` located on the top right corner of the page. |
64 |
| -6. Enter the email and password used when signing up. |
65 |
| -7. Click `Products` located on the top right corner of the page |
66 |
| -8. In the field stating `Your new product subscription name`, Enter `Azure OpenAI Service API`. |
67 |
| -9. Click `Subscribe` to be subscribed to the product. |
| 88 | +Also, agents can implement their own commands. Some commands, such as `/like` and `/dislike`, are |
| 89 | +commands that sends feedback to the agents. It is up to the agents to consume the feedback. |
68 | 90 |
|
69 |
| -In order to view your subscription/API key, |
70 |
| -1. Click `Profile` located on the top right corner of the page. |
71 |
| -2. Your Key should be located under the `Subscriptions` section. Click on `Show` to view the |
72 |
| - primary or secondary key. |
| 91 | +## Agent development |
73 | 92 |
|
74 |
| -Once you have a key you can always edit your endpoint configuration by running `/agent config openai-gpt` within AISH. This opens up a JSON file with all the configuration options. |
| 93 | +To learn more about how to create an agent for yourself please see, [Creating an Agent][03]. |
75 | 94 |
|
76 |
| -If you have separate Azure OpenAI endpoint you can use that instead of the one above. Read more at |
77 |
| -[Create and deploy an Azure OpenAI Service resource](https://learn.microsoft.com/azure/ai-services/openai/how-to/create-resource?pivots=ps). |
| 95 | +## Contributing to the project |
78 | 96 |
|
79 |
| -## Using AISH |
| 97 | +Please see [CONTRIBUTING.md][02] for more details. |
80 | 98 |
|
81 |
| -To start a chat session with the LLM, simply run `aish` and it will open up a new session in your current window. |
82 |
| -We suggest using a split pane approach with the terminal of choice. |
83 |
| -Windows Terminal offers an easy pane option by running: |
| 99 | +## Support |
84 | 100 |
|
85 |
| -```shell |
86 |
| -wt -w 0 sp aish |
87 |
| -``` |
| 101 | +For support, see our [Support][05] statement. |
88 | 102 |
|
89 |
| -If you use Windows Terminal and would like to tie this command to a key like `F3` in your PowerShell session, |
90 |
| -you can add the following code to your `$PROFILE`: |
| 103 | +## Code of Conduct |
91 | 104 |
|
92 |
| -```powershell |
93 |
| -Set-PSReadLineKeyHandler -Chord F3 -ScriptBlock { wt -w 0 sp --tabColor '#345beb'--size 0.4 -p "<your-default-WT-profile-guid>" --title 'AISH' <full-path-to-aish.exe> } |
94 |
| -``` |
| 105 | +The project follows the Microsoft Open Source Code of Conduct. For more information, see the |
| 106 | +[Code of Conduct FAQ][01]. |
95 | 107 |
|
96 | 108 | ## Feedback
|
97 | 109 |
|
98 |
| -We still in development and value any and all feedback! Please file an [issue in this repository](https://github.com/PowerShell/ShellCopilot/issues) for |
99 |
| -any bugs, suggestions and feedback. Any additional feedback can be sent to |
100 |
| - |
| 110 | +We're still in development and value your feedback! Please file [issues][10] in this repository for |
| 111 | +bugs, suggestions, or feedback. |
| 112 | + |
| 113 | +<!-- link references --> |
| 114 | +[01]: ./docs/CODE_OF_CONDUCT.md |
| 115 | +[02]: ./docs/CONTRIBUTING.md |
| 116 | +[03]: ./docs/development/CreatingAnAgent.md |
| 117 | +[04]: ./docs/media/ShellCopilotDemo.gif |
| 118 | +[05]: ./docs/SUPPORT.md |
| 119 | +[06]: ./shell/ShellCopilot.Azure.Agent/README.md |
| 120 | +[07]: ./shell/ShellCopilot.Interpreter.Agent/README.md |
| 121 | +[08]: ./shell/ShellCopilot.OpenAI.Agent/README.md |
| 122 | +[09]: https://dotnet.microsoft.com/en-us/download |
| 123 | +[10]: https://github.com/PowerShell/AISH/issues |
| 124 | +[11]: https://learn.microsoft.com/powershell/scripting/install/installing-powershell |
0 commit comments