
GitHub CLI is now in beta - twapi
https://github.blog/2020-02-12-supercharge-your-command-line-experience-github-cli-is-now-in-beta/
======
tengbretson
Were the GitHub devs doing _anything_ before Microsoft bought them? All that
comes to mind is Atom. MS seems to have really been a shot in the arm for
feature development at GH.

~~~
bhl
I was recently looking into CRDTs for text-editing, and was surprised to see
that Github devs were working on an experimental text editor (Xray) [1] along
with a finer-grained version control system for real-time collaborative
editing (Memo) [2]. That project, however, seems to have been lost (and
archived) in the Microsoft reshuffling of things.

[1]
[https://news.ycombinator.com/item?id=16525735](https://news.ycombinator.com/item?id=16525735)

[2] [https://github.com/atom-
archive/xray/tree/master/memo_core](https://github.com/atom-
archive/xray/tree/master/memo_core)

~~~
touisteur
Yeah github seemed to also have some interesting innovations working with in
the (programming) language classification domain.

There has been some work done by people from the ML@B over at Berkeley (?) to
greatly improve github-linguist, the tool GitHub uses (I think) to identify
programming languages in GitHub repositories. The project is named lexicon
(used to be hosted at [https://lexicon.github.io/](https://lexicon.github.io/)
but now it 404s...) and the results seemed very interesting.

Tried pinging github support about open-sourcing this work, but it seems it's
not going to happen. I had very friendly and helpful people answering me, and
I totally understand not wanting to open-source something. I just feel a bit
sad for the lost opportunity.

~~~
bhl
I found this link [1], but nothing related to ML@B with it.

[1] [https://github.com/github/linguist](https://github.com/github/linguist)

~~~
touisteur
Best I could locate right now is [https://medium.com/@ml.at.berkeley/demo-day-
september-2016-2...](https://medium.com/@ml.at.berkeley/demo-day-
september-2016-252bcd8b395)

"Every day, millions of files are uploaded onto Github, a coding repository
where users share code and collaborate on projects. But how do you tell what
language those files are written in?

Identifying programming languages are surprisingly hard. Symbols used in one
language often have different meanings in another. For example, ‘#’ in python
indicates a comment, while in C it indicates a preprocessor command. Even
worse, code in one language can actually contain code in different languages,
such as HTML, which can contain CSS and/or Javascript.

At the moment, Github uses a giant checklist to identify unique quirks in the
language. For example, if the code contains “:- module”, then it’s probably");
background-size: 1px 1px; background-position: 0px calc(1em + 1px);"> Mercury.
However, most languages simply don’t have enough unique quirks for this method
to be accurate enough.

The current solution the Github team at ML@B came up with is to use a machine
learning algorithm called a Naïve Bayes Classifier. To optimize the program,
they used Github’s checklist as a guideline for choosing the correct language
rather than a hard-and-fast rule. Currently, the team is working on scraping
Rosetta Code, a large repository of code in hundred of different programming
languages, for data that they can use for training the program and testing its
accuracy. Eventually, they will want to see if implementing other models, such
as neural networks, can improve accuracy."

I'm certain I saw more advanced claims of success on this project and that
github knows about it, since last time I asked they were 'still talking about
it internally', but every link I had is dead...

WELL now that I googled seriously, I think I was too pessimistic, there seems
to be some movement on this front at github :
[https://github.blog/2019-07-02-c-or-java-typescript-or-
javas...](https://github.blog/2019-07-02-c-or-java-typescript-or-javascript-
machine-learning-based-classification-of-programming-languages/)

Excited to see what's coming out of this new endeavour... Just sent an email
to github support, fingers crossed.

~~~
touisteur
... and github support doesn't take requests by e-mail anymore, so I
resubmitted through the github support web page...

------
miguelmota
From hub's main developer Mislav's blog [0]

> Since I personally don’t find it valuable to spend my time maintaining two
> separate command-line clients for GitHub, I will gradually reduce my
> involvement with hub to a point where it either goes into complete feature-
> freeze mode or finds new maintainership.

So it sounds like gh will be the successor to hub.

[0] [https://mislav.net/2020/01/github-
cli/](https://mislav.net/2020/01/github-cli/)

~~~
captn3m0
I switched long back, when I realised that gh was faster, easier to install,
and there was no syntax change on the commands.

Edit: I sound very confused in this thread because I still call the old Golang
version gh in my scripts. Thought it was the same codebase graduating till I
read this.

------
ken
This pains me. They saw the "what" but not the "why".

The point of using a command line is not because a VT100 emulator is an ideal
way to view data (it's not). It's so we can combine commands, using pipes and
redirection. I don't want to learn special new filtering flags. I want to get
raw data that I can pipe to grep or cut or any of the other dozens of tools
I've been learning and using for the past 25 years.

The point of using a distributed version control system is so I can store it
all locally. This new tool defaults to only 30 items, and cannot fetch more
than 100. So even if you're willing to put up with the multi-second latency of
hitting their servers for every command line operation (it feels like CVS all
over again), you still can't say "give me everything and let me grep it". You
have no choice but to use the 3 ways they give you to filter (assignee, label,
state -- not title, comments, or date).

I've got a 50Mbps network connection, a 500GB SSD, 16GB of memory, and an
8-core CPU, and now instead of putting all that to work running JavaScript to
access my bug reports, I'm fetching them as plain text at a maximum of about
5000 bytes at a time. (Net throughput is on par with an Apple II with a
14.4Kbps modem.) Is this an improvement?

I do not understand why GitHub Issues aren't git repos, like most other GitHub
collections. Then we wouldn't _need_ a completely new (and
slow/complex/limited) tool to read bug reports on the command line. Perlis had
this figured out back in 1982: using common tools for disparate data is a
killer feature. That's _why_ we're still using the command line in a way that
looks nearly identical to how it worked in the 1980's, and a few generations
of other interfaces have come and gone since then and failed to displace it.

~~~
Naac
The pessimist in me would say that Github doesn't have issues as git repos
because it makes migrations off of their platform more difficult. Hence making
vendor lock-in stronger.

The optimist would say limiting contributions to issues on web platform made
the formatting ( markdown ) consistent. So that linking back to issues and
commits was more standard, and therefore made Github Issues a nice tool to use
over the competition at the time.

~~~
dotancohen

        > formatting ( markdown ) consistent.
    

This actually is not a good argument because Markdown is specifically designed
to be readable as plain text.

~~~
Naac
That's fair. I was really looking at the bottom of the barrel for reasons
github would do this, other than vendor lock-in.

------
kbd
It's frustrating that they'd release a new CLI and nowhere address its
relation to their existing 'hub' CLI.

Edit: found a note in their readme on github:
[https://github.com/cli/cli#comparison-with-
hub](https://github.com/cli/cli#comparison-with-hub)

> For many years, hub was the unofficial GitHub CLI tool. gh is a new project
> for us to explore what an official GitHub CLI tool can look like with a
> fundamentally different design. While both tools bring GitHub to the
> terminal, hub behaves as a proxy to git and gh is a standalone tool.

~~~
OJFord
> hub was the unofficial GitHub CLI tool.

'unofficial'... [https://hub.github.com/](https://hub.github.com/)

I officially despise how meaningless '[un]official' has become.

~~~
scarejunba
I love it. There being a spectrum between "blessed" and "work of a random"
means that we get more software.

And in the end, since it's open source, it's up to me whether I derive value
from it.

~~~
OJFord
? My point is that it wasn't 'work of a random'; it was in a repo under the
`github` org; with a first-party GitHub website.

OSS is great, I agree, my issue is just with the weird description of GitHub's
older similar tool.

~~~
scarejunba
That's _my_ point. If a company can release something without being on the
hook for it, that's awesome. It encourages them to release half-baked stuff
alongside their platinum stuff which is something I desire far more than
having them only release stuff that's full-baked.

Simply put, I prioritize more software way more than I prioritize officialness
etc.

------
Aissen
I wish some people at github would address the bad mobile version of their
website. It's impossible to do anything done with the current mobile UI
without going through the desktop version:

\- see the language stats for this repo

\- see commit history in one tap

\- read the full readme

\- see all files at top level

\- etc.

If you're already hard at work on this, thanks in advance.

~~~
billygriffin22
Hi! We're working on the mobile experience across the board. Here's a recent
tweet highlighting improvements to the mobile web experience:
[https://twitter.com/natfriedman/status/1227378615387443200?s...](https://twitter.com/natfriedman/status/1227378615387443200?s=20)

And yes, we're also definitely investing in the mobile app as well and the
reception from the beta has been really positive so I'm excited for when we're
able to roll it out to everyone.

~~~
Aissen
I've heard of the app, and it's great news. But I feel that with just a little
push (well, not so little, but small at Github scale), the mobile website
could be so much better, and everyone would benefit from it without installing
an app (although with an Instant App one could have the best of both worlds…
but just on Android).

The demo of Emily and Jon's work shown by Nat is great news and I hope it
continues forward.

------
guessmyname
I am glad they used Go to develop this command line tool.

Knowing how big GitHub is on Ruby and Node.js I was afraid they had used one
of these two languages to bootstrap the program.

Being able to drop the binary in any computer and have it work without
hundreds of files as dependencies is a bless when you write programs in Go.

~~~
vmchale
> have it work without hundreds of files as dependencies is a bless when you
> write programs in Go.

lots of languages have that lol

~~~
rfrey
There aren't many things you could say you like about any language that
couldn't be sneered at with "lots of languages have that lol".

It's what your parent likes about Go. Inventing a claim of uniqueness and then
condescendingly dismissing it isn't a good look.

~~~
vmchale
>There aren't many things you could say you like about any language that
couldn't be sneered at with "lots of languages have that lol".

GHC has first-class support for laziness. Rust has affine types.

------
geerlingguy
I've been using Hub[1] (though not aliased to `git`) for years now, and it's
PR management capabilities have been invaluable working on larger projects.
Hopefully GitHub CLI is as stable and reliable!

It looks like the main features I use from Hub are already well-supported in
the GitHub CLI, and it looks like whether or not Hub will still be maintained
is an open question[2].

Edit: Just noting that `brew install github` doesn't work, it's actually `brew
install github/gh/gh` — that's a new format for brew packages I haven't seen
before.

[1] [https://github.com/github/hub](https://github.com/github/hub)

[2]
[https://github.com/github/hub/issues/2470](https://github.com/github/hub/issues/2470)

~~~
billygriffin22
Hi! I'm on the team building GitHub CLI. We're definitely eager for your
feedback on what things feel like they're missing, and especially if something
is broken or doesn't feel stable or reliable. Feel free to open an issue if
there's anything that stands out.

The different homebrew installation you referred to is because `gh` isn't part
of homebrew/core yet as it's very new. So we'll be adding it in the coming
months, but for now that's just a way for us to maintain our own tap and still
provide an easy install/upgrade path.

~~~
atombender
I use "hub browse" a lot. It's a really quick way to open a local directory's
Github repo.

Unfortunately, it's quite limited. No way to open a specific file, for
example, or jump to a specific branch other than the current one.

I'd love to have something like "gh open".

~~~
billygriffin22
It's on our roadmap!
[https://github.com/cli/cli/issues/217](https://github.com/cli/cli/issues/217)

------
tilolebo
From [https://github.com/cli/cli#installation-and-
upgrading](https://github.com/cli/cli#installation-and-upgrading)

> gh is available via scoop

And I've been using chocolatey the whole time :facepalm.

How does scoop compare to choco? (Except for the obvious "no admin permissions
needed")

~~~
GordonS
Scoop is more opinionated, in that there is a single, canonical version of
each app. My experience with chocolately is very different, as there are often
multiple different packaged versions of any given app, and you've no idea
which is the "best" one.

~~~
tilolebo
I usually go for the one with the most downloads, but it's true that it can be
confusing. Reminds me of the SUSE package web search back in the days.

------
EamonnMR
My cynical side wonders if this is a case of Embrace Extend Extinguish-move
developer mindshare off of git (GitHub as commodity git hosting) and into
vendor lock-in.

~~~
Ididntdothis
It sort of makes sense with MS being the owner. I definitely notice that a lot
of the new grads don’t really know about git. They think it’s all Github.

~~~
grogenaut
I've had a lot of freelancers lately who when I ask for their ssh public key
they send me their GitHub username. Like 10 in a row. Half of them had public
keys even.

Yet at work no one has this issue with our ghe

~~~
GauntletWizard
Yeah, I don't get that. I use my github as a repository of my public keys - At
least partially because Ubuntu will now ask for a github username to prefill
authorized_keys, but I had a curl script set up before that - But I would not
confuse "Here's where there's an updated list of my keys" for "Here's a key";
The response is, at best, `*[]key` rather than `key` (and assuming you know
the github.com/$USER.keys syntax, which isn't exactly standard)

------
pimlottc
> [https://github.com/cli/cli](https://github.com/cli/cli)

Hmm, wonder why they felt the need to move it to its own org? What's wrong
with `github/cli`? That's arguably clearer than the very generic `cli/cli`.

Looks like it used to be at github/gh-cli before January 24 [0]; I wonder what
kind of compensation they gave to the previous owner of `cli`? [1]

0:
[https://github.com/cli/cli/commit/a710893fc107c9a269d8654f08...](https://github.com/cli/cli/commit/a710893fc107c9a269d8654f0834d752a0b999f7)

1:
[https://web.archive.org/web/20170331061435/https://github.co...](https://web.archive.org/web/20170331061435/https://github.com/cli)

~~~
wereHamster
Maybe to be able to use cli.github.com…

------
kccqzy
Doesn't it bother anyone that in the first graphic they used typographically
correct Unicode quotes, but these quotes won't work in shell? I initially
thought that these were screenshots in an actual minimalistic terminal
emulator but apparently these are just graphic designs.

------
tripzilch
So is this like an improved version of git with an easier command line syntax?

As in, can you use it for local gittering, or does it really require a
connection to github all the time?

Because I don't feel good about this tool if it's basically another trick at
lock-in. Git the versioning system is currently pretty open; You can use your
own local repos, host on gitlab or github or your own server, and you really
do roughly get the same experience from the command line.

Like, is this going to prompt me to host my local git repos on github? Not
whether it can, of course it can, will it nag me?

People used to call these worries FUD but they also put ads in the start menu
and turned telemetry up to 11, for an OS. I think current day it's a
legitimate worry to consider. I haven't really had the misfortune of having to
deal with such attitude towards users on the command line. But we'll see.

Or do they see "developers" as an audience to be treated differently than "end
users".

------
hprotagonist
I wonder how much this will impact or help forge
([https://github.com/magit/forge](https://github.com/magit/forge) ) , which i
have, to my shame, never gotten to authenticate properly.

~~~
mandarg
forge and github-review ([https://github.com/charignon/github-
review](https://github.com/charignon/github-review)) have given me a near-
immersion experience for bitesized code reviews in Emacs. They even work
together, via github-review-forge-pr-at-point!

The only thing stopping me from using this with larger diffs is the lack of a
good way to show more of the surrounding context in github-review. Wonder if
there is any interest in making github-review a first-class part of forge.

------
jdmg94
I personally use the git CLI for my day to day work needs, I think this was so
unnecessary considering there are so many other things that Github could focus
on. Microsoft is once again ignoring the mobile market, shittè mobile app,
shittè mobile website, but hey, a redundant CLI FTW

------
alacombe
Tried to use it from a terminal...

% gh pr list

Notice: authentication required

Press Enter to open github.com in your browser...

/bin/xdg-open: line 881: www-browser: command not found

/bin/xdg-open: line 881: links2: command not found

^C

1) I would have expected it to be able to work with the installed ssh keys
used with the associated repo, but no luck :-(

2) RPM is broken, as it does not include any dependencies, and

3) even after install links, it fails with:

[warn] Epoll ADD(1) on fd 0 failed. Old events were 0; read change was 1
(add); write change was 0 (none); close change was 0 (none): Operation not
permitted

ERROR: event_add failed: Operation not permitted at select.c:415, handle 0

4) I don't think they're gonna be handling 2FA :-/

I guess that's gonna be a pass for now...

------
pojntfx
Now open source GitHub! It is such a hypocritical stance to talk about how
great FLOSS is while at the same time not producing the product itself as
FLOSS.

------
donutdonut
GitHub introducing a CLI is kinda like putting powered sugar on a glazed
doughnut.

------
contingencies
Command line features I want for a hosted RCS/VCS: multi-repo add/remove user
(support hire/fire employees), CI/CD features (set/check/pre-commit enforce
tests and metrics, view state, get/set callbacks), create/config new repos.

The example commands shown support automatic creation of issues which is OK
for CI/CD, but PRs are not something we use or care about. I understand it
from marketing as a 'makes us different to raw git' sorta differentiating
feature, but it's just not part of many company's workflow. I _love_ and miss
from previous Gitlab repos strong pre-commit hooks and being able to reject
commits that breach policy or break tests. Without this CI/CD needlessly
chokes on issues, state and manual process.

~~~
__float
It sounds like you're looking more for an administrative CLI for Github,
rather than the usual "Github user" experience in the command-line.

What do you use instead of PRs? (Honestly, _not_ using PRs and paying for GHE
sounds like a... less-than-ideal way to spend your money?)

The PR workflow + Checks are a good "equivalent" (IMO, nicer) experience to
pre-commit hooks.

~~~
contingencies
_looking more for an administrative CLI for Github, rather than the usual
"Github user" experience_

Yes. Because I already have _git_ , which by definition already does 99% of
what I need as a user. Issues + remote repo admin + CI/CD are the exceptions.

 _What do you use instead of PRs?_

Direct commit with no branching. IMHO PRs are an arguable misfeature of hosted
RCS/VCS to keep people on those platforms. We have a high proportion of non
software development projects/users.

~~~
__float
Issues, CI/CD, and code review are a _huge_ part of the development process
that git does not do.

Committing directly might work for a small team, but I can't imagine that
scales.

I suppose we want fundamentally different things here, and sadly for you, I
don't think you're a large enough portion of the audience that GitHub will
ever create the tool you need.

Their APIs are open, though -- you can probably make one yourself.

~~~
contingencies
No, I am actually the majority of the potential market and future growth for
hosted RCS/VCS firms: a tech company with many non-tech employees that wants
to utilize RCS/VCS to formalize internal process across disciplines.

You are the minority.

------
SEJeff
Too bad this doesn't work with Github Enterprise :(

~~~
billygriffin22
Sorry! We're hoping to get to it after gh is out of beta. It's definitely
something we're hearing people want, and I'm excited for when we can say it
just works. :)

~~~
SEJeff
I shared this in our #git internal slack channel and immediately had a dozen
people bemoaning it not supporting our GHE. Thanks!

~~~
billygriffin22
Absolutely, thanks for sharing and apologies that we're not quite there yet!

------
duxup
Forgive me as I'm a bit of a noob but as it is I'm using git bash on windows.

Any reason I'd bother to switch to this?

~~~
xyst
This is not a "git" CLI since git already has a CLI. This is a CLI on top of a
CLI that directly interfaces with Github (a VCS provider).

Basically, it's for the terminal geeks that don't want to bother with using
the web interface of GH for daily tasks.

~~~
duxup
Oh I got it now, thanks. Two different ends of the workflow.

------
xvilka
With some extension even navigating issues can be done in cli through markdown
viewer in console (I opened a suggestion[1] in Hub's repository).

[1]
[https://github.com/github/hub/issues/2192](https://github.com/github/hub/issues/2192)

------
turdnagel
Frustrating that the CLI is an “open” beta while the iOS and Android clients
are not. I’d love to test the iOS beta but I have no idea where I am on the
waiting list.

~~~
machello13
There's a maximum number of users allowed for a TestFlight test (I believe
10,000), so it's out of GitHub's control.

~~~
billygriffin22
Yes, this! We'd love to open the beta up to more folks, but we're capped at
that number for now. Excited to bring it to more people soon though!

------
KenanSulayman
Is there a way to install this without using Homebrew? I know that the author
of it works at Github now, but that definitely shouldn't be the only option..

~~~
dcchambers
In this case, you can download the prebuilt binaries from the Github repo page
itself under the 'Releases' tab. But as with anything in Brew, if you can't
find the installable binary or tarball online yourself, you can simply look at
the Brew formula to find the URL and download+install it manually.

[https://github.com/github/homebrew-
gh/blob/19a5398d3c022e80f...](https://github.com/github/homebrew-
gh/blob/19a5398d3c022e80fb0c7a388108781914dcf5bb/Formula/gh.rb#L9)

------
xRazoo
Excited to try this out, but not sure how much use I’ll actually get out of
this. Might be a slightly faster way to look through issues for now.

------
reddit_clone
How does this work with internally hosted github server? When I tried a
command on an existing clone folder, it wants to go to github.com to
authenticate.

~~~
billygriffin22
We don't have GitHub Enterprise Server support yet, but that's something we're
planning to work on after gh is out of beta.

------
chmaynard
Does checking out a pull request locally include pulling down all the
comments? I assume not, but that would be a cool feature.

~~~
billygriffin22
It doesn't - it's just the code on that PR, but you can also use a --preview
flag on pr view to get render the body of the PR in your terminal. We may
explore something around incorporating comments down the road as well.

------
imjustsaying
Has anyone made a customizable URL bar CLI like Duckduckgo's shebangs (which
is not customizable)?

This is the new CLI i want most

~~~
est31
Firefox has the ability to customize shebangs.
[https://support.mozilla.org/en-US/kb/assign-shortcuts-
search...](https://support.mozilla.org/en-US/kb/assign-shortcuts-search-
engines)

~~~
rrdharan
So does Chrome, and even Safari used to be able to do this via extensions
until very recently.

I would assume the parent poster wants something richer than a single
substitution though?

~~~
imjustsaying
I didn't know this. I thank you both.

------
dijit
Anything similar to this for gitlab?

~~~
simon04
[https://zaquestion.github.io/lab/](https://zaquestion.github.io/lab/) – Lab
wraps Git or Hub, making it simple to clone, fork, and interact with
repositories on GitLab

------
julianlam
Give me a way to easily clone a repo and I'm sold.

`gh clone nodebb/nodebb -https`

------
justlexi93
How is this different from the hub command?

------
elpakal
Awesome, but I really wish GH would open source all of their own apps. I
always find it hypocritical that they do not, given their OSS advancement.

~~~
monkey_slap
gh is open source [https://github.com/cli/cli/](https://github.com/cli/cli/)

