Microsoft announces public preview of AI Shell for PowerShell



 Microsoft Dev Blogs:

We’re thrilled to unveil the public preview of AI Shell! AI Shell enhances your shell with AI capabilities to facilitate your interactions with the command line. AI Shell create an interactive shell that can interact with various large language model and provides a framework that you can use to build a custom system that meet your needs. Users can interact with the AI agents in a conversational manner.

The AI Shell project includes:
  • The command-line shell (aish) interface
  • A framework for creating AI agents and other assistance providers
  • A PowerShell module for deeper integration with PowerShell.
  • Built in AI agents to get you started assistance immediately
Each AI assistant is known as an agent. The initial release of AI Shell includes two agents:
  1. Azure OpenAI Agent: Powering general-purpose assistance, the Azure OpenAI agent can use any of the AI models provided by Azure open AI to handle broad queries, natural language interpretations or code generation. You can connect it to your deployed Azure OpenAI models if you are looking for more privacy, management of the model settings, or have a model trained with your data. Additionally, you can also utilize OpenAI’s models.
  2. Copilot in Azure: This agent brings the power of Copilot in Azure directly to your CLI. It specializes in delivering cloud-centric assistance, providing Azure CLI and Azure PowerShell commands and helping you automate your Azure-specific tasks.To get started with the Copilot in Azure agent you need sign in to Azure with Azure CLI with an account that has the IAM role for accessing Copilot in Azure.

The Azure OpenAI agent needs additional configuration to connect to your Azure OpenAI instance. To get started, follow the instructions provided when you start start the agent.


Recognizing that you may have different CLI command needs, AI Shell provides a framework for creating your own agents. For more information, see Creating an Agent.

Using and Installing AI Shell​

We know every CLI user has their own preferences, so AI Shell offers two flexible modes to fit your workflow:

Standalone Executable

You can use AI Shell as a self-contained executable, allowing it to run independently from any shell. This setup is perfect if you’re looking for a dedicated, streamlined experience that’s easily accessible without dependencies.

standalone.gif


Side-by-Side Integration with PowerShell 7​

This is the recommended method for using AI Shell because it enables an uninterrupted work flow. The AIShell module connects the aish tool to your PowerShell 7 session for deeply integrated user experience. AI Shell opens in a side pane right next to your PowerShell 7 session that enables a rich communication between panes, results from the chat can be carried seamlessly to your PowerShell session for easy execution and the AI agent can be used to provide assistance to resolve a PowerShell error.

side-by-side-1.gif


Installation and Getting Started​

Some system requirements are needed to run AI Shell.

AI Shell (aish) and the AIShell module are separate downloads. For your convenience, we created a script to download and install them for you.

Windows​

Some prerequisites are needed to run AI Shell on Windows.
  • Windows 10 or higher
  • PowerShell 7.4.6 or higher
  • Windows Terminal
The following install script will:
  • Installs aish.exe to $env:LOCALAPPDATA\Programs\AIShell and adds it to your PATH
  • Installs the AIShell module to your module path location

MacOS​

Some prerequisites are needed to run AI Shell on MacOS.
  • macOS v13 Ventura or higher
  • PowerShell 7.4.6 or higher
  • iTerm2 terminal app
On MacOS, this script:
  • Installs the aish executable to /usr/local/AIShell and creates a symbolic link at /usr/local/bin/aish
  • Due to some limitations, the AIShell module is not installed

This script only works on Windows and Mac systems. Linux users need to follow the manual installation instructions.


To install AI Shell, run the following command in your PowerShell session:

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

To find details on manual installation please see, Installing AI Shell manually.

After running the install script, you can run Start-AIShell to begin using AI Shell.

startup-scaled.gif


AI Shell starts in the side by side experience. You can switch between the agents by using the @<agent name> command. For example, to switch to the Azure OpenAI agent you would use the @openai-gpt command. Additionally you can do @<agent name> <question> to send a question to the agent immediately.

SwitchAgents-scaled.gif


Inserting code into the PowerShell 7 session​

Copying and pasting a lot of code can be annoying. AI Shell makes it easy to insert the AI generated code directly into your PowerShell 7 session with the /code post command. In your AI Shell, run /code post or use the Ctrl+d,Ctrl+d keyboard shortcut to copy the code into your PowerShell session.

SwitchAgents-scaled.gif


If you are familiar with PowerShell 7 you may be familiar with Predictive Intellisense. When you get multi-step commands in your AI Shell response, you can easily get each subsequent step in your Predictive Intellisense buffer.

predictiveintellisensedemo-scaled.gif


Resolving errors quicker​

If you encounter an error in your working terminal, you can use the Resolve-Error cmdlet to send that error to the open AI Shell window for resolution. This command asks the AI model to help you resolve the error.

Resolve-error.gif


Invoking AIShell from PowerShell 7​

One key scenario we wanted to support is being able to pipe output of one command into the AI Shell to get more information or ask a follow up question on the data given. With the Invoke-AIShell command you can easily do this.

Invoke-AIShell-scaled.gif


Invoke-AIShell can take input from the pipeline but also can just be used to call the AI agent selected in AI Shell without having to switch back and forth.

Some additional tips using AI Shell​

There are other chat commands and hot-keys that make using AI Shell easier. For a full list of the chat commands, see the AI Shell reference.

