gh-cs
Access GitHub Codespaces
TLDR
View documentation for the original command
SYNOPSIS
gh cs
PARAMETERS
create
Create a new Codespace.
list
List your Codespaces.
delete
Delete a Codespace.
ports
Forward ports from a Codespace to your local machine.
ssh
SSH into a Codespace.
code
Open a Codespace in Visual Studio Code.
name
Get the name of the Codespace.
logs
View Codespace logs.
stop
Stop a Codespace.
DESCRIPTION
The `gh cs` command provides an interface to interact with GitHub Codespaces from the command line. It allows you to create, list, stop, and forward ports for your Codespaces. It is a part of the GitHub CLI (`gh`) and aims to streamline Codespaces management without requiring you to use the GitHub website.
This tool allows developers to rapidly spin up development environments in the cloud, manage them effectively, and connect to them from their local machines. `gh cs` is a key component in enabling a modern, cloud-based development workflow tightly integrated with GitHub's ecosystem. The command is designed for simplicity and ease of use, making it accessible to developers of all skill levels who are already familiar with the command line.
CAVEATS
The `gh cs` command requires that the GitHub CLI (`gh`) is installed and authenticated with your GitHub account. Ensure you have the latest version of the GitHub CLI for optimal functionality.
AUTHENTICATION
Before using `gh cs`, you must authenticate with your GitHub account using `gh auth login`. This allows the GitHub CLI to access your Codespaces and perform actions on your behalf.
PORT FORWARDING
The `gh cs ports` command allows you to forward ports from your Codespace to your local machine. This is useful for testing applications running in the Codespace from your local browser or other tools. You can specify which ports to forward and the local port to map them to.
INTEGRATION WITH VS CODE
The `gh cs code` command opens your Codespace directly in Visual Studio Code. This requires that you have the VS Code Remote - Containers extension installed. This provides a seamless development experience with full IDE support within the Codespace.
HISTORY
The `gh cs` command was introduced as part of the GitHub CLI to provide a command-line interface for interacting with GitHub Codespaces. It reflects GitHub's push towards cloud-based development environments that are tightly integrated with their platform. Development and usage have increased as Codespaces adoption has grown and is actively maintained by GitHub.