GH-CODESPACE-PORTS-FORWARD(1) GitHub CLI manual GH-CODESPACE-PORTS-FORWARD(1)

# [NAME](#NAME)

gh-codespace-ports-forward - Forward ports

# [SYNOPSIS](#SYNOPSIS)

**gh codespace ports forward &lt;remote-port&gt;:&lt;local-port&gt;... \[flags]**

# [DESCRIPTION](#DESCRIPTION)

Forward ports from a codespace to your local machine.

Ports bind to loopback (**127.0.0.1**) by default. Use **--all-interfaces** to bind to all interfaces.

# [OPTIONS](#OPTIONS)

[**--all-interfaces**](#all_interfaces)

Listen on all network interfaces

# [OPTIONS INHERITED FROM PARENT COMMANDS](#OPTIONS_INHERITED_FROM_PARENT_COMMANDS)

[**-c**, **--codespace** **&lt;string&gt;**](#c)

Name of the codespace

[**-R**, **--repo** **&lt;string&gt;**](#R)

Filter codespace selection by repository name (user/repo)

[**--repo-owner** **&lt;string&gt;**](#repo_owner)

Filter codespace selection by repository owner (username or org)

# [EXIT CODES](#EXIT_CODES)

0: Successful execution

1: Error

2: Command canceled

4: Authentication required

NOTE: Specific commands may have additional exit codes. Refer to the command's help for more information.

# [SEE ALSO](#SEE_ALSO)

[**gh-codespace-ports(1)**](/man/os/gh/gh-codespace-ports.1)

Oct 2026

---

Document: gh-codespace-ports-forward(1) from gh 2.103.3-r0 (Chainguard OS)
Source: https://github.com/cli/cli
