AI & Agents

How to Use the GitHub API with GitHub Copilot Chat

This guide explains how to use github api with github copilot chat to query repository issues, check pull request statuses, and search codebases using natural language. This details the syntax, slash commands, and policies required to integrate GitHub data directly into your active IDE editor context.

Fast.io Editorial Team 12 min read
Using chat interfaces to query project data directly in the workspace.

Accessing the GitHub API inside your development session

Developers spend a significant amount of time context switching between their IDE and browser tabs to check issue comments, review pull request requests, or track down repository context. The @github participant in Copilot Chat acts as a natural language interface to the GitHub API, bringing this data directly into the active editor context so developers can query the platform without leaving their keyboard.

The @github chat participant in Copilot Chat acts as a natural language interface to the GitHub API, letting developers search issues, query PR status, and fetch repository context directly from their IDE. Rather than writing custom scripts or switching to a web browser, a developer can ask questions about active issues, recent commits, or pull requests directly in the sidebar chat window. Under the hood, Copilot Chat uses the developer's authenticated OAuth credentials to query the GitHub REST and GraphQL APIs, translating natural language prompts into structured API requests.

Research indicates that keeping developers in their workspace yields positive results. In a study published on the GitHub Blog, 88% of developers reported maintaining flow state with GitHub Copilot Chat because they felt more focused, less frustrated, and enjoyed coding more, too. By querying repository metadata within the editor, developers can resolve questions about past discussions or review requests while their code remains open in the main panel.

When a developer types @github, the chat interface loads repository-aware skills. The AI model determines which API endpoints to query based on the developer's prompt. For example, if a developer asks for a list of open bugs, the participant calls the GitHub Search API, filters the results by issue state and labels, and formats the output into a readable markdown list inside the chat panel.

The authentication flow is handled automatically when you sign into your GitHub account through your code editor. The extension requests authorization scopes including repository read permissions, organization memberships, and issue tracking access. Once authorized, the IDE client sends requests securely, ensuring that Copilot Chat only retrieves information that your user profile has permission to see. This integration makes it simple to search across multiple repositories within your organization, lookup pull request reviews, or summarize discussion threads.

What slash commands and variables query GitHub data

Interacting with repository data through Copilot Chat requires specific syntax to scope the query. Although Copilot Chat can infer your context from natural language, using explicit commands and context variables provides more predictable results. The following list summarizes the syntax and slash commands available for the @github participant in Visual Studio Code:

  • @github followed by the query to access GitHub skills.
  • @github #web or @github Search the web to search the web for external information.
  • @github #file or @github #selection to include file or code context in your query.
  • Asking @github What skills are available? to get a list of active skills in your session.
  • Asking @github summarize issue # to get a summary of a specific GitHub issue.
  • Asking @github what is the status of my pull requests? to list your active pull requests.

These commands allow developers to query platform metadata without building custom API queries. For example, typing "@github /" in the chat panel triggers the dynamic command menu, displaying context-appropriate actions based on the active repository state.

Developers can combine the @github participant with general chat variables to cross-reference code files with platform issues. For instance, selecting a block of code and typing "@github explain this selection in the context of issue #102" instructs Copilot to fetch the issue details via the API and analyze the open code file against the reported bug description. This integration ensures that the AI's suggestions remain grounded in both the repository code and the tracked project metadata.

Another common scenario is checking pull request feedback. A developer can highlight a function that received a comment during review and ask: "@github compare my selection to the feedback in pull request #45." Copilot Chat will query the Pull Request Review Comments API, retrieve the specific review thread, and explain how to modify the code to address the reviewer's concerns. This workflow eliminates the need to open a browser tab to copy review comments, keeping the developer focused on coding.

Scoping repository search and admin policies

As of August 2026, organization administrators can enable or restrict external context search policies for Copilot Chat. These policies dictate whether the AI assistant can query external repositories, search the public web using the web search skill, or pull in context outside the immediate repository boundaries. For enterprise environments with strict security policies, managing these scopes ensures that proprietary context remains isolated.

Copilot Chat inherited permissions align directly with the developer's GitHub account. When a developer submits a query through @github, the client routes the request using the developer's active OAuth token. If the developer lacks permissions to access a private repository or organization resource, Copilot cannot query it. This setup prevents privilege escalation, ensuring that sensitive data is only returned to developers who already have authorization.

To prevent specific repository assets from being processed by Copilot, teams configure content exclusion. This is not a file you commit; there is no .copilotignore. Content exclusion is configured in repository, organization, or enterprise settings under Copilot, where an administrator enters the file path patterns Copilot should skip, one pattern per line. Once a path is excluded, Copilot filters those files out of the context it assembles, so credentials, vendor libraries, and client files are not parsed or sent to the model.

Administrators can set these policies globally at the organization or enterprise account level. In the policy dashboard, admins can turn off web search or disable the web skill to prevent Copilot from pulling in search engine results for queries. They can also configure repository indexing policies to control which private codebases are scanned and made available to Copilot Chat, ensuring compliance with internal security guidelines.

