
Pigshell: Shell for the web - fbrusch
http://pigshell.com/
======
devnonymous
Older thread -
[https://news.ycombinator.com/item?id=8438515](https://news.ycombinator.com/item?id=8438515)

One interesting feature is the ability to ^mount^ a local directory into the
shell, so that one can do something like:

    
    
      $ cp -r /gdrive/username@gmail.com/ /home/

~~~
desireco42
No way ! That is awesome.

------
fiatjaf
The problem is that it is very difficult to understand the documentation, it
is very difficult to develop plugins (like Google Drive) and extend the
functionalities, it is very difficult to run the local server in a VPS,
customization (dotfiles) is also complicated and undocumented.

~~~
tubelite
I agree. Mea culpa.

I am still active on the project and I am working to address the issues you
mention, though progress has been slower than I could wish.

------
andyidsinga
The example of grabbing a page and feeding it into d3 is whizbang! (
[https://github.com/pigshell/pigshell#hello-
world](https://github.com/pigshell/pigshell#hello-world) )

I tried to cat this hn page, but also got the CORS error -- trying to route
through [h]ttp://localhost:50937/...

need to run psty for proxying certain things and local access ...so its not
"pure client-side Javascript app running in the browser"

pretty cool nonetheless -- maybe psty could be baked into a chrome or FF
extention (?)

~~~
tubelite
Try

ycat [https://news.ycombinator.com](https://news.ycombinator.com) | hgrep
.athing | html

ycat uses YQL to bypass CORS.

There are a few interesting workflows which can be done completely in the
browser without a proxy: e.g. copying files from one Google Drive account to
another, backing up Google Drive to Dropbox, and so on.

------
mrdrozdov
Would like every url to be a directory, and for that site to have its data
nested within that url.

~~~
markbnj
I suspect this works essentially like that, if you have the psty proxy
companion program running so pigshell can get around COR restrictions.

------
P4bTXfOZAZicOOw
Could we do the same thing with FUSE filesystems?

~~~
charlesL
Exactly what I was thinking. That would make all linux utils available to use
as well.

------
aembleton
Just tried to grep BBC News site but got a `cross-origin request denied`
error. In the man page for hgrep, it suggests hgrep on a wikipedia page, and I
got the same error.

The error in full: Cross-origin request denied (check if psty is running):
[http://en.wikipedia.org/wiki/List_of_countries_and_dependenc...](http://en.wikipedia.org/wiki/List_of_countries_and_dependencies_by_population)

I don't know how to check if psty is running. Anyone got any ideas?

~~~
tubelite
Since most websites are not CORS-friendly, you need to run the psty proxy on
your desktop.

python psty.py -a

For further information on psty, and a download link, see:
[http://pigshell.com/v/0.6.4/usr/doc/psty.html](http://pigshell.com/v/0.6.4/usr/doc/psty.html)

Alternately, if you don't want to run psty, you could try the "ycat" command
which uses YQL to bypass CORS. This is useful if you are trying to access HTML
pages, rather than binary resources. e.g.

ycat
[http://en.wikipedia.org/wiki/List_of_countries_and_dependenc...](http://en.wikipedia.org/wiki/List_of_countries_and_dependencies_by_population)
| hgrep table.wikitable | html

You may have to try it a couple of times; I notice that the YQL endpoint
sometimes refuses connections.

------
techdragon
Honestly one of the most interesting "web shells" I've looked at. But not
something I can use regularly since most of my workflow is local for
developing software.

------
Yahivin
I wish it would at least try to do a real CORS request before giving up and
forcing you to use the proxy. I have a CloudFront distribution with CORS all
set up but it doesn't even try to make the request.

~~~
tubelite
Please see
[https://github.com/pigshell/pigshell/issues/15](https://github.com/pigshell/pigshell/issues/15)
for a workaround.

Since most sites are non-CORS, trying CORS and then falling back to proxy
would impose too much of an overhead for the common case.

------
astazangasta
I don't understand why this runs in the browser. Surely this is all stuff you
can do in a local shell? What am I missing?

------
eccstartup
It seems that buying a domain name is so expensive. Why pig?

~~~
kseistrup
PIG Isn't GNU

