
Google Cloud Platform’s new interactive CLI - CSDude
https://cloudplatform.googleblog.com/2018/03/introducing-GCPs-new-interactive-CLI.html
======
optimusclimb
I wish they would spend more time finishing the halfway done projects they've
started (and fully documenting them), rather than continue to launch new ones.

For instance...Google CloudSQL - Great! Postgres - Beta...Postgres from
AppEngine python...err, we'll get around to it, maybe.

Just giving one example, but my point is - finish what you've started before
making new. I think recent articles I've read about launching being the track
to promotion explain some of the state of things within GCP.

~~~
sandGorgon
+100 - i was waiting for them to launch Postgres prod. It just doesnt go live.
Even worse, they have had trouble in exposing max_connections as configurable
PostgreSQL flag
([https://issuetracker.google.com/issues/37271935](https://issuetracker.google.com/issues/37271935))

~~~
manigandham
That is an understandably automatic control feature to keep the DB instance
running well since PostgreSQL doesn't handle connection scaling well. The
recommendation is to use pgbouncer, which you can also combine with the GCP
cloudsql proxy into a separate container and use that way.

We deploy that onto GKE as a service and have our apps use that. Some setup
required but cleaner overall.

~~~
wetha
I assume CloudSQL is google’s alternative to AWS RDS. Less of an excuse to not
make the setting user configurable when the competition (AWS) does.

~~~
laixer
It's a double edged sword. When you don't limit connections and customers push
their servers beyond their limits, some of them then ask why Google didn't do
anything to prevent the situation from happening. Ideally, this would be
solved by having better failure modes but that's not really the case today.

Most product decisions are not set in stone and can be changed if there's
sufficient evidence to suggest that they do more harm than good. There's a lot
of work that goes on behind the scenes to keep the service running smoothly
and unfortunately/fortunately customers are not exposed to them. Some things
that may appear to be simple on the surface are not when you take things like
supportability into consideration.

Source: Used to work on Cloud SQL

------
neuland
This is an interesting accommodation to less terminal savvy users. I'm not
interested personally. But, it's an interesting concept.

In fact, I think it would be an interesting thing to standardize, like super-
completion.

Someone else in this thread mentioned that Amazon is working on a similar
interactive shell [0], and there is a whole group of tools like this for
database CLI's [1], including PostgreSQL, MySQL, MS-SQL, and VerticaDB.

It's a shame that each of these projects have to somewhat re-invent the wheel
(though prompt-toolkit does a lot of heavy lifting [2]). And it's even more of
a shame that each of these tools require a seperate environment. So, you have
to exit Google's interactive shell to do something in AWS.

[0] [https://github.com/awslabs/aws-shell](https://github.com/awslabs/aws-
shell)

[1] [https://www.dbcli.co](https://www.dbcli.co)

[2] [https://github.com/jonathanslenders/python-prompt-
toolkit](https://github.com/jonathanslenders/python-prompt-toolkit)

~~~
sushisource
Eh, I wouldn't say it's just for less terminal savvy users. Running -h,
finding the command you want, putting it in, is slower than this method. No
matter how skilled you are, if you aren't using GCP CLI all day every day
you're gonna forget stuff and this is a quick and easy way to remember it.

------
jmeyer2k
AWS also has something similar called AWS Shell:
[https://github.com/awslabs/aws-shell](https://github.com/awslabs/aws-shell)

~~~
algorithmsRcool
Azure has one too

[https://docs.microsoft.com/en-us/azure/cloud-
shell/overview](https://docs.microsoft.com/en-us/azure/cloud-shell/overview)

~~~
colemickens
An interactive CLI (this) is not the really at all the same thing as a
JavaScript TTY connected to a container (Cloud Shell).

(Though, Google does also have a Cloud Console that is comparable to Azure's
Cloud Shell.)

~~~
bjd145
Cloud Shell has an interactive mode - [https://docs.microsoft.com/en-
us/cli/azure/interactive-azure...](https://docs.microsoft.com/en-
us/cli/azure/interactive-azure-cli)

~~~
colemickens
That's the CLI (it's right there in the title of the article)... which yes,
can be run from the Cloud Shell, as the Cloud Shell is just a bash docker
container that has the CLI pre-installed, etc.

------
zellyn
Is this an open-source library one could use to make one's own interactive
tools? Just curious. Anyone have pointers?

Edit: I am slightly familiar with this family of tools. I was curious if there
was a pointer to exactly the one used here.

~~~
oblio
I think this is quite popular: [https://github.com/jonathanslenders/python-
prompt-toolkit](https://github.com/jonathanslenders/python-prompt-toolkit)

For Rust this library seems nice: [https://github.com/kbknapp/clap-
rs](https://github.com/kbknapp/clap-rs) (it generates autocompletion scripts
for shells)

~~~
Arcsech
To build on Rust's options, there's the Structopt library[0] that generates a
CLI interface using clap-rs from an annotated struct, which is a very, very
nice experience for making command line tools.

[0][https://github.com/TeXitoi/structopt](https://github.com/TeXitoi/structopt)

------
psychometry
Still requires Python 2.7, right? What year is it again?

~~~
shankun
Thanks for the feedback. We are actively working on Python 3 support. Stay
tuned!

~~~
kirubakaran
Are you sure? App Engine Standard Environment has had that on the "roadmap"
forever. Almost 10 years in fact.

[https://issuetracker.google.com/issues/35876441](https://issuetracker.google.com/issues/35876441)

[http://www.googblogs.com/enhancing-the-python-experience-
on-...](http://www.googblogs.com/enhancing-the-python-experience-on-app-
engine/)

------
bradhe
This is awesome, interactive CLIs are great for simple use cases. I hope they
continue to have support for non-interactive scenarios so that automation can
continue to work (apologies if I missed that in the article).

~~~
shankun
Thanks. Yes, this is completely additive to the existing SDK.

------
cryptofun
While we're on the topic, Cool Retro Term is open source or free and so much
fun to play with. I have a real thing for the amber monitors. I got to see
some ancient ones still operating the world in my early career on the dying
open outcry trading floors of the American Stock Exchange in the mid 2000s.
LMGTFY:
[https://www.google.com/search?q=amber+monitor&tbm=isch&sourc...](https://www.google.com/search?q=amber+monitor&tbm=isch&source=iu&ictx=1&fir=fSfNUPwGxeGIkM%253A%252CLlwr8x3vofq4uM%252C_&usg=__RCbknmO0-AkNOKAPEQDQJhy_kig%3D&sa=X&ved=0ahUKEwj-
wa_GlvHZAhVPS60KHagxDSkQ9QEIKzAB#imgdii=rXdOkNyK8fLPnM:&imgrc=k03wa8hB-41R6M):

~~~
cat199
Yes, I'm adding to the tangent here, but..

I use these 2:

[https://github.com/sjmulder/trickle](https://github.com/sjmulder/trickle)

[http://sensi.org/~svo/glasstty/](http://sensi.org/~svo/glasstty/)

in combination with a regular terminal application to achieve my retro vt220
VAX/BSD UNIX goodness. Doesn't have the phosphor fade like the above, but
still feels pretty 'right'.

------
therealmarv
missing good old googlecl which Google killed themselves by making OAuth2
mandatory and not beeing able to switch from OAuth1 to OAuth2 in their own
command line tool:
[https://code.google.com/archive/p/googlecl/issues/573](https://code.google.com/archive/p/googlecl/issues/573)

------
robbyt
I tried this with kubectl, but it crashed... so I used gcloud feedback to send
a stacktrace, it sent me to a page with a 400 response.

Overall, seems a bit too early to start promoting this for any real use.

------
svolpe43
I made something even better. Its for AWS though:
[https://github.com/svolpe43/cfsh](https://github.com/svolpe43/cfsh)

~~~
mcintyre1994
Nice! I worked a little bit on something similar for Azure in PowerShell.
PowerShell has a really cool feature where you basically implement the
filesystem navigation API for your app in C# or similar - how to show a path,
get its children etc., and then all the PowerShell built-ins just work when
you point it there.

~~~
svolpe43
That is pretty cool! I had to write all that stuff from scratch.

------
sigjuice
I just looked at the first animation. If I find myself typing commands this
long, I know I'm doing it wrong.

~~~
apetresc
You must've not used the AWS or GCP CLI tools before... the commands are all
very verbose with lots of mandatory parameters. There's really no way to avoid
long commands.

~~~
sigjuice
I have not. But I have used several other similar CLI tools. I prefer short
programs of my own instead of long verbose commands.

------
mns06
Did anyone manage to get this to work with fish shell?

------
dfcowell
Feels... PowerShellish.

~~~
mwj
Err, how are they in ANY way similar?

------
fouc
LOL @ the bright green on black terminal pictures. How shall I say it, it
feels very "l33t". Too bad they didn't use more normal terminal colours, it
would improve readability IMO.

~~~
tyingq
It's pretty normal and expected for those of us that spent significant time on
an actual VT220 or similar. Maybe the choice was just driven by someone
similar.

~~~
zitterbewegung
It also indicates that "this is a terminal" to someone generally browsing the
page.