Key bindingsCommandFunctionality
Ctrl+d, Ctrl+c/code copyCopy all the generated code snippets to clipboard
Ctrl+<n>/code copy <n>Copy the n-th generated code snippet to clipboard
Ctrl+d, Ctrl+d/code postPost all the generated code snippets to the connected application
Ctrl+d,<n>/code post <n>Post the n-th generated code snippet to the connected application

Additionally, you can switch between the panes easier using the following keyboard shortcuts.

Key bindingsFunctionality
Alt+RightArrowMoves your cursor to the right AI Shell pane
Alt+LeftArrowMoves your cursor to the left PowerShell pane

Why Try AI Shell?​

AI Shell was built for those who seek intelligence and adaptability from their command-line. With multi-agent support, AI Shell aims to be the assistant for any CLI tool. You’ll benefit from advanced AI capabilities, deeper integration with your PowerShell session, and an extensibility model to get the assistance you need.

Call to Action!​

This public preview is just the beginning. We’d love to hear your feedback and insights as we refine AI Shell to better serve the CLI and PowerShell community. Download it today, explore the capabilities of the Copilot in Azure and Azure OpenAI agents, and take command-line productivity to the next level! Feel free to give us feedback on the current tool and sign up for early access to future features at aka.ms/AIShell-Feedback.

Thank you so much!

Steven Bucher
Product Manager on the PowerShell/CLI Team


 Source:


github standalone executable download:
 
Last edited:
Yet another "improvement" we don't really need.
I wish they'd just debug Windows instead.



I have to admit, that full descriptions for Powershell gobbledygook, would be nice.
But they don't really need AI to do that.

Services and even BIOSes have had detailed descriptions since the XP days. No AI involved.
 
Last edited:

My Computers

System One System Two

  • OS
    Win 11 Home ♦♦♦26100.3037 ♦♦♦♦♦♦♦24H2 ♦♦♦non-Insider
    Computer type
    PC/Desktop
    Manufacturer/Model
    Built by Ghot® [May 2020]
    CPU
    AMD Ryzen 7 3700X
    Motherboard
    Asus Pro WS X570-ACE (BIOS 4702)
    Memory
    G.Skill (F4-3200C14D-16GTZKW)
    Graphics Card(s)
    EVGA RTX 2070 (08G-P4-2171-KR)
    Sound Card
    Realtek ALC1220P / ALC S1220A
    Monitor(s) Displays
    Dell U3011 30"
    Screen Resolution
    2560 x 1600
    Hard Drives
    2x Samsung 860 EVO 500GB,
    WD 4TB Black FZBX - SATA III,
    WD 8TB Black FZBX - SATA III,
    DRW-24B1ST CD/DVD Burner
    PSU
    PC Power & Cooling 750W Quad EPS12V
    Case
    Cooler Master ATCS 840 Tower
    Cooling
    CM Hyper 212 EVO (push/pull)
    Keyboard
    Ducky DK9008 Shine II Blue LED
    Mouse
    Logitech Optical M-100
    Internet Speed
    300/300
    Browser
    Firefox (latest)
    Antivirus
    Bitdefender Internet Security
    Other Info
    Speakers: Klipsch Pro Media 2.1
  • Operating System
    Windows XP Pro 32bit w/SP3
    Computer type
    PC/Desktop
    Manufacturer/Model
    Built by Ghot® (not in use)
    CPU
    AMD Athlon 64 X2 5000+ (OC'd @ 3.2Ghz)
    Motherboard
    ASUS M2N32-SLI Deluxe Wireless Edition
    Memory
    TWIN2X2048-6400C4DHX (2 x 1GB, DDR2 800)
    Graphics card(s)
    EVGA 256-P2-N758-TR GeForce 8600GT SSC
    Sound Card
    Onboard
    Monitor(s) Displays
    ViewSonic G90FB Black 19" Professional (CRT)
    Screen Resolution
    up to 2048 x 1536
    Hard Drives
    WD 36GB 10,000rpm Raptor SATA
    Seagate 80GB 7200rpm SATA
    Lite-On LTR-52246S CD/RW
    Lite-On LH-18A1P CD/DVD Burner
    PSU
    PC Power & Cooling Silencer 750 Quad EPS12V
    Case
    Generic Beige case, 80mm fans
    Cooling
    ZALMAN 9500A 92mm CPU Cooler
    Mouse
    Logitech Optical M-BT96a
    Keyboard
    Logitech Classic Keybooard 200
    Internet Speed
    300/300
    Browser
    Firefox 3.x ??
    Antivirus
    Symantec (Norton)
    Other Info
    Still assembled, still runs. Haven't turned it on for 13 years?
@Ghot 9:33am

Fully agree.

The MS development trend appears to be delving into areas that most have no use for. This just creates useless bloat and is less interesting than watching paint dry. The hyperbole around AI is still mostly just wind.

And yes - debug, please. For example, copying large files (>3Gb, say) to an external disc exposes poor RAM management, and has done for quite some years now. MS is aware of this and has dealt with it by smugly stating that the issue is not one that troubles most home users. Gggrrrr ...
 

My Computer

System One

  • OS
    Windows 11
    Computer type
    Laptop
    Manufacturer/Model
    HP 15s_du1xxx
    CPU
    Intel i5 10210U
    Motherboard
    85F1
    Memory
    16Gb
    Graphics Card(s)
    Intel UHD
    Sound Card
    Realtek
    Screen Resolution
    1920 x 1080

Latest Support Threads

Back
Top Bottom