Getting Started with GitHub Copilot Workspace

Janvi Kumari Last Updated : 14 Jan, 2025
7 min read

Welcome to the technical preview for GitHub Copilot Workspace (CW)! GitHub CW is a “task-centric” development environment that enables you to define tasks for a repository using natural language and collaborate with AI to complete them. This guide will walk you through how to get started with Copilot Workspace by utilizing various entry points.

Entry Points for Starting a Task

Starting a task efficiently is crucial for maintaining productivity and streamlining workflows. CW offers multiple entry points to help you begin tasks with ease, whether it’s based on existing GitHub issues or creating new tasks from scratch. By leveraging these flexible options, you can quickly transition from identifying a task to actively working on it, ensuring a smooth and organized workflow tailored to your needs.

1. GitHub Issue

If you already have a GitHub issue that describes a task you want to perform, starting with it is straightforward. Follow these steps:

  • Open the GitHub issue.
  • On the right-side panel, under the “Development” section, click the “Open in Workspace” button.

This action will open the issue within Copilot Workspace and initiate the process of analyzing and solving it.

GitHub issue

2. Ad-hoc Task via CW Dashboard

You can also start a task directly from the CW dashboard:

  • Open the CW dashboard.
  • Click the “Choose a repository” option under the “Start a new session” section.
  • Search for the repository you want to work on.
  • Select the repository and define a new task from scratch, similar to drafting an issue.

Once you’ve performed a task for a repository, it will appear in the session list under the “Start a new session” section, making it easy to pick up new tasks for ongoing projects.

CW dashboard

3. Ad-hoc Task via Repository Page

Another way to initiate a task is directly from the repository page:

  • Navigate to the repository page of the project you want to work on.
  • Click the green “Code” button.
  • Enter a new task in the “Copilot” tab.
  • Submit the task.

This will take you into CW and begin the process of analyzing and solving the task.

Ad-hoc Task via Repository Page

Creating Repositories from Templates

Copilot Workspace allows you to create repositories from templates using natural language.

Using “Use this template” from GitHub.com

To create a repository with Copilot Workspace, navigate to a template repository on GitHub.com and choose “Use this template”:

  • Click “Use this template” to start creating your repository.
Use this template
  • The task is based on the software description you provide, along with the README of the template repository.

Once started, a create repository task looks like this:

  • The task is labelled as “Repository,” and the “Template” panel indicates the template repository.
create repository task

Copilot Workspace will generate a specification for the repository based on your description, a plan for creating it, and the final implementation.

Using “New session” on the Dashboard

You can also create a repository from a template by clicking the “New session” button in the Copilot Workspace dashboard and searching for a template. This will open a new task in the workspace where you can describe the software you want to create.

Using the URL

You can enable “Create Repository” mode for any repository URL by adding ?template=true as a query parameter. For example:

https://copilot-workspace.githubnext.com/githubnext/hello-world?template=true

Certain repositories are treated as templates by default:

  • Any GitHub template repository.
  • Any repository in an organization containing “templates” in its name.
  • Any repository with “-template,” “-scaffold,” “-starter,” or “-boilerplate” in its name.

GitHub Copilot Workspace for Repository Maintainers

Copilot Workspace can assist you as a repository maintainer in several ways:

  • You can explore potential solutions to issues.
  • You can generate sketches of solutions to issues for potential contributors, lowering the barrier of entry.
  • It can help encourage a culture where issue-creators leave additional helpful notes on how to solve issues, for use by both contributors and AI assistants.

For example, when a new issue is filed in your repository, you can use Copilot Workspace to generate a sketch of a solution to the issue. You can then use the “Share” button to publish this sketch back to the issue thread, with additional comments about whether you think it is useful or not, and where it might need improvement. This can help potential contributors understand the problem better and provide a starting point for their work.

Similarly, when a new issue is filed, you can ask the contributor to create a Copilot Workspace session for the issue. This may help the contributor understand the problem better and provide a starting point for their work. You can also include this guidance in the issue template for your repository, assuming your users have access to Copilot Workspace. You can also ask contributors to leave additional notes in the Copilot Workspace session, which can help future contributors and AI assistants understand the problem better.

Restricting the Use of GitHub Copilot Workspace in Your Repository

It is possible for undisciplined contributors to overuse AI-assisted code generation. Because of this, we give repository maintainers the option of disabling the direct use of Copilot Workspaces for creating pull requests and/or issue comments in their repositories.

To disable the direct creation of pull requests using Copilot Workspace, create a file .github/copilot-workspace/policy.json in the default branch of the repository containing the following content:

{
  "allowPullRequests": false
}

To disable the use of Copilot Workspace to directly generate issue comments that contain links to Copilot Workspace sessions, add the following content to the policy.json file:

{
  "allowComments": false
}

