Using Copilot to Run Your Project

Using Copilot to Run Your Project

In this step, you’ll learn how to let GitHub Copilot actively interact with your project by running commands inside VS Code. You’ll explore how Copilot can start servers, run tests, manage your database, and read logs — all through prompts you initiate. By the end, you’ll understand how Copilot behaves in the terminal, what it can and can’t reliably do, and how to start integrating it into your everyday development workflow.

Problem

Your task is to teach Copilot how to operate your codebase by running commands in the terminal and interpreting the output. Right now, Copilot can answer questions, but it won’t become a useful debugging partner until it can actually run your app, read logs, execute tests, and respond to what it sees. In this section, you’ll practice giving Copilot operational control so it can help you explore, debug, and maintain the project.

What You Need to Know

Copilot Can Run Terminal Commands

GitHub Copilot in VS Code can run terminal commands directly from your prompts. You can ask it to do things like:

  • check your Git status

  • run a script

  • install a dependency

  • or perform any CLI operation that exists on your machine

For example, you can say:

“Run git status and tell me what changed.”

Copilot will open a terminal, run the command, and then read the output back to you.

Allowed Commands & Auto-Approve Rules

By default, Copilot asks for approval before executing commands, a safety feature so the AI doesn’t run something unexpected.

However, VS Code lets you configure a list of pre-approved commands that Copilot can run without confirmation.

In Settings, search for:

Terminal: Auto Approve

You can whitelist individual commands or use regular expressions to allow whole categories of commands (e.g., git .*).

This creates a more seamless workflow where Copilot can carry out small, harmless operations without interrupting your flow.

How Copilot Interprets Terminal Output

Whenever Copilot runs a command, it attempts to read and interpret the output — logs, errors, test failures, status messages — and respond accordingly. For example:

  • run git diff

  • summarize the changes

  • propose a commit message

This “observe → interpret → act” loop is foundational for AI-assisted development.

Using VS Code Tasks for Reliable Multi-Process Orchestration

Why Tasks Matter

VS Code tasks give you a structured, IDE-native way to define commands that the editor will run in controlled, named terminals.
This solves several problems Copilot traditionally struggled with:

  • Multiple simultaneous terminals

  • Predictable terminal names and behavior

  • Long-running processes (dev server, test watcher, database listener)

  • Command chaining without the AI having to guess the right script

Tasks make terminal orchestration consistent, which makes Copilot much smarter.

Where Tasks Live

Tasks are defined in your project at .vscode/tasks.json

VS Code automatically reads this file and exposes each task as a runnable unit.

The Basic Structure of a Task

Here’s a minimal example:

{ "version": "2.0.0", "tasks": [ { "label": "Start Dev Server", "type": "shell", "command": "npm run dev", "problemMatcher": [] } ] }

This simple declaration tells VS Code:

  • what the task is called

  • what command to run

  • what type of process it is

  • how it should behave in the terminal

You can customize tasks with inputs, groups, background modes, dependencies, and more.

Copilot Can Generate Tasks for You

One of the pleasant surprises of working with Copilot:
it is extremely good at writing tasks.json files.

You can say:

“Create a VS Code task that starts the dev server and runs it in a dedicated terminal.”

Or:

“Generate tasks for all of the scripts in my package.json file.”

Copilot will draft the JSON, configure labels, and even set up task dependencies.

This makes tasks the easiest, most repeatable way to define your project’s operational workflow.

Copilot Can Run Tasks Directly

Once tasks are defined, Copilot can run them just like commands:

“Run the Start Dev Server task.”
“Stop all running tasks.”
“Run the Database Setup task and then run the Test suite task.”

Because tasks run in predictable terminals, Copilot can maintain multiple processes at once — which dramatically improves its debugging and orchestration capabilities.

Tasks vs. Regular Commands

Regular Terminal Commands

VS Code Tasks

Regular Terminal Commands

VS Code Tasks

Run in arbitrary terminals

Run in named, structured terminals

Copilot can only focus on one at a time

Copilot can coordinate across several

Harder to manage long-running processes

Tasks handle background & persistent modes

Commands are ephemeral

Tasks are reusable, documented units

No natural chaining

Built-in task dependencies

Tasks are simply the best way to give Copilot reliable, predictable operational control over your project.

How Copilot Instructions Enhance Tasks

Your .github/copilot-instructions.md file acts as Copilot’s playbook.
It can tell the AI:

  • which tasks exist

  • when they should be used

  • how they relate to each other

  • preferred workflows (e.g., “always run Task A before Task B”)

Examples of what you can include:

  • “Use the Start Dev Server task to boot the app.”

  • “Use the Reset Database task before running integration tests.”

  • “To debug authentication issues, run both the API server task and the frontend task.”

This gives Copilot a model of how the system works — which allows it to:

  • pick the right tasks automatically

  • chain them meaningfully

  • recover from errors

  • set up multi-terminal debugging scenarios

Together, tasks + instructions transform Copilot from a “command executor” into a reliable, predictable development orchestrator.

✏️ Hands-On Exploration

Use the prompts below to experiment with Copilot running commands in your project. Try variations, mix prompts together, and explore freely.

  1. Run the TaskFlow development server and familiarize yourself with the app

    1. npm run dev → Open http://localhost:3000 on your browser

      1. username: alice@example.com

      2. password: password123

  2. Ask Copilot what the available VS Code tasks are for your project.

    1. "What tasks can I run on this project?"

    2. Note: You can run VS Code tasks manually, use Ctrl/CMD+Shift+P, type "Tasks:", and select "Tasks: Run Task" to choose from available tasks.

  3. Work with Copilot to explore the app’s tasks, asking it to run them and describe the output

    1. "Start the development server and tell me what port it’s running on.”

      1.  

    2. “Run the unit tests and tell me what they're covering."

    3. "Reset the database."

    4. Try having Copilot chain commands together and see what happens

      1. Ex. “Run the development server, once it’s loaded, run the e2e tests."

  4. Run the linter and ask Copilot to fix the issues.

    1. "Run the linter and fix any issues that arise."

    2. This is our first exposure to debugging. Notice how Copilot handles this with just a simple command.

Next Steps

Now that you’ve explored how Copilot runs commands and interprets terminal output, you’re ready to move on to debugging real issues.

Continue to: https://bitovi.atlassian.net/wiki/spaces/AIEnabledDevelopment/pages/1761771533

In the next step, you’ll give Copilot failing tests, ask it to identify the problems, and watch it propose fixes one by one. Everything you practiced here — reading logs, running tests, executing commands — forms the foundation of that workflow.

Sources