Microsoft, Google, Apple, Windows, Android, iOS, Internet, Cyber Security, Hacking, Malware, Smartphone, Mobile App

Trending

Hands on: Microsoft just added ChatGPT AI to Windows Terminal on Windows 11

AI is everywhere, really. Microsoft really meant it when it said it was bringing AI to all of its apps and services to make people more productive. I just reported about a new Copilot UI in Microsoft Word, and now there’s another app, “Windows Terminal,” getting full-fledged ChatGPT and Github Copilot integration. It’s now available on Windows 11 and Windows 10.

Microsoft first teased the “AI Chat” integration in Windows Termi nal in September, and it seems to have shipped in a new update for Windows Terminal (Canary) on October 29. I tried it out today, and it works as expected. You can literally chat within the Windows Terminal and ask for commands when you’re clueless or when you’re trying to fix bugs.

I’m going to share more examples and use cases of AI in ChatGPT, but let’s first take a look at how the integration works. First and foremost, it’s not free. You need to come up with your API key. It could be your Github Copilot API, Azure’s OpenAI API or OpenAI’s own API.

Welcome to Terminal Chat

Once you’ve connected terminal Chat to an AI service, when you type a question in the Termin al Chat window, it sends your request to the AI, which processes the query and offers a quick suggestion. Microsoft says it does not save your chat history, and the integration is designed to work with all shells, including:

  • Command Prompt.
  • PowerShell.
  • WSL Ubuntu
  • Azure Cloud Shell

And more.

To set up AI in Windows Termin al, you can follow the steps that I tried on my device:

  1. Open Settings in Windows Terminal.
  2. Select the Terminal Chat (Experimental) tab.
    How to access Terminal Chat
  3. Choose an AI Service Provider: Github Copilot, OpenAI by Azure and OpenAI.
  4. After selecting the AI provider, add the API key.
  5. Once done, Termin al Chat allows you to interact with your preferred AI model directly within your terminal. Just open a regular tab in Termin al and click “Terminal Chat.”

Hands on with AI inside Windows Terminal

I’m using ChatGPI API directly from OpenAI because it does not require me to set up the endpoint in Terminal. You’ll need to add an AI endpoint in Termin al when you’re using Azure API, but that’s not the case when you connect a Github Copilot subscription to Windows Termin al or directly obtain the API from OpenAI.

 

 

After adding my ChatGPT API key to Termin al, I opened a new tab and selected “Termi nal Chat.” This opens a new Terminal Chat window with a chatbox, delete history button, and export button.

 

It’s similar to the default ChatGPT interface, but the interface is compact to meet the needs of the Windows Terminal environment.

Windows Latest noticed that the Terminal AI is context-aware, which means it is aware if you’ve opened it inside a PowerShell terminal. This is reflected in the top left corner with the name and icon of the primary shell inside the Termin al. For example, if you open a new tab of Command Prompt, Terminal AI will remember it.

I believe this helps with prompt engineering because Microsoft has configured different system prompts for each shell.

In my tests, I played with Termin al AI for a number questions. I started with most basic ones. For example, I asked Terminal AI “How do I create a folder?” in PowerShell. Terminal Chat replied back with a suggestion to use New-Item -ItemType Directory, which is correct.

It also offered a copy button to copy the command so I could directly paste it into the Shell.

In a Linux environment like WSL, it suggested mkdir. Why? Because it’s context aware. I don’t need to tell AI that I’m using PowerShell or WSL.

 

I also tried asking the same question in an Azure shell. Terminal AI instantly noticed that I’ve switched the shell from PowerShell to Azure.

It understands what I’m doing based on the context (either the selected Shell in the previous step).

There are no limitations on how you can use Ter minal AI. It works as long as it’s related to Terminal or shell.

As I shared in the above screenshot, you can ask it how to perform actions like creating a folder, and it will suggest the correct command for your shell, whether it’s PowerShell or Linux. It also translates commands between systems, like showing that ls in Linux is Get-ChildItem in PowerShell.

 

If you run into an error, you can paste it into Termina l Chat, and it will explain what went wrong and how to fix it.

It’s also great for getting quick code snippets for text editors like nano or vim. For PowerShell users, it can explain cmdlets like Get-Process.

Windows Terminal AI with ChatGPT

While clicking the suggestion, the AI suggested code will be copied to the terminal, but it won’t run automatically.

Termin al AI will not save anything after you close the session, but there’s an option to export the conversation to a .txt file. You can also clear the chat manually before closing the Terminal shell.

It doesn’t yet have a built-in UI to highlight the history, and I don’t think it’ll be coming anytime soon.

Leave A Reply

Your email address will not be published.

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More

Privacy & Cookies Policy