AI on the command line: Microsoft releases AI Shell

The public preview of AI Shell has been launched. The interactive tool can be connected to PowerShell 7 and provides assistance with errors.

listen Print view
One hand on a computer mouse, the other on a laptop keyboard

(Image: Proxima Studio/Shutterstock.com)

4 min. read
Contents

Microsoft has released AI Shell as a public preview version. The project equips the shell with AI capabilities, offers interaction options with AI agents from Azure OpenAI and Copilot in Azure and can be used either as a standalone application or with Microsoft's open-source shell PowerShell 7.

AI Shell consists of a command line shell interface, a framework for creating AI agents, a PowerShell module and two integrated AI agents:

The Azure OpenAI agent can use any AI model provided by Azure OpenAI and is suitable for a wide span of queries, natural language interpretations and code generation, according to Microsoft. The agent can be connected to deployed Azure OpenAI models if more data protection or management options for the model settings are required – or if a model trained with your own data is already available.

The AI-supported tool Copilot in Azure is available as a preview and specializes in providing cloud-centric assistance. The Copilot in Azure agent offers Azure CLI and Azure PowerShell commands and is designed to help automate Azure-specific tasks. Its use requires logging into Azure with Azure CLI with an account that has an IAM (Identity and Access Management) role to access Copilot in Azure. Please note that further configurations are required for this agent, which are specified when it is started.

Videos by heise

Developers can install AI Shell as a standalone program that runs independently of other shells. However, Microsoft recommends the second option for using AI Shell: as an AI Shell module that connects to a PowerShell 7 session using the aish tool. AI Shell then opens next to PowerShell 7 on the right in a subwindow, as can be seen here:

The AI shell module offers a connection to PowerShell 7: Output from the AI agent can be inserted directly into PowerShell.

(Image: Microsoft)

With this variant, the results of the AI chat can be transferred directly into the PowerShell session. This is intended to facilitate both simplified execution of inputs and support from the AI agent when resolving errors: If an error message occurs in the terminal, the cmdlet resolve-error can be used to send it to the AI shell window and request help from the AI model.

If errors occur, developers can ask the AI model for advice.

(Image: Microsoft)

Switching between the two available AI agents is possible using the command @<agent name>. For example, to switch to the Azure OpenAI agent, use @openai-gpt. Alternatively, developers can use @<agent name> <question> to query the desired AI agent directly.

AI Shell is available for Windows, macOS and Linux. An installation script is available for Windows and macOS, while Linux users must follow the manual installation instructions. There is also no support for the AI Shell module in Linux.

For Windows users, the requirements are Windows 10 or higher, PowerShell 7.4.6 or higher and Windows Terminal. On macOS, macOS 13 Ventura or higher, PowerShell 7.4.6 or higher and the iTerm2 Terminal app (limited support) must be installed. The requirements for Linux are Ubuntu 20.04 or higher, PowerShell 7.4 or higher (recommended) and any terminal emulator supported by the operating system.

All further information on the preview release can be found on Microsoft's developer blog.

(mai)

Don't miss any news – follow us on Facebook, LinkedIn or Mastodon.

This article was originally published in German. It was translated with technical assistance and editorially reviewed before publication.