Wrapper around the gh codespace
CLI.
Useful when working with multiple codespaces.
It keeps track of the current codespace and automatically appends the -c <codespace_name>
argument to your commands.
Inspired by kns
❤️
csw
let's you select the working codespace.
csw <command>
will forward the command to gh codespace
with the codespace automatically appended.
- It will also forward any flags you include in your invocation. E.g.
csw ssh -- -I ~/.ssh/.id_rsa
will turn intogh cs -c $current_codespace ssh -- -I ~/.ssh/.id_rsa
- Works with all
gh codespace
commands.
When you use csw
to create a codespace, it automatically sets it as the working codespace.
csw.demo.mp4
Put the csw file in a directory included in the $PATH
environment variable and give the execution permission to the file.
curl https://raw.githubusercontent.com/luanzeba/csw/main/bin/csw -o path/to/file && chmod +x path/to/file
This is a work in progress. Contributions are welcome!
I realize that using csw
instead of gh codespace
isn't great. In and ideal scenario, the gh cli config could support a setting for a working codespace and this wrapper could be replaced with an extension instead.