Skip to main content

Listing the codespaces in your organization

You can list all of the currently active or stopped codespaces for your organization.

Who can use this feature

To list all of the current codespaces for your organization, you must be an organization owner.

GitHub Codespaces is available for organizations using GitHub Team or GitHub Enterprise Cloud. GitHub Codespaces is also available as a limited beta release for individual users on GitHub Free and GitHub Pro plans. For more information, see "GitHub's products."

Overview

As an organization owner, you can list all of the currently active and stopped codespaces for your organization. You might want to do this to check how many codespaces users are creating, to make sure they aren't incurring unnecessary costs.

The easiest way to list the codespaces for an organization is by using GitHub CLI. You can also use the REST API, which provides more information about each codespace.

Using GitHub CLI to list codespaces

To list all of the current codespaces for a specified organization, use the following command.

Shell
gh codespace list --org ORGANIZATION 

This command returns a list that includes the following information for each codespace:

- The name and display name 
- The user who created the codespace
- The repository and branch
- The current state of the codespace

To list all of the current codespaces for an organization that were created by a specific user, use the following command.

Shell
gh codespace list --org ORGANIZATION --user USER

Note: In the above commands, replace ORGANIZATION with the name of the organization you are querying. You must be an owner of the organization.

Using the REST API to list codespaces

You can use the /orgs/{org}/codespaces API endpoint as an alternative method of listing the current codespaces for an organization. This returns more information than GitHub CLI; for example, the machine type details.

For more information about this endpoint, see "Codespaces organizations."