Skip to content

Allow pass-through terminal commands #1235

@logar16

Description

@logar16

Describe the feature or problem you'd like to solve

Add a way to run terminal commands while in a copilot cli session. Something like /term ls to see the current directory's contents. Would make some things easier and faster than asking an AI to do it or opening another terminal.

Proposed solution

I have found there are times when I want to just run a quick command for myself and/or the agent and let it use the info in its context. Rather than tell the agent to run a specific command and tell me what the output is, I sometimes prefer to just run the command myself so I can see what comes out of it, but I'm fine if the agent sees the output too. I think this would be pretty easy for you to support and just makes life a little easier for power users who can think of what to do faster than they can think how to tell an AI how to do it.
I think you could add a slash command like /term or /exec or /run or something super clever. You can include the command run and the output as a comment from the user and use it as context for the agent

Example prompts or workflows

  1. Sometimes I want to just ls the cwd and see the files the agent is seeing. I might also notice we are in the wrong directory and I'd like to cd to the correct one.
  2. npm run dev doesn't seem to work when the AI runs it (maybe that's a bug but I assume you don't let it start ongoing processes and leave them hanging?) so I'd like to run it without having to open another terminal/tab.
  3. I have some aliases for multi-step actions I want to take and it would be nice to just do the action, get the result, and let the AI see. Then later I can tell it to add to custom instructions if I need it to do it often. But if I don't, I'd rather just be able to do it from the current terminal.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions