Skip to content

Code execution support in Shell Copilot #43

Open
@daxian-dbw

Description

@daxian-dbw

Summary of the new feature / enhancement

I think the shell should have utility functions for running

  • shell code (PowerShell and CMD on Windows, PowerShell and bash on Unix)
  • python code, if python is installed and available in PATH
  • node JS code, if node is installed and available in PATH

An individual plugin can decide how to integrate those code invocation functionality with its LLM backend (via function calling for example).

At the meantime, we can enhance the existing /code command with /code run sub command, to execute the code block from the last response.

We will prompt for user's approval to run code -- need to display the code block to be executed, and we may want to analyze the code block using an LLM and show the analysis result to user too when prompt for approval.

Alternatively, we could have a /code analyze sub command for user to explicitly ask LLM to analyze the code block. And /code run just runs the code after user confirms yes.

Proposed technical implementation details (optional)

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions