* Add --repo flag to commands
* Example of using common args
* Add -r to stop
* Add validation to the add helper
* Skip prompt for single option
* Migrate (mostly) everything to addGetOrChooseCodespaceCommandArgs
* Fix typo in logsCmd
* Use R instead of r
* Update a couple -r usages
* Refactor to codespace_selector
* Clean up selector, apply it in a couple examples
* Use apiClient instead in constructor
* Restore addDeprecatedRepoShorthand
* Finish implementing the commands
* Update existing tests to use the selector
* Add tests for selector
* linter
* Catch case where there's no conflict
* Make the flag persistent for ports
* Add support to stop
Since all of the port operations require the codespace to be running, we
need to disallow these operations when there's a pending op since we
can't start the codespace in this state.
Since the API already disallows this, this is basically cleaning up the
error messages that the user sees in this state
Old error message:
```
$ gh cs ports forward 80:80
? Choose codespace: redacted
Starting codespace ⣻error connecting to codespace: error starting codespace: HTTP 422: your codespace has an operation pending: updating to a sku with a different amount of storage; please wait until this operation is complete (https://api.github.com/user/codespaces/cwndrws-redacted/start)
```
New error message:
```
$ gh cs ports forward 80:80
? Choose codespace: redacted
codespace is disabled while it has a pending operation: Changing machine types...
exit status 1
```
* Rework logging, showing progress, and printing from `codespace` commands
* Change rendering of the general progress indicator so that it's visible on both dark and light backgrounds
* The progress indicator now "spins" faster
Co-authored-by: Mislav Marohnić <mislav@github.com>
* Add org scoped port forwarding + fix test formatting
* Redesign port visibility
* Update pkg/cmd/codespace/ports.go
Co-authored-by: Jose Garcia <josebalius@github.com>
* Change sub command to privacy
* Example pr comment
* Fix test mock
* Fix test mock
Co-authored-by: Jose Garcia <josebalius@github.com>
- Session now accepts two new options: ClientName and Logger
- Port forwarder now supports a keepAlive parameter which when true,
instructs the PF to call the session's keepAlive method.
- Port forwarder uses a new traffic monitor to detect I/O traffic and
notify the session when applicable.
- The SSH command introduces a new debug flag which enables the command
to log to a new temporary file. The file path is printed to the user.
- Drop GetCodespaceToken as it is no longer necessary
- Introduces new behavior with the API to optionally include connection
details in the GET request. Ommitting to do so results in a faster
response