Microsoft Integrates ChatGPT AI into Windows Terminal for Windows 11
Artificial Intelligence is prevalent in today’s tech landscape. Microsoft has truly embraced this notion by integrating AI features across its suite of applications, aiming to enhance user productivity. Recently, I shared details about the newly introduced Copilot interface in Microsoft Word, and now it appears the “Windows Terminal” app has also implemented robust integrations with ChatGPT and GitHub Copilot. This functionality is now accessible for both Windows 10 and 11 users.
The initial hint regarding the integration of “AI Chat” within Windows Terminal was provided back in September, and it appears to have officially launched in a recent Windows Terminal (Canary) update on October 29. After testing it today, I found it operates seamlessly, allowing users to interactively chat within the Windows Terminal, which is especially helpful for eliciting commands when you’re stuck or troubleshooting issues.
Before diving into more examples and applications of AI through ChatGPT, let’s explore the operational framework of this integration. First off, it’s important to note that this service isn’t complimentary; it requires you to possess an API key. This key can be from GitHub Copilot, Azure’s OpenAI API, or OpenAI’s own API.
Once you link the Terminal Chat to an AI service, any question you pose in the Terminal Chat window will be transmitted to the AI, which will then process the request and provide quick suggestions. According to Microsoft, your chat history is not retained, and this integration is compatible with multiple shells, such as:
- Command Prompt
- PowerShell
- Ubuntu WSL
- Azure Cloud Shell
And more.
If you wish to set up AI features within Windows Terminal, you can follow these steps, which I implemented successfully on my device:
- Open the Settings in Windows Terminal.
- Select the Terminal Chat (Experimental) tab.
- Choose your preferred AI Service Provider: GitHub Copilot, Azure OpenAI, or OpenAI.
- Afterward, enter your API key.
- Once this is complete, Terminal Chat will let you engage with your chosen AI model directly from your terminal. Just open a standard tab and click on “Terminal Chat.”
Exploring AI Functionality in Windows Terminal
I chose to utilize the ChatGPT API directly from OpenAI since it simplifies the connection process without the need for an additional endpoint setup in Terminal. While linking to Azure’s API requires an endpoint configuration, using GitHub Copilot or directly accessing the API from OpenAI bypasses this requirement.
After inputting my ChatGPT API key in the Terminal, I launched a new tab and accessed “Terminal Chat.”This action opened a chat window featuring a chatbox, options to delete history, and an export button.
Its design mirrors the standard ChatGPT layout but is compactly formatted to fit within the Windows Terminal environment.
Windows Latest has observed that the Terminal AI demonstrates context awareness; it recognizes when you’ve opened AI in a specific shell like PowerShell, which is indicated in the upper left corner alongside the shell’s name and icon. For instance, if a new Command Prompt tab is opened, Terminal AI retains that information.
This context awareness significantly aids in prompt engineering, as Microsoft has tailored distinct prompts for different shells.
Throughout my experimentation with the Terminal AI, I posed a variety of inquiries starting with the fundamental ones. For instance, I asked, “How do I create a folder?” in PowerShell, and Terminal Chat correctly suggested using New-Item -ItemType Directory.
The AI even provided a copy function for the command, allowing me to paste it directly into the shell.
In a Linux setup like WSL, it suggested using mkdir. This showcases its context-aware abilities; I didn’t need to specify whether I was using PowerShell or WSL.
I also inquired the same question in an Azure Shell, and Terminal AI promptly recognized the switch from PowerShell to Azure.
This responsiveness demonstrates that it evaluates the context based on the shell selected earlier.
The usage of Terminal AI is versatile and there are no restrictions on how it can be employed, provided it’s related to terminal or shell functions.
As mentioned previously, asking how to execute certain actions like creating a folder yields the correct command adapted to your particular shell—be it PowerShell or Linux. The AI also provides translations of commands, marking, for example, that ‘ls’ in Linux translates to ‘Get-ChildItem’ in PowerShell.
If you encounter an error, you can input it into Terminal Chat, and it will explain the issue and suggest corrective measures.
Moreover, the feature is useful for retrieving quick code snippets relevant to text editors like nano or vim. For those utilizing PowerShell, it can clarify cmdlets such as Get-Process.
When you select a suggestion, the AI-generated command will be copied into the terminal, though it won’t execute automatically.
It’s important to note that Terminal AI will not retain any data after you end your session, but you do have the option to export the chat history to a. txt file. You can also clear the chat before exiting the Terminal shell.
Currently, it lacks a built-in UI feature to highlight interaction history, and it’s uncertain if this will change in the near future.
This new experimental AI feature is exclusive to Windows Terminal (Canary), and you can download it from Github. What are your thoughts on this innovation? Share your opinions in the comments below.
Leave a Reply