Ubiquex

codespace.Codespace

github_codespace

`github_codespace` is a cloud-hosted development environment running in a real Docker container, reachable from a browser, VS Code, or the GitHub CLI with no local setup at all. Organizations customize the container itself via configuration files, so every codespace for a project starts from the same real, consistent environment.

Example

import { intent, resource, stack } from "@ubx/sdk";
import { Codespace } from "@ubx/sdk-github/codespace";

export default stack("example", () => {
  intent({ summary: "example own codespace" });

  resource(Codespace, "example", {
    codespaceName: "example-codespace-name",
  });
});

Input properties

codespace_namestringrequired
path parameter, not part of the API's own resource representation

Output properties

billable_ownerobject
A GitHub user.
22 properties
avatar_urlstringrequired
The URL of the avatar image for the billable owner (user or organization) associated with this codespace. Required.
emailstring
The email address of the billable owner for the Codespace. This field may be empty if the owner has not associated a public email. Optional.
events_urlstringrequired
The URL to the events for the billable owner of the codespace. Required.
followers_urlstringrequired
The API URL to retrieve the list of followers of the billable owner. Required.
following_urlstringrequired
The API URL for the list of users that this billable owner follows on GitHub. Required.
gists_urlstringrequired
The API URL to the gists of the billable owner, typically a GitHub user or organization. Required.
gravatar_idstringrequired
The user's Gravatar ID, a hash used to construct their Gravatar avatar URL. Required.
html_urlstringrequired
The HTML URL of the billable owner's GitHub profile page (e.g., https://github.com/username). Required.
idnumberrequired
No description available.
loginstringrequired
The GitHub username or organization name of the entity that is billed for the codespace. Required.
namestring
The name of the user or organization that is the billable owner for the codespace. Optional.
node_idstringrequired
The GitHub node ID of the billable owner for the codespace. Required.
organizations_urlstringrequired
The API URL to list the organizations that the billable owner belongs to. Required.
received_events_urlstringrequired
The URL to retrieve the events received by the billable owner. Required.
repos_urlstringrequired
The URL to the list of repositories owned by this billable owner. Required.
site_adminboolrequired
Whether the billable owner is a GitHub site administrator. Required.
starred_atstring
No description available.
starred_urlstringrequired
The URL template for the starred repositories of the billable owner. This URL can be used to list the repositories that the owner has starred. Required.
subscriptions_urlstringrequired
The URL to the subscriptions of the billable owner associated with the codespace. Required.
typestringrequired
No description available.
urlstringrequired
The API resource URL for the billable owner of the codespace, typically the GitHub user or organization that will be billed. Required.
user_view_typestring
No description available.
created_atstring
The timestamp indicating when the codespace was created. Computed by GitHub after `ship`.
devcontainer_pathstring
Path to devcontainer.json from repo root used to create Codespace.
display_namestring
Display name for this codespace.
environment_idstring
UUID identifying this codespace's environment.
git_statusobject
Details about the codespace's git repository.
5 properties
aheadnumber
The number of commits the local repository is ahead of the remote.
behindnumber
The number of commits the local repository is behind the remote.
has_uncommitted_changesbool
Whether the local repository has uncommitted changes.
has_unpushed_changesbool
Whether the local repository has unpushed changes.
refstring
The current branch (or SHA if in detached HEAD state) of the local repository.
idnumber
The real, numeric, globally unique identifier for this object.
idle_timeout_minutesnumber
The number of minutes of inactivity after which this codespace will be automatically stopped.
idle_timeout_noticestring
Text to show user when codespace idle timeout minutes has been overriden by an organization policy
last_known_stop_noticestring
The text to display to a user when a codespace has been stopped for a potentially actionable reason.
last_used_atstring
Last known time this codespace was started.
locationstring
The initally assigned location of a new codespace.
machineobject
A description of the machine powering a codespace.
7 properties
cpusnumberrequired
How many cores are available to the codespace.
display_namestringrequired
The display name of the machine includes cores, memory, and storage.
memory_in_bytesnumberrequired
How much memory is available to the codespace.
namestringrequired
The name of the machine.
operating_systemstringrequired
The operating system of the machine.
prebuild_availabilitystringrequired
Whether a prebuild is currently available when creating a codespace for this machine and repository. If a branch was not specified as a ref, the default branch will be assumed. Value will be "null" if prebuilds are not supported or prebuild availability could not be determined. Value will be "none" if no prebuild is available. Latest values "ready" and "in_progress" indicate the prebuild availability status.
storage_in_bytesnumberrequired
How much storage is available to the codespace.
machines_urlstring
API URL to access available alternate machine types for this codespace.
namestring
Automatically generated name of this codespace.
ownerobject
A GitHub user.
22 properties
avatar_urlstringrequired
The URL of the avatar image for the owner (a user or organization) of the codespace. Required.
emailstring
The email address of the owner of the codespace. Optional.
events_urlstringrequired
The URL to the owner's public events. Required.
followers_urlstringrequired
The URL to retrieve the followers list for this owner. Required.
following_urlstringrequired
The URL template for the GitHub API endpoint that lists the users this owner is following. Required.
gists_urlstringrequired
The URL to the owner's gists list on GitHub. This is a required field, always present. Required.
gravatar_idstringrequired
The Gravatar hash for the owner's avatar image, used to construct the avatar URL. Required.
html_urlstringrequired
The URL to the GitHub profile or organization page of the owner. Required.
idnumberrequired
No description available.
loginstringrequired
The GitHub username or organization name that owns the codespace. Required.
namestring
The display name of the user or organization that owns the codespace. Optional.
node_idstringrequired
The GraphQL global node ID for the owner of the codespace. Required.
organizations_urlstringrequired
The URL to the list of organizations associated with the owner, typically an API endpoint like https://api.github.com/users/{username}/orgs. Required.
received_events_urlstringrequired
The URL to retrieve the events received by this owner on GitHub. Required.
repos_urlstringrequired
The URL endpoint for listing the repositories owned by this user or organization. Required.
site_adminboolrequired
Indicates whether the user is a site administrator for GitHub. Required.
starred_atstring
No description available.
starred_urlstringrequired
The URL template to list the GitHub user's starred repositories, typically formatted as https://api.github.com/users/{user}/starred{/owner}{/repo}. Required.
subscriptions_urlstringrequired
The API URL to the subscriptions for this owner (user or organization). Required.
typestringrequired
The type of the owner account, either 'User' or 'Organization'. Required.
urlstringrequired
No description available.
user_view_typestring
Specifies the visibility of the user's account profile, indicating whether it is publicly viewable or private. Typical values are 'public' and 'private'. Optional.
pending_operationbool
Whether or not a codespace has a pending async operation. This would mean that the codespace is temporarily unavailable. The only thing that you can do with a codespace in this state is delete it.
pending_operation_disabled_reasonstring
Text to show user when codespace is disabled by a pending operation
prebuildbool
Whether the codespace was created from a prebuild.
publish_urlstring
API URL to publish this codespace to a new repository.
pulls_urlstring
API URL for the Pull Request associated with this codespace, if any.
recent_folderslist(string)
List of recently opened folders in the Codespace, showing the paths of folders the user has accessed recently. Computed by GitHub after `ship`.
repositoryobject
Minimal Repository
90 properties
allow_forkingbool
Boolean indicating whether forking is allowed for this repository. Optional.
archive_urlstringrequired
The URL to download the repository's source code archive (e.g., as a zip or tar file). Required.
archivedbool
A boolean indicating whether the repository is archived. Archived repositories are read-only and cannot be modified. Optional.
assignees_urlstringrequired
The URL to access the list of assignees for this repository. Required.
blobs_urlstringrequired
The URL template for accessing blob objects in the repository's Git database, with a placeholder for the blob SHA. Required.
branches_urlstringrequired
The URL to the API endpoint for listing branches in this repository. Required.
clone_urlstring
The HTTPS URL used to clone the repository. Optional.
code_of_conductobject
Code Of Conduct
5 properties
bodystring
The full body text of the code of conduct. Optional.
html_urlstringrequired
The URL to view the code of conduct in a web browser. Required.
keystringrequired
The unique identifier for the code of conduct applied to the repository. For example, 'contributor_covenant' or 'citizen_code_of_conduct'. Required.
namestringrequired
The name of the code of conduct. Required.
urlstringrequired
The URL to the code of conduct document for the repository. Required.
collaborators_urlstringrequired
The URL endpoint for accessing the list of collaborators for this repository. Required.
comments_urlstringrequired
The URL to the GitHub API endpoint for comments associated with the repository. Required.
commits_urlstringrequired
The URL template for accessing the repository's commit history via the GitHub API. It may include a placeholder such as {/sha} to fetch individual commits. Required.
compare_urlstringrequired
The API URL template for comparing commits or branches in the repository. Required.
contents_urlstringrequired
The URL template for accessing the contents of the repository, with a placeholder for the path (e.g., https://api.github.com/repos/{owner}/{repo}/contents/{+path}). Required.
contributors_urlstringrequired
The API URL that provides a list of contributors to the repository. Required.
created_atstring
The creation timestamp of the associated repository, represented as a string. Optional.
custom_propertiesdynamic
The custom properties that were defined for the repository. The keys are the custom property names, and the values are the corresponding custom property values.
default_branchstring
The default branch of the repository associated with the GitHub Codespace. Optional.
delete_branch_on_mergebool
Indicates whether the repository automatically deletes branches after their pull requests are merged. Optional.
deployments_urlstringrequired
The API endpoint URL for accessing the deployments of this repository. Required.
descriptionstringrequired
The description of the repository that the codespace is associated with. This is the short description set on the repository's GitHub page. Required.
disabledbool
Whether the repository is disabled. A disabled repository is unavailable for access or use. Optional.
downloads_urlstringrequired
The URL of the repository's downloads API endpoint, where you can list and retrieve repository download files. Required.
events_urlstringrequired
The URL to the repository's events. For example: https://api.github.com/repos/{owner}/{repo}/events. Required.
forkboolrequired
Whether the repository is a fork. Required.
forksnumber
The number of forks of the repository. Optional.
forks_countnumber
The number of forks of the repository associated with the codespace. Optional.
forks_urlstringrequired
The API URL to retrieve the list of forks for this repository. Required.
full_namestringrequired
The full name of the repository, including the owner, in the format `owner/repo`. Required.
git_commits_urlstringrequired
The URL to the repository's git commits, pointing to the commit list for the GitHub repository associated with this codespace. Required.
git_refs_urlstringrequired
The URL template to access git refs for the repository. Required.
git_tags_urlstringrequired
The URL to the Git tags of the repository associated with the codespace. Required.
git_urlstring
The git URL for the repository, used to clone it over the git protocol (e.g., git://github.com/owner/repo.git). Optional.
has_discussionsbool
Indicates whether the GitHub repository has Discussions enabled. Optional.
has_downloadsbool
Indicates whether the repository has the GitHub Downloads feature enabled. Optional.
has_issuesbool
Indicates whether the repository has the GitHub Issues feature enabled. Optional.
has_pagesbool
Indicates whether the repository has GitHub Pages enabled. Optional.
has_projectsbool
Whether the repository has the Projects feature enabled. Optional.
has_pull_requestsbool
No description available.
has_wikibool
Indicates whether the repository has a wiki enabled. Optional.
homepagestring
The URL of the repository's homepage, if one has been set. Optional.
hooks_urlstringrequired
The API endpoint URL for managing webhooks in the repository. Required.
html_urlstringrequired
The URL of the repository on GitHub, e.g., https://github.com/owner/repo. Required.
idnumberrequired
The unique numeric identifier of the repository associated with the codespace. Required.
is_templatebool
Indicates whether the repository is a template repository. Template repositories allow users to generate new repositories with the same directory structure and files. Optional.
issue_comment_urlstringrequired
The URL template for issue comments in the repository, following GitHub's API format. It can be used to construct endpoints for listing, creating, or updating comments on issues. Required.
issue_events_urlstringrequired
The API endpoint URL for issue events in this repository, following GitHub's hypermedia URL template format. Required.
issues_urlstringrequired
The URL to access the issues list for the repository. Required.
keys_urlstringrequired
The URL to access the repository's deploy keys, used by the GitHub API to manage key information. Required.
labels_urlstringrequired
The URL of the GitHub API endpoint for managing labels for this repository. Required.
languagestring
The primary programming language of the repository, as defined by GitHub's API. Optional.
languages_urlstringrequired
The URL to the GitHub API endpoint that lists the programming languages used in the repository. Required.
licenseobject
No description available.
5 properties
keystring
The SPDX identifier for the repository's license, such as 'mit' or 'apache-2.0'. Optional.
namestring
The human-readable name of the license associated with the repository. Optional.
node_idstring
The GraphQL node ID of the license. Optional.
spdx_idstring
The SPDX license identifier (e.g., 'MIT', 'Apache-2.0') for the repository's license, if defined. Optional.
urlstring
The URL associated with the repository's license. Optional.
merges_urlstringrequired
The API URL for the merges endpoint of the repository, which can be used to check merge status or perform merges. Required.
milestones_urlstringrequired
The API endpoint URL for accessing the milestones of this repository. Required.
mirror_urlstring
The URL of the mirror repository, if this repository is a mirror. This property is only present for mirrored repositories. Optional.
namestringrequired
The name of the repository, without the owner/organization prefix. Required.
network_countnumber
No description available.
node_idstringrequired
The unique identifier for the repository, used in GraphQL operations. Required.
notifications_urlstringrequired
The URL to access notifications for this repository, as provided by the GitHub API. Required.
open_issuesnumber
The number of open issues in the repository. Optional.
open_issues_countnumber
The number of open issues in the repository. Optional.
ownerobjectrequired
A GitHub user.
22 properties
avatar_urlstringrequired
The URL of the avatar image for the repository owner. This is required and always present. Required.
emailstring
The email address associated with the owner (user or organization) of the repository. Optional.
events_urlstringrequired
The URL to the events associated with the repository owner (user or organization), following the GitHub API format, e.g., https://api.github.com/users/{username}/events{/privacy}. Required.
followers_urlstringrequired
The API endpoint URL to retrieve a list of users who follow this repository owner. Required.
following_urlstringrequired
The URL to the GitHub API endpoint that lists the users this repository owner is following. Required.
gists_urlstringrequired
The URL template to access the owner's gists, with a placeholder for the gist ID (e.g., https://api.github.com/users/{owner}/gists{/gist_id}). Required.
gravatar_idstringrequired
The Gravatar ID for the owner of the repository associated with this Codespace. Required.
html_urlstringrequired
The GitHub HTML URL for the repository owner's profile (user or organization). Required.
idnumberrequired
The numeric ID of the repository owner (either a user or an organization). Required.
loginstringrequired
The username of the GitHub account that owns the repository. Required.
namestring
The display name of the GitHub user or organization that owns the repository. Optional.
node_idstringrequired
The GraphQL global node identifier for the repository owner. Required.
organizations_urlstringrequired
The URL to fetch the list of organizations that this repository owner belongs to. Required.
received_events_urlstringrequired
The URL to retrieve the events received by this owner (user or organization). Required.
repos_urlstringrequired
The URL to the list of repositories owned by this user or organization. This is part of the owner object for the repository associated with the Codespace. Required.
site_adminboolrequired
Indicates whether the owner account is a site administrator of GitHub. Required.
starred_atstring
No description available.
starred_urlstringrequired
The API endpoint template for listing repositories starred by this owner, with optional placeholders for the owner and repo path parameters. Required.
subscriptions_urlstringrequired
The subscriptions URL for the owner, used to access subscription details. Required.
typestringrequired
The type of the repository owner, either 'User' for a user account or 'Organization' for an organization account. Required.
urlstringrequired
The GitHub API URL for the repository owner (e.g., https://api.github.com/users/{owner}). Required.
user_view_typestring
No description available.
permissionsobject
No description available.
5 properties
adminbool
Indicates whether the user has admin permission on the repository associated with this codespace. Optional.
maintainbool
Whether the workspace has maintain-level permission on the repository. When true, the user can manage repository settings without full admin access. Optional.
pullbool
Indicates whether the user has permission to pull (read) from the repository. Optional.
pushbool
Whether the user has push access to the repository. Optional.
triagebool
Indicates whether the user has triage permission on this repository, which grants read access and the ability to manage issues and pull requests without write access. Optional.
privateboolrequired
Specifies whether the GitHub repository is private. Set to true for a private repository, false for a public one. Required.
pull_request_creation_policystring
The policy controlling who can create pull requests: all or collaborators_only.
pulls_urlstringrequired
The URL used to access pull requests for the repository. Required.
pushed_atstring
The date and time of the last push to the repository. Optional.
releases_urlstringrequired
The URL template for the repository's releases, with placeholders for additional parameters (e.g., release ID). Required.
role_namestring
No description available.
security_and_analysisobject
Security and analysis settings for the repository, including features like vulnerability alerts, dependency graph, secret scanning, and advanced security. Optional.
11 properties
advanced_securityobject
Enable or disable GitHub Advanced Security for the repository. For standalone Code Scanning or Secret Protection products, this parameter cannot be used.
1 property
statusstring
Whether GitHub Advanced Security is enabled for the repository. Possible values are `enabled` or `disabled`. Optional.
code_securityobject
The code security settings for the repository, as part of its security and analysis configuration. Optional.
1 property
statusstring
Indicates whether code security is enabled or disabled for the repository. Optional.
dependabot_security_updatesobject
Enable or disable Dependabot security updates for the repository.
1 property
statusstring
The enablement status of Dependabot security updates for the repository.
secret_scanningobject
Configuration for GitHub secret scanning, which detects secrets such as tokens and keys committed to the repository. Optional.
1 property
statusstring
The status of secret scanning for the repository. Possible values are 'enabled' and 'disabled'. Optional.
secret_scanning_ai_detectionobject
An object representing the status of the AI detection feature for secret scanning in the repository. It contains a 'status' field that can be set to 'enabled' or 'disabled'. Optional.
1 property
statusstring
Indicates whether secret scanning AI detection is enabled or disabled for the repository. Allowed values are 'enabled' and 'disabled'. Optional.
secret_scanning_delegated_alert_dismissalobject
An object that configures which repository roles or teams are permitted to dismiss secret scanning alerts. This is part of the repository's security and analysis settings. Optional.
1 property
statusstring
The status of delegated alert dismissal for secret scanning, with allowed values 'enabled' or 'disabled'. Optional.
secret_scanning_delegated_bypassobject
Configuration for secret scanning delegated bypass, which allows specific actors to bypass push protection when a secret is detected. Optional.
1 property
statusstring
Whether secret scanning delegated bypass is enabled or disabled. Possible values are `enabled` or `disabled`. Optional.
secret_scanning_delegated_bypass_optionsobject
Options for configuring delegated bypass of secret scanning, defining which users or teams are allowed to bypass secret scanning alerts. Optional.
1 property
reviewerslist(object)
The bypass reviewers for secret scanning delegated bypass
3 properties
modestring
The mode of the reviewer for the secret scanning delegated bypass. `ALWAYS` means the reviewer is always required to approve a bypass request, while `EXEMPT` means the reviewer is exempt from the approval requirement. Optional; if omitted, computed by GitHub.
reviewer_idnumber
The numeric ID of a user or team with permission to approve delegated secret scanning bypasses. Optional; if omitted, computed by GitHub.
reviewer_typestring
The type of reviewer for the secret scanning delegated bypass option. Allowed values are TEAM (a team) or ROLE (a role). Optional; if omitted, computed by GitHub.
secret_scanning_non_provider_patternsobject
Object defining custom secret scanning patterns that are not tied to a specific provider. These patterns allow repositories to detect additional secrets beyond those covered by GitHub's built-in provider patterns. Optional.
1 property
statusstring
Whether secret scanning for non-provider patterns is enabled or disabled for the repository. Allowed values: 'enabled' or 'disabled'. Optional.
secret_scanning_push_protectionobject
Configuration for secret scanning push protection on the repository. This feature helps prevent secrets from being pushed by blocking the push if a secret is detected. Optional.
1 property
statusstring
The status of secret scanning push protection for the repository. Valid values are 'enabled' or 'disabled'. Optional.
secret_scanning_validity_checksobject
No description available.
1 property
statusstring
No description available.
sizenumber
The size of the repository, in kilobytes. Size is calculated hourly. When a repository is initially created, the size is 0.
ssh_urlstring
The SSH URL for cloning the repository. Optional.
stargazers_countnumber
The number of users who have starred the repository. Optional.
stargazers_urlstringrequired
The API endpoint URL for the list of stargazers of the repository. Required.
statuses_urlstringrequired
The URL template to query commit statuses for the repository, typically containing a placeholder (e.g., `{sha}`) for the commit SHA. Required.
subscribers_countnumber
Number of users subscribed to the repository. Optional.
subscribers_urlstringrequired
The API endpoint URL for listing the subscribers (watchers) of the repository. Required.
subscription_urlstringrequired
The URL to subscribe to the repository for notifications, as provided by the GitHub API. Required.
svn_urlstring
The URL to access the repository via Subversion (SVN). Optional.
tags_urlstringrequired
The API endpoint URL for listing tags of the repository associated with the codespace. Required.
teams_urlstringrequired
The API endpoint URL for the teams associated with the repository. Required.
temp_clone_tokenstring
A temporary token used for cloning the repository. Optional.
topicslist(string)
The list of topics associated with the repository. Optional.
trees_urlstringrequired
URL template for accessing the repository's Git trees API endpoint, typically including placeholders for owner, repo, and tree SHA. Required.
updated_atstring
The timestamp of when the repository was last updated, formatted as an ISO 8601 string (e.g., 2024-01-01T12:34:56Z). Optional.
urlstringrequired
The GitHub API URL of the repository. Required.
visibilitystring
No description available.
watchersnumber
Number of users watching (subscribing to) the repository. Optional.
watchers_countnumber
The number of users who have starred (watched) this repository, equivalent to stargazers_count. Optional.
web_commit_signoff_requiredbool
Indicates whether commits made via the GitHub web interface are required to include a sign-off (i.e., the repository's web commit signoff setting is enabled). Optional.
retention_expires_atstring
When a codespace will be auto-deleted based on the "retention_period_minutes" and "last_used_at"
retention_period_minutesnumber
Duration in minutes after codespace has gone idle in which it will be deleted. Must be integer minutes between 0 and 43200 (30 days).
runtime_constraintsobject
Constraints applied to the codespace's runtime environment, such as allowed port privacy settings. Computed by GitHub after `ship`.
1 property
allowed_port_privacy_settingslist(string)
The privacy settings a user can select from when forwarding a port.
start_urlstring
API URL to start this codespace.
statestring
State of this codespace.
stop_urlstring
API URL to stop this codespace.
updated_atstring
The timestamp of the last update to the codespace, in ISO 8601 format. Computed by GitHub after `ship`.
urlstring
API URL for this codespace.
web_urlstring
URL to access this codespace on the web.