Commit graph

100 commits

Author SHA1 Message Date
John Keech
93e1511bae
Codespaces: Use the host name from the logged in server for commands (#7795)
* Use the host name from the logged in server for codespace commands

* Fix existing tests

* Add tests for server url configuration

* Rename defaultApiUrl to defaultAPIURL and comment cleanup

* Switch to t.Setenv in codespaces api tests

* Switch to t.Setenv in other tests

* Support custom server in web flows for list and create

* Rename GetServerURL() to ServerURL()
2023-08-08 09:32:06 -07:00
Nate Smith
96d7274044
Merge pull request #7403 from joshkraft/gh-cache-command
Create `gh cache list`, `gh cache delete`
2023-07-10 16:00:57 -07:00
Nate Smith
4ba2f2ffb3
Merge pull request #7650 from vaindil/vaindil/rulesets
Add support for repository rulesets
2023-07-10 12:50:23 -07:00
whi-tw
a7e2fc49b0
Use SmartBaseRepoFunc for api command (#7594) 2023-07-06 15:02:32 +09:00
vilmibm
bcb4194692 WIP compute branch, call API 2023-07-05 13:57:19 -04:00
Ariel Deitcher
ad4a489f8d
Introduce gh project commands (#7375)
Co-authored-by: Mislav Marohnić <mislav@github.com>
2023-06-09 16:57:01 +00:00
Mislav Marohnić
e3569dc7bd
Fix bash completions for extensions and aliases
Now that extensions and alises are real Cobra Command instances, they will appear in
completions automatically and don't need to be additionally inserted via ValidArgs.
Their addition to ValidArgs have caused all extensions and aliases to be listed twice
within completion results, which didn't seem to affect zsh completions at all, but in
bash completions it had caused the completion description to be a part of the expansion.
2023-06-02 13:31:02 +02:00
srz_zumix
dfb6d9d5bb
fix: Allow aliases to recognize extended commands (#7523) 2023-06-02 08:20:11 +09:00
Sam Coe
74ee8cacae
Allow creating of nested aliases (#7457) 2023-05-25 09:46:45 +09:00
Josh Kraft
2e5a728338
Merge branch 'trunk' into gh-cache-command 2023-05-17 14:34:10 -06:00
William Martin
07ed1e4e8a
Introduce helpTopics type and reduce duplication across commands (#7414) 2023-05-11 14:59:12 +02:00
Josh Kraft
213a59b8bd create cache commands 2023-05-03 11:03:50 -06:00
Josh Kraft
37970f4863 feat: add gh org list 2023-03-31 15:53:55 -06:00
Anupam Kumar
88cc4d2531
Add variable set command (#6928) 2023-03-13 03:01:38 +00:00
Sam Coe
c9a2d85793
Cleanup config.AuthToken and config.DefaultHost methods (#7049) 2023-02-28 00:24:45 +00:00
Robin Neatherway
78fb90956c
Teach gh cs create to use current repo as default (#6596)
Co-authored-by: Mislav Marohnić <mislav@github.com>
2023-02-07 20:05:38 +00:00
Mislav Marohnić
b3aeaf6c2e
Remove the feedback section from gh help 2022-11-09 16:43:18 +01:00
Mislav Marohnić
b12ea845ef
Migrate to the new Cobra command grouping feature 2022-11-09 16:42:13 +01:00
Matthew Runo
9b16d1ecdd Fixes #6024.
Adding documentation for exit codes used by 'gh'
2022-08-15 15:20:19 -07:00
Mislav Marohnić
d21d388b8d
Restore old GH_DEBUG=1 behavior for HTTP logging (#6054)
- No HTTP bodies or headers are logged until `GH_DEBUG=api` is used.
- Logging to terminal now supports colorization.
2022-08-10 17:59:13 +02:00
Sam Coe
074ed50b8a
Integrate go-gh API package (#5614) 2022-06-23 04:05:31 +01:00
Mislav Marohnić
7859afb586 Fix Cobra completion output going to stdout 2022-05-25 14:57:47 +02:00
Mislav Marohnić
cfaca91d06 Fix --version flag printing to stdout 2022-05-24 16:21:13 +02:00
Mislav Marohnić
2139e763fb Write Cobra deprecation messages to stderr
We used to do the equivalent of `rootCmd.SetOut(os.Stdout)` because we
thought that Cobra's "Out" stream represents standard output. However,
upon closer inspection it turns out that this is Cobra's stream for
usage errors and deprecation warnings, and those we want written to
stderr as well. It is not clear to me why Cobra maintains a distinction
between "Out" and "Err" streams since both seem to go to sdterr by
default.

This change also ceases our usage of `command.Print()` functions in
favor of explicitly writing to `IOStreams.Out/ErrOut`.
2022-05-23 20:23:42 +02:00
xiaotong
4a5864708c
Add label list and label create commands (#5316) 2022-03-29 17:38:59 +00:00
nate smith
f22c325ea4 gh status 2022-03-28 11:53:13 -05:00
Sam Coe
e0045f26b9
Add top level search command and search repos sub command (#5172) 2022-03-09 12:24:27 +00:00
Nate Smith
91c4a5d828
Merge pull request #5234 from markphelps/codespaces-accept-perms
Codespaces Create: Allow Accepting Permissions
2022-02-28 16:54:45 -06:00
Mislav Marohnić
7235384f12 gh: list help topics in help output 2022-02-18 18:39:30 +01:00
Mark Phelps
590acaa1d6 WIP 2022-02-15 19:35:53 -05:00
Mislav Marohnić
3b7e5fc246 Store Executable() information on codespaces App
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.
2021-12-21 14:03:10 +01:00
Jason Lunz
f22be4a03d
use a more robust method to get the executable path
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.
2021-12-20 13:57:52 -07:00
Marwan Sulaiman
a3940020f9
Inherit API endpoint configuration from the Codespaces environment (#4723)
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>
2021-11-22 12:40:01 +01:00
Mislav Marohnić
a843cbd728 Mark codespace a core command 2021-10-25 19:42:22 +02:00
Mislav Marohnić
31ba2ea4d5
Publish codespace commands (#4606) 2021-10-25 17:38:00 +00:00
Jose Garcia
bbea5ac95e
codespace: progress indication, logging (#4555)
* 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>
2021-10-21 18:04:04 +02:00
Sam
a02d423687
Merge pull request #3822 from owenvoke/feature/gpg-key
feat: add GPG key management commands
2021-10-18 11:36:44 -07:00
Mislav Marohnić
a723813064 Don't allow the lazyLoadedHTTPClient mutex to wrap Do()
We only need a mutex around accessing `l.httpClient`, but never around
the actual HTTP request.
2021-10-01 11:18:15 +02:00
Jose Garcia
0859de0124 Merge branch 'trunk' of github.com:cli/cli into jg/move-ghcs-cmd 2021-09-30 12:38:41 -04:00
Jose Garcia
9e6c11e767 Move cmd/ghcs to pkg/cmd/codespace
- Delete pkg/cmd/codespace/main as it is no longer needed in this
  codebase
2021-09-30 11:20:13 -04:00
Jose Garcia
b5bbb442fd Move internal/api to internal/codespaces/api 2021-09-30 11:06:43 -04:00
Jose Garcia
c3ce95ea1c Add mutex to guard httpClient 2021-09-29 16:45:51 -04:00
Mislav Marohnić
0d0152b0fa Have gh codespace inherit the correct API client 2021-09-29 21:21:16 +02:00
Mislav Marohnić
7673622830 Mount gh codespace command 2021-09-28 17:03:05 +02:00
Sam Coe
952ebc8eb2
Change to v2 import statements 2021-09-13 14:56:13 -07:00
Sam Coe
78067e0a89
Merge branch 'trunk' into feature/gpg-key 2021-09-13 14:50:56 -07:00
Mislav Marohnić
11fbb60ae7 Rename the module to "github.com/cli/cli/v2" 2021-08-25 12:41:30 +02:00
Mislav Marohnić
bf9c49eccd Rename gh extensionsgh extension
This is for compatibility with other core commands which are all singular.
2021-08-11 22:22:39 +02:00
Nate Smith
554250bc4e
Merge pull request #3779 from jgold-stripe/unix
Add ability to dial API via unix socket
2021-06-29 09:46:33 -07:00
Nate Smith
0474ba686d
Merge pull request #3773 from bchadwic/first-browse-pull
Feature/Create browse command
2021-06-29 09:17:30 -07:00