1
0
mirror of synced 2025-12-19 18:10:59 -05:00
Files
docs/content/codespaces/managing-codespaces-for-your-organization/listing-the-codespaces-in-your-organization.md

2.5 KiB

title, shortTitle, intro, permissions, versions, type, topics, product
title shortTitle intro permissions versions type topics product
Listing the codespaces in your organization List organization codespaces You can list all of the currently active or stopped codespaces for your organization. To list all of the current codespaces for your organization, you must be an organization owner.
fpt ghec
* *
how_to
Codespaces
Administrator
{% data reusables.gated-features.codespaces-org %}

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. For information about pricing, see AUTOTITLE.

The easiest way to list the codespaces for an organization is by using {% data variables.product.prodname_cli %}. You can also use the REST API, which provides more information about each codespace.

For information on how to see the current total {% data variables.product.prodname_codespaces %} usage for your organization or enterprise, and generate a detailed report, see AUTOTITLE.

Using {% data variables.product.prodname_cli %} to list codespaces

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

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.

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 {% data variables.product.prodname_cli %}; for example, the machine type details.

For more information about this endpoint, see AUTOTITLE.