Linux command
gh-cs 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Create a codespace for a repository
gh cs create -R [owner/repo]
List codespaces
gh cs list
Connect to codespace via SSH
gh cs ssh -c [codespace-name]
Open codespace in VS Code
gh cs code
Stop a running codespace
gh cs stop -c [codespace-name]
Delete a codespace
gh cs delete -c [codespace-name]
Copy files from codespace to local machine
gh cs cp remote:[/path/to/file] [local/path]
说明
gh cs is the shorthand alias for gh codespace, managing GitHub Codespaces from the command line. Codespaces are cloud-hosted development environments that provide a full VS Code experience with configurable compute resources. The command enables creating, connecting, and managing codespaces without visiting github.com. It supports SSH connections for terminal access, integration with local VS Code installations, and file copying between local and remote environments.
参数
- create
- Create a new codespace.
- list
- List available codespaces.
- ssh
- SSH into a codespace.
- code
- Open codespace in Visual Studio Code.
- stop
- Stop a running codespace.
- delete
- Delete codespaces.
- ports
- List and manage port forwarding.
- cp
- Copy files between local and remote file systems.
- logs
- Access codespace logs.
- rebuild
- Rebuild a codespace.
- view
- View details about a codespace.
- jupyter
- Open a codespace in JupyterLab.
- edit
- Edit a codespace.
- -c _CODESPACE_, --codespace _CODESPACE_
- Target codespace name. If omitted, a list is displayed for selection.
- -R _REPO_, --repo _REPO_
- Repository for new codespace.
- --help
- Display help information.
FAQ
What is the gh-cs command used for?
gh cs is the shorthand alias for gh codespace, managing GitHub Codespaces from the command line. Codespaces are cloud-hosted development environments that provide a full VS Code experience with configurable compute resources. The command enables creating, connecting, and managing codespaces without visiting github.com. It supports SSH connections for terminal access, integration with local VS Code installations, and file copying between local and remote environments.
How do I run a basic gh-cs example?
Run `gh cs create -R [owner/repo]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does create do in gh-cs?
Create a new codespace.