DEV Community

Sarah Lean 🏴󠁧󠁢
Sarah Lean 🏴󠁧󠁢

Posted on • Originally published at techielass.com

Install and use Microsoft AI Shell

Install and use Microsoft AI Shell

The command-line interface (CLI) remains a key tool for IT operations and development workflows, sometimes it’s friendly, other times it’s syntax-heavy and frustrating.

That’s where Microsoft’s new AI-powered shell tool can help - it’s called AI Shell.

What is AI Shell?

AI Shell is an interactive command-line experience that combines a chat interface with language models. It integrates directly into Windows Terminal and iTerm2 on macOS, offering an AI-assisted way to work with CLI tools.

AI Shell provides agents that connect to different AI models. In its initial release, AI Shell includes two: Azure OpenAI agent – connects to an instance of GPT-4o and handles general AI tasks. Copilot in Azure agent – assists specifically with Microsoft Azure questions and tasks.

The Azure OpenAI agent connects to an instance of gpt-4o and is the agent for general AI tasks. While the Copilot in Azure agent can assist with Microsoft Azure knowledge.

Launched in 2025, AI Shell is currently in version v1.0.0-preview.6. As with many preview tools, some features may be unfinished or prone to issues, and functionality is subject to change.

Install AI Shell

To use AI Shell, you'll need to install both the CLI tool (aish) and the AI Shell PowerShell module.

On Windows, run the following script:

Invoke-Expression "& { $(Invoke-RestMethod 'https://aka.ms/install-aishell.ps1') }"

Enter fullscreen mode Exit fullscreen mode

For macOS or Linux, refer to the official documentation for platform-specific installation instructions.

Install and use Microsoft AI Shell
Install the AI Shell

Get started with AI Shell

Once installed, you can start AI Shell by launching your terminal and running: Start-AIShell

Install and use Microsoft AI Shell
Starting the AI Shell

You’ll be prompted to select an AI agent. Let’s choose the Copilot in Azure agent for this example.

First of all make sure you are logged in to Azure via your shell, you can do this using the az login or Connect-AzAccount command, as Copilot in Azure will need to be able to login to your Azure environment to work correctly and answer your questions.

Once you are logged in, select the “Azure” agent from the list.

The agent should go through the log in process and you can start to interact with it.

You can now ask questions like:

"Create an Azure CLI command to deploy a resource group."

The agent will respond with the exact CLI command to run.

Install and use Microsoft AI Shell
Using the AI Shell

To use the Azure OpenAI agent, you’ll need to connect it to either: an Azure OpenAI resource you’ve deployed, or a valid OpenAI API account. Both are paid services.

To configure this connection, create a JSON file with the relevant keys and endpoint information. Full details are available in the official documentation.

Install and use Microsoft AI Shell
Buy me a coffee

Conclusion

The Microsoft AI Shell brings AI directly into your CLI, helping with common tasks and making using CLI more accessible. Whether you are managing Azure resources or exploring AI-powered command creation this preview tool is worth trying out, but keep in mind it is still evolving.

Top comments (0)