Skip to content

luanzeba/csw

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 

Repository files navigation

Codespace CLI Wrapper

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 ❤️

Usage

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 into gh 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

Dependencies

fzf

gh cli

Installation

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

Disclaimer

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.

About

Wrapper around the `gh codespace` CLI

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages