The GH_DEBUG environment variable is a new gh-specific verbosity control.
For backwards-compatibility, DEBUG will still be respected if it has values
"1", "true", "yes", and "api", but any other values will be ignored.
Finally, support for "oauth" debug value has been dropped in favor of "api".
The "oauth" value only had limited, internal use.
Co-authored-by: Mislav Marohnić <mislav@github.com>
This is to avoid having to explicitly pass it to each subcommand that
needs it. Each codespaces command runs in the context of App, so that's
a point of shared context that we can store state in.
cmdutil.Factory.Executable() accounts for things like package managers
and symlinks to the actual executable.
An alternative to passing the *cmdutil.Factory down the stack would be
stashing the executable string in the codespace.App, which works (and
the diff is smaller), but it produced some odd non-local test failures.
This way seems less mysterious and more like other uses of Factory in
the codebase.
gh codespace commands now respect the following environment variables:
- GITHUB_SERVER_URL: typically "https://github.com"
- GITHUB_API_URL: typically "https://api.github.com"
- INTERNAL_VSCS_TARGET_URL: typically "https://online.visualstudio.com"
- GITHUB_TOKEN when CODESPACES is set, even if the host connecting to isn't "github.com".
This set of changes ensures that `gh codespace` commands automatically connect to the right API endpoints when gh is used within a codespace.
Co-authored-by: Mislav Marohnić <mislav@github.com>
* 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>
Replace the implementation that relied on symlinks with the one that
create regular files that act like symlinks: they contain a reference to
the local directory where to find the extension.
This removes the false equivalence between GH_CONFIG_DIR and
XDG_CONFIG_HOME. These settings do not have the same effect and should
not be used for the same purposes.
Also remove the documentation about what `XDG_*` settings do. We simply
conform to the XDG Base Directory Specification, but will not document
it. It's likely that users of these environment variables already know
what they do.
Before:
$ GH_ENTERPRISE_TOKEN="..." gh pr create
could not find hosts config: not found
Now:
$ GH_ENTERPRISE_TOKEN="..." gh pr create
set the GH_HOST environment variable to specify which GitHub host to use
Also amends `gh help environment` documentation to suggest the use of
GH_HOST when scripting operations with GitHub Enterprise repositories.
- Extensions on Windows now enabled through the `sh.exe` interpreter
- `sh.exe` now found on Windows when git was installed via scoop
- `gh extensions list` command shows origin repo for the extension
- `gh extensions upgrade --all` is required to upgrade all extensions
- Added `gh extensions remove`
- Shell completions now include aliases and extension names
- `gh` help output now lists available extension names
- Extensions are stored to XDG_DATA_HOME