Users of Copilot Workspace will still be able to:

  • Create sharing links to Copilot Workspace sessions and paste them into issue comments.
  • Push to new branches in your repository (if they have write access).
  • Push to new branches in the forks of your repository.
  • Manually create pull requests from branches.
  • Use Copilot Workspace to generate code snippets and files for their own use in their own pull requests and issue comments to your repository.

Known Issues and Future Improvements

Please remember that GitHub Copilot Workspace is a technical preview and is an area of active development. This document lists some known issues and known areas where we’d like to make future improvements to the product.

The following are core areas where we are actively working to improve Copilot Workspace:

Rewriting Large Files

When it implements a plan that involves changes in a large file, it can take a long time to complete. Copilot Workspace currently uses “whole file rewriting” as we have found this achieves a high level of thoroughness on the very heterogeneous range of tasks Copilot Workspace can be used for. We are working on partial-file rewriting techniques, both automatic and under user guidance, to improve the performance of this operation.

Code Generation

The quality of the code generated by Copilot Workspace is not always perfect. It is highly related to the quality of the underlying AI models used. We are working on improving the quality of the code generated by Copilot Workspace on many levels. For example, the quality of code generation is affected by the quality of the planning and specification of the task and the overall user experience of assessing and clarifying these. We are working to improve these too. The achieved quality is also related to the experience of iterating on the generated code. We are actively looking at more fine-grained iteration techniques.

Content Selection

The content selection in Copilot Workspace can sometimes be suboptimal, leading to the generation of code that is not relevant to the task. We are working on improving the content selection in Copilot Workspace.

Web Retrieval

Tasks can include direct links to web resources such as documentation. Further, some web retrieval can also be deduced from the task. Copilot Workspace does not currently perform web retrieval and we are working on adding this feature.

Build/test Repair

After code is generated, both AI and traditional tooling can be used to “repair” the code based on diagnostics generated from building, testing, and running the code. We already have some support for this in Copilot Workspace, and we are working on improving this.

Tasks Small, Tasks Large

Some tasks are very small: updating a few lines of a file. Some tasks are very large: implementing an entirely new repository feature by feature. Copilot Workspace is currently designed for the mid-range of tasks typical of GitHub issues. We are interested in delivering variations on the core concepts of Copilot Workspace in arrangements more suitable to tasks both small and large. For example, for small tasks, we may offer a “lite” version of Copilot Workspace where there is only one task. For large tasks, we may offer a way to decompose the task into sub-tasks.

Authorization

It uses a GitHub OAuth App for authentication. Some organizations can have policies which restrict OAuth applications from interacting with their repositories. You will not be able to perform tasks in private repositories with Copilot Workspace or create pull requests in public repositories unless the organization admin approves the Copilot Workspace OAuth application. We are working to add a second authorization option for Copilot Workspace based on a GitHub App, and will update this document when this is available.

Conclusion

Getting started with Copilot Workspace is simple and flexible, with multiple entry points to suit your workflow. Whether starting from a GitHub issue, the CW dashboard, or a repository page, you can easily define tasks and collaborate with AI to enhance your development process. So, what are you waiting for? Explore it today!

Frequently Asked Questions

Q1. What is Copilot Workspace(CW)? 

Ans. CW is a task-centric development environment that allows users to define tasks for a repository using natural language and collaborate with AI to complete them efficiently.

Q2. How do I start a task in Copilot Workspace? 

Ans. You can start a task through various entry points:
A. From a GitHub issue by clicking “Open in Workspace.”
B. Directly via the CW dashboard by selecting a repository and defining a new task.
C. From a repository page by entering a task in the “Copilot” tab.

Q3. Can I create repositories from templates in Copilot Workspace? 

Ans. Yes, you can create repositories using templates by:
A. Selecting “Use this template” on GitHub.com.
B. Clicking “New session” on the CW dashboard and choosing a template.
C. Adding ?template=true to any repository URL.

Q4. How does Copilot Workspace assist repository maintainers? 

Ans. It helps maintainers by:
A. Exploring potential solutions to issues.
B. Generating solution sketches for contributors.
C. Encouraging detailed issue descriptions and notes.

Q5. Are there any known issues with Copilot Workspace?

Ans. Yes, some known issues include:
A. Slow rewriting of large files.
B. Occasional suboptimal content selection.
C. Ambiguity detection being overly sensitive.
D. No ‘Stop’ button when generating pull request descriptions

Hi, I am Janvi, a passionate data science enthusiast currently working at Analytics Vidhya. My journey into the world of data began with a deep curiosity about how we can extract meaningful insights from complex datasets.

Responses From Readers

Clear

We use cookies essential for this site to function well. Please click to help us improve its usefulness with additional cookies. Learn about our use of cookies in our Privacy Policy & Cookies Policy.

Show details