Our great sponsors
-
The proposed solution of an API with a thinly wrapped auto-generated CLI is not terrible. I have heard it is common within Google, for example.
In the Python world, there are various solutions starting from https://github.com/ialbert/plac or https://argh.readthedocs.io/en/latest/ and moving on to https://github.com/pallets/click or https://github.com/Lucretiel/autocommand and probably N others.
Personally, I prefer Nim to Python which has https://github.com/c-blake/cligen. As mentioned in https://github.com/c-blake/cligen/blob/master/MOTIVATION.md, but not in the article, the overhead of dispatch to a program in shell REPLs can also be thousands to millions of times higher than an API call.
-
For example, author's first example
cat beef.txt | grep "lasagna" | sort -n | uniq
is already possible literally as written in Xonsh (a Python-based shell) with a pipeliner plugin
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
-
The proposed solution of an API with a thinly wrapped auto-generated CLI is not terrible. I have heard it is common within Google, for example.
In the Python world, there are various solutions starting from https://github.com/ialbert/plac or https://argh.readthedocs.io/en/latest/ and moving on to https://github.com/pallets/click or https://github.com/Lucretiel/autocommand and probably N others.
Personally, I prefer Nim to Python which has https://github.com/c-blake/cligen. As mentioned in https://github.com/c-blake/cligen/blob/master/MOTIVATION.md, but not in the article, the overhead of dispatch to a program in shell REPLs can also be thousands to millions of times higher than an API call.
-
The proposed solution of an API with a thinly wrapped auto-generated CLI is not terrible. I have heard it is common within Google, for example.
In the Python world, there are various solutions starting from https://github.com/ialbert/plac or https://argh.readthedocs.io/en/latest/ and moving on to https://github.com/pallets/click or https://github.com/Lucretiel/autocommand and probably N others.
Personally, I prefer Nim to Python which has https://github.com/c-blake/cligen. As mentioned in https://github.com/c-blake/cligen/blob/master/MOTIVATION.md, but not in the article, the overhead of dispatch to a program in shell REPLs can also be thousands to millions of times higher than an API call.
-
The proposed solution of an API with a thinly wrapped auto-generated CLI is not terrible. I have heard it is common within Google, for example.
In the Python world, there are various solutions starting from https://github.com/ialbert/plac or https://argh.readthedocs.io/en/latest/ and moving on to https://github.com/pallets/click or https://github.com/Lucretiel/autocommand and probably N others.
Personally, I prefer Nim to Python which has https://github.com/c-blake/cligen. As mentioned in https://github.com/c-blake/cligen/blob/master/MOTIVATION.md, but not in the article, the overhead of dispatch to a program in shell REPLs can also be thousands to millions of times higher than an API call.
-
There is a python-based shell https://xon.sh with a plugin that allows piping :)
-
This is well made case - but I'm not sure I buy the central argument. Within some basic limits, I don't think terseness and readability have the contradiction made out here, because in programming we have abstraction, which gives us both.
To take the example command that's given:
beef.txt | grep "lasagna" | sort -n | uniq
Sure, writing the logic out for this in something like python straight out the bat with only the standard library might look messy, but with one basic convenience function it could quickly be:
search(for='lasagna', in='beef.txt', clear_duplicates=False).sorted()
Obviously you have to write the function in the first place, but I'd say if you're doing something like this often, it's easily worth spending that 2 minutes. And if you're not doing this often, you'll have a faster time writing more code, but keeping less heavy lifting of "how does bash pipe together" in your head.
I shared a project here a few weeks ago experimenting with what my dream shell might look like, what surprised me more than anything else, was how easy writing a repl environment actually is. I put a scrappy one together as one person in a few hours, so I don't understand why as developers we've reached general language models before being able to make a powerful, but new-user friendly shell.
Also, completely unrelated note, but posix only allows passing back strings - but isn't this true of web apis too which we use all the time? How come no json as a standard passback from programs?
Shameless plug for the project I mentioned earlier: https://github.com/benrutter/clamshell
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
-
mazzle
run server for building large and complicated consistent environments http://devops-pipeline.com
I've been experimenting with alternative pipeline syntaxes.
One example is using Graphviz graph files as an execution plan for software deployments. You can see a graph here:
https://github.com/samsquire/mazzle/blob/master/docs/archite...
I wrote code with networkx to parse this graph dot file and then follow the plan topologically, spinning up packer, terraform, bash scripts, compilation and so on. It also executes graph nodes in parallel where it can.
I talk about it here https://devops-pipeline.com/
My problem with bash pipelines is passing data along and referring to previous steps' data. You kind of need to enrich the data that goes along the pipeline.
-
oil
Oils is our upgrade path from bash to a better language and runtime. It's also for Python and JavaScript users who avoid shell!
I've looked into Oil a bit, and I think Andy has the right idea for how to go about updating the legacy scripts. I've written a few local scripts in Oil and it's a definite upgrade from Bash.
If anyone wants to understand Oil a bit better, I found that the best intro is actually the Github wiki: https://github.com/oilshell/oil/wiki