Hacker News new | past | comments | ask | show | jobs | submit login
Posh: A Data-Aware Shell (micahlerner.com)
69 points by mlerner on Aug 10, 2021 | hide | past | favorite | 27 comments



A rather unfortunate name, given how Posh is also occasionally used as a shortening of PowerShell. Especially when PowerShell has a very similar shtick going for it.


POSH is also the name if Debian's policy-compliant ordinary shell: https://salsa.debian.org/clint/posh


Welp, isn't that POSIX SH?


Follow the link and see their own description.


PowerShell has way too many abbreviations. It's file extension is ps1. It can also be abbreviated to pwsh. Enough is enough.


I’d agree with you, but at one point the PowerShell for Mac/Linux binaries were actually named “posh”.


And they changed to pwsh to not clash with other binaries already named posh.


it's also a common prefix for powershell-optimized versions of popular cli tools https://www.powershellgallery.com/packages?q=posh


Yep I clicked on this thinking it was going to be something interesting about powershell.....


Absolutely, the project did name it POSH, but using caps to distinguish a name is not recommended as it still causes confusion.

Must admit i haven't looked more into the tool due to this. So that's something to be aware of when naming a project/tool.


I've never heard about Powershell -> Posh.


also clobbers this effort here, too: https://github.com/mikebolt/posh



I spent some time looking at an Octodeploy build/deployment system today, & found that the use of tags on environment variables was really interesting & effective. There would be one deploy process, but with a couple different copies of some environment variables, tagged with the different deployment targets. It made it easy to get an overall look at the many deploys, & see what was tagged where.

> To make decisions about which parts of a script are executed remotely, POSH produces a graph representation of the shell script’s execution - the nodes in the graph are commands, while the edges represent the flow of data between commands. Correctly transforming a shell script into this graph representation is a nuanced, yet critical function. To facilitate it, POSH leverages an annotation language capable of describing a given command’s parameters, inputs, and outputs (as well as a number of important configuration options).

Posh is likewise using annotations to explain to itself what pieces of deployment (of a part of a shell command) may be done on which systems. Unlike the octodeploy I was looking at, where one unified deploy could be instantiated for differently tagged environments, Posh is building pipelines that span multiple systems, and using the system annotations to figure out where to schedule bits of work.

> I wanted to note two important components of the annotation language important to understanding the rest of the paper. First, the annotations can be defined per command and per argument - this flexibility is important because different arguments to a command can change its behavior and arguments. Second, a command’s inputs/outputs can be typed, and its behavior is defined. For example, the annotation language can indicate a command’s parallelizablity or whether the command relies on the current directory. Defining these properties of a command allow the parser and scheduler to answer the three questions above.

Quite enjoying this write-up! Excellent highlight of contributions & core characteristics.


I wish there was an HTML shell, where applications can output not just text, but structured text, tables, even images. Where an application could have an 'easy mode' for uncommon tasks where it just prints a user interface with a few buttons.


This sounds pretty similar to what Powershell does. You can list the contents of the directory which outputs a structured table, then pipe that into Out-GridView for an interactive GUI window.


I had never heard of Out-GridView and it's awesome!


There previously was such a thing from Mozilla called XMLTerm [0].

You could be the one to revive it !

[0] https://www.xml.com/pub/2000/06/07/xmlterm/index.html


Another shell that tries to make use of the idea of structured data is Elvish.

https://elv.sh/

As it's aware of data-types you could likely build even the image feature (when combined with an adequate terminal).


I can see the benefits of structured output from CLI tools. It’s a bit rare to find but they do exist. I believe the closest I have found in the wild is a terminal instance connecting to some 1980s mainframe tech.

There are also some FOSS tools aimed at increasing the readability of CLI tools

https://github.com/charmbracelet/lipgloss

Doesn’t offer tables (yet) but is about as good as it’s going to get.

For “easy mode” apps, isn’t this what GUI apps were made for? The old Java applets and apps using Swing/JavaFX or Qt are the ones that immediately come to mind.


Something like this: https://domterm.org ?


Notebooks like Jupyter sound similar; although they are more persistent, whilst shells are more ephemeral (whether that's a good thing or not!)


Jupyter does that.


DomTerm is maybe the closest thing.


I'm struggling to understand what problem this is meant to solve. I've been working in high scale production environments for 15+ years and I can't think of a situation where I'd mount a network file server and run a local script to parse logs there.

If this is what you want to do there is almost certainly a better solution that involves parsing the logs another way entirely.


My immediate thought was this might help ease a lot of performance issues with Docker on Mac/Windows.


It’s weirdly difficult to find a link to the code in this body of text. Here: https://github.com/deeptir18/posh

No updates in 13 months, FWIW




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: