Commit graph

108 commits

Author SHA1 Message Date
Kevin Lee
0d143ca89c
Consistent punctuation in command usages (#5139)
* Fix spelling and grammatical errors in command docs
* Add periods for consistency across the long command descriptions
* Format imports
2022-01-31 10:56:12 +00:00
Mislav Marohnić
456d55ead9 Have a single Render function handle all Markdown rendering 2022-01-13 19:39:43 +01: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ć
9b7d53501f Make sure URLs in man pages render as hyperlinks on the web 2021-11-03 15:39:10 +01:00
Peter Benjamin
175da0f58a
Fix rendering issue in "formatting" help topic (#4661)
Signed-off-by: Peter Benjamin <petermbenjamin@gmail.com>
2021-11-02 17:30:49 +00: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
Alan Donovan
2f7f224c9e
Merge pull request #4584 from cli/FlagErrorf
Add FlagErrorf; encapsulate FlagError.error
2021-10-21 14:14:05 -04: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
Alan Donovan
f4491c7a80 Add FlagErrorf; encapsulate FlagError.error 2021-10-21 11:40:20 -04: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
Heath Stewart
e2973453b5
Add helper template functions for rendering tables (#3519)
Co-authored-by: Mislav Marohnić <mislav@github.com>
2021-08-23 21:00:25 +02:00
Mislav Marohnić
af2aecd40b
Merge pull request #4146 from cli/force-tty
Add ability to force terminal-style output even when redirected
2021-08-23 16:46:14 +02:00
Sam
8fb6bb66c8
Merge pull request #3992 from despreston/858-config-browser
add browser option to config
2021-08-17 14:17:54 -07:00
Sam Coe
b9438015a2
Add GH_BROWSER to help topic 2021-08-17 14:10:15 -07:00
Mislav Marohnić
321fd98f82 Add ability to force terminal-style output even when redirected 2021-08-17 20:12:25 +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
Mislav Marohnić
0d999ddaa1 Rework local extensions for Windows
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.
2021-07-28 22:47:54 +02:00
Mislav Marohnić
fdad37e248
Merge pull request #4019 from cli/enterprise-env
Fix error message when using GH_ENTERPRISE_TOKEN but host is ambiguous
2021-07-27 15:29:14 +02:00
Mislav Marohnić
9033258f5f Clean up GH_CONFIG_DIR docs
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.
2021-07-20 14:24:11 +02:00
Mislav Marohnić
aec0f10041 Fix error message when using GH_ENTERPRISE_TOKEN but host is ambiguous
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.
2021-07-20 14:11:07 +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
88ec5ad3b2 Fixing issues in the pr 2021-06-10 21:14:10 -07: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ć
ffebd23ba7
Merge pull request #3761 from cli/command-extensions
Experimental command extensions support
2021-06-03 19:13:38 +02:00
Sam Coe
389fdb7f99
Add XDG env variables to environment help topic 2021-06-02 09:56:22 -04: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