Skip to content

Conversation

Copy link

Copilot AI commented Jun 13, 2025

This PR implements support for --agent and -a command line parameters to allow users to specify which AI agent to use without interactive prompting.

Changes Made

Command Line Interface

  • Added --agent and -a options to the main aish executable
  • Both long and short forms accept the agent name as a parameter

Agent Selection Priority

Updated the agent selection logic to use the following priority order:

  1. Command line parameter (new, highest priority)
  2. Shell wrapper agent configuration
  3. Default agent from settings file
  4. Interactive user selection (fallback)

Implementation Details

  • Extended ShellArgs class to include the agent parameter
  • Modified Shell class to store and use the command-line provided agent
  • Enhanced error messages to specify the source of agent configuration
  • Updated README documentation with usage examples

Usage Examples

# Specify agent for a single query
aish --agent openai-gpt "How do I list files in PowerShell?"

# Use short form alias
aish -a azure "Create a storage account"

# Works with non-interactive mode
echo "context data" | aish --agent ollama "Analyze this data"

Configuration Hierarchy

The agent selection now follows this priority:

  1. aish --agent <name> (command line)
  2. Shell wrapper configuration
  3. ~/.aish/config.json default agent
  4. Interactive prompt (if multiple agents available)

Backward Compatibility

All existing functionality remains unchanged. Users who don't specify the --agent parameter will continue to see the interactive agent selection prompt as before.

Fixes #354.

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • 1p7vsblobprodcus324.vsblob.vsassets.io
    • Triggering command: dotnet build shell/shell.sln (dns block)
  • 1s1vsblobprodcus386.vsblob.vsassets.io
    • Triggering command: dotnet build shell/shell.sln (dns block)
  • fdpvsblobprodcus345.vsblob.vsassets.io
    • Triggering command: dotnet build shell/shell.sln (dns block)
  • h6tvsblobprodcus346.vsblob.vsassets.io
    • Triggering command: dotnet build shell/shell.sln (dns block)
  • m16vsblobprodcus374.vsblob.vsassets.io
    • Triggering command: dotnet build shell/shell.sln (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 3 commits June 13, 2025 18:31
Co-authored-by: StevenBucher98 <20605456+StevenBucher98@users.noreply.github.com>
Co-authored-by: StevenBucher98 <20605456+StevenBucher98@users.noreply.github.com>
Co-authored-by: StevenBucher98 <20605456+StevenBucher98@users.noreply.github.com>
Copilot AI changed the title [WIP] Support --agent parameter for the aish executable Add support for --agent parameter to allow non-interactive agent selection Jun 13, 2025
Copilot AI requested a review from StevenBucher98 June 13, 2025 18:39
@daxian-dbw daxian-dbw closed this Jan 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support --agent parameter for the aish executable

3 participants