gh-codespace

Manage GitHub Codespaces lifecycle and file transfers via gh codespace CLI.

3|1|Updated Apr 12, 2026
One-click install
npx skills add https://github.com/Cogni-AI-OU/cogni-ai-agent-skills --skill gh-codespace
Or copy as Structured Prompt for Agentā–¼
Please help me install this Agent Skill.
Skill: gh-codespace
Source: https://github.com/Cogni-AI-OU/cogni-ai-agent-skills/tree/main/gh-codespace
Command: npx skills add https://github.com/Cogni-AI-OU/cogni-ai-agent-skills --skill gh-codespace

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you connect to, create, and manage GitHub Codespaces using gh codespace while avoiding common automation failures like interactive hangs and connection attempts against stopped or rebuilding environments.

Core Features & Use Cases

  • Codespace lifecycle operations: Create, list, view details, edit, stop, delete, and rebuild codespaces for repeatable dev environments.
  • File transfer and debugging support: Use gh codespace cp and gh codespace logs to move artifacts and troubleshoot issues without manual SCP setup.
  • Port and access management: Forward ports for local testing and use the supported CLI path for interactive access when required (e.g., for user-driven sessions).

Quick Start

Use the gh-codespace skill to manage a codespace lifecycle and connect securely by running: "Use gh codespace to list existing codespaces and copy a file from a specific codespace to my local machine."

Frequently Asked Questions about gh-codespace

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I manage GitHub Codespaces from the terminal?ā–¼

You can manage GitHub Codespaces from the terminal by using the `gh codespace` command to securely connect to, create, edit, and delete development environments without leaving your local CLI.

How do I transfer files between a GitHub Codespace and my local machine?ā–¼

To transfer files between a GitHub Codespace and your local machine, use the `gh codespace cp` command, which allows you to move artifacts directly without setting up manual SCP configurations.

Why does my GitHub Codespace CLI connection hang during automation?ā–¼

Your GitHub Codespace CLI connection hangs during automation because interactive commands are being attempted in non-interactive sessions, or you are connecting to stopped environments; use status checks and avoid interactive flags.

Can I forward ports for local testing using GitHub Codespaces CLI?ā–¼

Yes, you can forward ports for local testing using GitHub Codespaces CLI, which manages port forwarding to route remote development environment traffic directly to your local machine.

What is the best way to troubleshoot a failing GitHub Codespace?ā–¼

The best way to troubleshoot a failing GitHub Codespace is to use the `gh codespace logs` command, which retrieves remote environment logs directly to your terminal for basic issue diagnosis.

Do I need to check codespace status before rebuilding via GitHub CLI?ā–¼

Yes, you need to check codespace status before rebuilding via GitHub CLI to prevent connection attempts against stopped or rebuilding environments, ensuring safe automation and avoiding lifecycle failures.