Connecting third party tools and persistent agent workspaces

When developer teams and autonomous agents coordinate on complex codebases, they frequently generate outputs that exist outside the raw Git history. These include technical documentation, database extractions, and client-ready share portals. While GitHub Copilot Chat provides excellent coding assistance, it lacks a persistent storage layer to manage these collaborative files.

Developers traditionally rely on limited storage alternatives:

  • Standard local filesystems, which are ephemeral and disappear once a CI run or developer container resets, isolating the files from the rest of the team.
  • Cloud object stores like Amazon S3, which require building custom API pipelines, lack collaborative document editing, and offer no natural language search capabilities.
  • Legacy cloud drives like Google Drive or Dropbox, which were built for human file sharing and frequently rate-limit automated agent scripts.

Fastio workspaces serve as a persistent, intelligent workspace designed specifically for human-agent coordination. Instead of managing separate storage containers and vector databases, teams can store, version, and share files in a single secure environment. When Intelligence Mode is enabled, Fastio automatically indexes all files for Hybrid Search, combining exact full-text matching with semantic meaning-based retrieval. Developers can search for exact document strings or locate files based on general concepts, receiving page-level citations from the RAG engine.

The platform provides a remote Model Context Protocol (MCP) server that exposes these workspaces programmatically. Developers can connect Copilot Chat directly to their workspaces by configuring the remote endpoint in their local configuration file, passing their API key via Bearer headers. The setup process is documented in the storage for agents page, allowing Copilot to read, write, and search cloud files directly from the IDE chat window.

For example, developers can configure their local .config/github-copilot/mcp-config.json or .mcp.json file as follows:

{
  "mcpServers": {
    "fastio-workspace": {
      "url": "https://mcp.fast.io/mcp/key",
      "headers": {
        "Authorization": "Bearer YOUR_FASTIO_API_KEY"
      }
    }
  }
}

The workspace also includes Metadata Views, which turn unstructured folders of PDFs, images, or notes into a queryable data grid. The AI extracts specified fields into typed schemas without manual data entry, allowing agents to query the structured results via the MCP server. When projects are complete, developer agents can transfer organization ownership to a human client using a claim link, keeping administrative permissions active for ongoing maintenance.

Creating an account is free; doing real work requires an organization on a paid subscription. Every organization starts with a 14-day free trial, which requires a credit card. Plans are Starter at $29 per month, Business at $99 per month, and Growth at $299 per month. The full details are available on the pricing page.

Fastio features

Connect Copilot Chat to a persistent cloud workspace

Configure Fastio remote MCP storage to query, search, and update team documents directly from your editor. Start your 14-day free trial today.

How to customize repository instructions in the IDE

To ensure that Copilot Chat suggestions match local coding styles and organizational patterns, developers can supply custom instructions. Placing a file named .github/copilot-instructions.md in the root directory of the repository allows teams to define specific guidelines that the AI model must follow. When a developer prompts Copilot, including queries that target the @github participant, the client automatically appends these instructions to the prompt context.

A standard .github/copilot-instructions.md file typically contains styling preferences, architectural rules, and package requirements:

### Repository instructions

### Code style
- Use TypeScript for all backend logic.
- Follow strict ESLint guidelines.

### Architecture
- Use repository patterns for database queries.
- Route file storage operations through the Fastio MCP server.

By defining these rules at the repository level, teams can maintain code consistency across multiple developers. Copilot reads these rules on startup and applies them to all code generation, explanation, and debugging sessions, making the AI's output align with the team's engineering practices.

These custom instructions are particularly valuable for shaping how Copilot Chat interacts with external services. For instance, developers can add guidelines instructing Copilot to generate SQL scripts that comply with specific table schemas or to use specific security headers when writing API routes. Because the file is checked into the repository, any developer who clones the project automatically gains access to the same customized AI configurations, aligning suggestions across the entire engineering team.

Frequently Asked Questions

How do I ask Copilot Chat questions about my repo?

To query your repository, type @github in the Copilot Chat window followed by your question. Copilot will use your active repository context and account permissions to retrieve relevant codebase metadata, issues, and pull requests.

What is the @github participant in Copilot Chat?

To access these skills in Copilot Chat, include @github in your question. The @github participant is a built-in assistant in Copilot Chat that serves as a natural language interface to the GitHub API, enabling developers to search repositories, query issue statuses, track pull requests, and perform web searches directly from their IDE.

Can Copilot Chat access my GitHub issues?

Yes, Copilot Chat can access GitHub issues when you mention the @github participant. You can ask it to search for open issues, summarize specific issue numbers, or reference active discussions while writing code in your editor.

Related Resources

Fastio features

Connect Copilot Chat to a persistent cloud workspace

Configure Fastio remote MCP storage to query, search, and update team documents directly from your editor. Start your 14-day free trial today.