Quality of life plugin.
I like vibe coding and yolo mode, this is to make using local devcontainers easier and more seamless for "safer" yolo.
I get GitHub Copilot through work, so getting "automatic" sign in to me is important. I have been learning neovim (and am use to vscode), so auto port forwarding.
This is a simple function wrapper around devpod which checks for devpod and github cli.
- devpod - Development container management
- github cli - GitHub authentication and token generation
- gum - Interactive workspace selection
- jq - JSON processing for port monitoring
ssh/scp- Remote connection and file transferstdbuf- Unbuffered output handling for port monitoring
Clone this repository into your Oh My Zsh custom plugins directory:
git clone https://github.com/scaryrawr/devpod-gh.zsh ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/devpod-ghThen add devpod-gh to your plugins array in ~/.zshrc:
plugins=(... devpod-gh)antidote install scaryrawr/devpod-gh.zsh
Configure SSH ControlMaster in your ~/.ssh/config for optimal port forwarding performance:
Host *
ControlMaster auto
ControlPath ~/.ssh/cm-%C
ControlPersist 10mThis enables connection multiplexing, which allows multiple SSH connections to share a single network connection. This significantly speeds up establishing new port forwards by avoiding repeated SSH handshakes and authentication.
When you ssh into a devpod using devpod ssh:
devpod sshThe wrapper automatically injects environment variables:
- GH_TOKEN: Using
gh auth token - GH_COPILOT_TOKEN: Automatically extracted from
~/.config/github-copilot/apps.jsonif available
devpod ssh --set-env GH_TOKEN=`gh auth token` --set-env GH_COPILOT_TOKEN=<token>This enables things like github copilot cli and github cli to just work... automagically, in devpods.
The plugin automatically monitors and forwards ports that are bound inside your devpod workspace. When an application starts listening on a port inside the devpod, it will be automatically forwarded to your local machine on the same port.
This uses a background port monitoring process that watches for port binding events and establishes SSH tunnels as needed. The port forwarding is cleaned up automatically when you disconnect.
The plugin automatically detects and reverse-forwards local LLM services to your devpod:
- Port 1234: LM Studio
- Port 11434: Ollama
When these services are running locally, they become accessible inside your devpod, allowing you to use self-hosted AI models in your remote development environment.