GH-CODESPACE-PORTS-FORWARD(1)
π GH-CODESPACE-PORTS-FORWARD(1) β the GitHub CLI manual, bestie edition π
okay so picture this: it's the gh manual page, it's GitHub CLI manual, and today's main character is the port-forwarding one. let's get into it β¨
πΈ NAME πΈ
gh-codespace-ports-forward β literally just forwarding ports, that's the whole vibe π«Ά
π¦ SYNOPSIS π¦
gh codespace ports forward <remote-port>:<local-port>... [flags]
notice the ... bestie, you can stack these. multiple port pairs, that's the assignment π
β¨ DESCRIPTION β¨
So what does it do? It forwards ports from a codespace to your local machine. That's it. That's the whole thing. Your codespace has a port, your laptop wants it, this command is the matchmaker π₯
Now here's the tea: ports bind to loopback (127.0.0.1) by default. So by default, only your own machine can reach them. if you want the whole network to see it, you use --all-interfaces to bind to all interfaces β and yes that's a vibe change, not just a detail π
π OPTIONS π
--all-interfacesβ listen on all network interfaces. the "let everyone in" option π«Ά (remember, the default is loopback-only127.0.0.1, so this is the delulu version)
π OPTIONS INHERITED FROM PARENT COMMANDS π
these are the family hand-me-downs, they come from the parent command and they're iconic fr fr:
-c,--codespace <string>β the name of the codespace. which one are we talking to, bestie π¦-R,--repo <string>β filter codespace selection by repository name, inuser/repoform--repo-owner <string>β filter codespace selection by repository owner (that's a username or an org, either one works π)
π EXIT CODES π
the vibe check at the end. here's what the numbers mean:
0β successful execution. slay, it worked β¨1β error. something went sideways π2β command canceled. you (or something) hit the brakes π4β authentication required. you gotta log in first, no cap π
NOTE: specific commands may have additional exit codes. Refer to the command's help for more information. (iykyk β check the help if a number shows up that isn't on this list π )
π SEE ALSO π
gh-codespace-ports(1)β the parent, go say hi π
and that's a wrap, bestie π§ this little masterpiece is from GitHub CLI v2.102.0, dated Oct 2026, and it's giving documentation energy in the best way possible. now go forward some ports, you absolute icon ππ
π¦ where this page comes from
- opensuse-leap 16.0: gh 2.102.0-bp160.1.1 Β· MIT
- opensuse-leap 16.0: gh 2.102.0-bp160.1.1 Β· MIT
- opensuse-leap 16.0: gh 2.102.0-bp160.1.1 Β· MIT
- opensuse-leap 16.0: gh 2.102.0-bp160.1.1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms