Skip to content

Allow user to whitelist / allow for "npm test" or more complex commands #217

@yookoala

Description

@yookoala

Describe the feature or problem you'd like to solve

When CLI wants to run "npm test", I am only given the option to whitelist all "npm" command. But I want to only whitelist "npm test"

Proposed solution

The CLI would show a question with 3 options to user when running a new command.

Do you want to run this command?

  1. Yes (run the exact command once)
  2. Yes, and approve npm for the rest of the running session (allow CLI to run every npm commands in the future)
  3. No, and tell Copilot what to do differently (Esc)

There are many way to solve the problem:

A. Detect special tools and provide extra option

For some tools (e.g. npm, cargo, composer), they are the door to access a list of very diverse subcommands. If CLI detects that the requested command to be in this category, then it should provide another option:

  • Yes, and approve [application] [subcommand] for the rest of the running session

B. Allow user to declare command whitelist interactively

A more generic solution would be for CLI to have an extra option:

  • Yes, and let me determine what similar command pattern to approve for the rest of the running session.

Then, before running the command, work interactively with user to whitelist similar command to approve.

Example prompts or workflows

  • In a new repository, write a simple SPEC.md file that specifies
    • the multiple requirements to a fiction in a text file.
    • the script to test the fiction file with npm test: runs npx cspell
    • outline a workflow to produce every paragraphs:
      1. Write a paragraph.
      2. Commit to git.
      3. Run test on the fiction file.
      4. Fix the typo or incorrect spells.
      5. Commit to git.
      6. Wait for users next instruction.
  • In this repository, also write a simple TASK.md file that specifies multiple paragraphs to write as separated task.
  • Tell GitHub Copilot CLI to implement the fiction.

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