Commit graph

73 commits

Author SHA1 Message Date
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
jonathan gold
fc3dec4a58 Change signature of NewHTTPClient to accomodate errors 2021-06-25 11:26:21 -07:00
Mislav Marohnić
1ec47d8191 Improvements to gh extensions
- 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
2021-06-21 16:54:08 +02:00
jlsestak
203d41c37b
Merge branch 'cli:trunk' into first-browse-pull 2021-06-16 20:37:34 -07:00
Sam Coe
53fac59ef9
Cleanup factory/default and add tests 2021-06-15 09:19:16 -04:00
Mislav Marohnić
7999a457ad Separate out NewCmdBrowse tests from runBrowse tests
Co-authored-by: Benjamin Chadwick <benchadwick87@gmail.com>
Co-authored-by: Jessica Sestak <jlsestak@gmail.com>
2021-06-11 18:53:34 +02:00
Owen Voke
dad2d52571
feat: add commands for managing GPG keys 2021-06-11 15:55:17 +01:00
bchadwic
569d2fd58a Got tests objects to fully work! Currently working on making more test cases 2021-06-07 21:47:08 -07:00
ttran112
1a9704dbfb fix the route 2021-06-05 22:46:46 -07:00
Thanh D Tran
ed87cf71b7 Merge branch 'cli:trunk' into first-browse-pull 2021-06-05 20:43:39 -07:00
Mislav Marohnić
fce93d6080 Experimental command extensions support
Extensions are looked up as `~/.config/gh/extensions/gh-*`.
Additionally, any executables found in PATH named `gh-*` are available
as `gh <command>`.
2021-06-01 17:15:20 +02:00
Ben
68ce66801b We got the browser to open on gh browse, now we're working towards making it specific to the argument passed in. Mini wingit add .! 2021-05-15 21:09:13 -07:00
Ben
e905133068 working towards removing the help message when browse is inputted 2021-05-15 14:47:50 -07:00
Ben
88ef7ce58b removed view, from here on out exclusively working in browse to do most of the logic 2021-05-15 12:08:51 -07:00
bchadwic
602334f58a working on the browse view 2021-05-12 16:02:14 -07:00
nate smith
9110db7f7e fill in help topic 2021-04-29 10:58:40 -05:00
vilmibm
9ebcca7082 include magic repo resolution magic for workflow and run 2021-04-19 16:23:49 -05:00
Mislav Marohnić
e327b42f79 Add gh help formatting topic & link to it from commands with JSON output 2021-04-14 18:27:15 +02:00
vilmibm
cc8d55c518 remove job command, update gh actions text 2021-03-31 16:17:30 -05:00
Nate Smith
8480381d13
workflow list (#3245)
* add gh workflow list

* review feedback
2021-03-16 16:12:27 -05:00
Nate Smith
126b498e9f
Actions Support Phase 1 (#2923)
* Implement first round of support for GitHub Actions

This commit adds:

gh actions
gh run list
gh run view
gh job view

as part of our first round of actions support. These commands are
unlisted and considered in beta.

* review feedback

* tests for exit status on job view

* spinner tracks io itself

* review feedback

* fix PR matching

* enable pager for job log viewing

* add more colorf functions

* add AnnotationSymbol

* hide job, run

* do not add method to api.Client

* remove useless cargo coded copypasta
2021-03-16 13:59:34 -07:00
edualb
e26a1b98a1 add ssh-key command 2021-01-20 20:23:38 +01:00
vilmibm
5309a2089a implement gh secret create and gh secret list 2020-12-04 16:47:23 -08:00
Josh Soref
76bd377253 spelling: error 2020-11-21 21:43:51 -05:00
Nikola Ristić
e87b5bcaff
Add "reference" help topic (#2223)
* Add "reference" help topic

* Only print reference as a help topic

* fix for color fns, slightly generalize

* WIP for switching to markdown

* escape gt/lt

* minor

* higher wrap point

* detect terminal theme

* futz with angle brackets once more

* minor cleanup

* prepend parent commands

* rename help topic fns and add test

* Simplify reference help generation

- the `<...>` characters from command usage line are now preserved by enclosing the entire usage synopsis in a code span
- hard breaks in flag usage lines are preserved by enclosing flag usage in a code block
- TTY detection and Markdown rendering are now delayed until the user explicitly requests `gh help reference`
- `gh help reference` output is now pager-enabled

Co-authored-by: vilmibm <vilmibm@github.com>
Co-authored-by: vilmibm <vilmibm@neongrid.space>
Co-authored-by: Mislav Marohnić <mislav@github.com>
2020-11-18 12:31:36 -06:00
vilmibm
a2aa154794 port entirely to ColorScheme 2020-10-29 12:37:45 -07:00
zamasu
d5403fa5f5 Change feedback repo to github.com/cli/cli instead of cli/cli 2020-10-23 09:57:47 +09:00
Sam Coe
74d6eb96be
Address PR comments 2020-09-30 12:55:05 +02:00