{"id":13540974,"url":"https://github.com/millette/dat-shell","last_synced_at":"2025-04-02T08:30:55.618Z","repository":{"id":151340952,"uuid":"113192542","full_name":"millette/dat-shell","owner":"millette","description":"Dat shell. Open a remote dat and explore with cd, ls, etc.","archived":true,"fork":false,"pushed_at":"2020-04-22T11:29:51.000Z","size":322,"stargazers_count":62,"open_issues_count":16,"forks_count":13,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-11-03T06:33:04.515Z","etag":null,"topics":["cli","dat","hyperdrive","shell"],"latest_commit_sha":null,"homepage":"https://dat-shell-millette.hashbase.io/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/millette.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-12-05T14:29:36.000Z","updated_at":"2023-09-08T17:33:35.000Z","dependencies_parsed_at":null,"dependency_job_id":"3650d999-b53f-4ef8-8c90-8baf2a1075f3","html_url":"https://github.com/millette/dat-shell","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/millette%2Fdat-shell","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/millette%2Fdat-shell/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/millette%2Fdat-shell/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/millette%2Fdat-shell/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/millette","download_url":"https://codeload.github.com/millette/dat-shell/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246781906,"owners_count":20832931,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","dat","hyperdrive","shell"],"created_at":"2024-08-01T10:00:36.850Z","updated_at":"2025-04-02T08:30:55.611Z","avatar_url":"https://github.com/millette.png","language":"JavaScript","readme":"# dat-shell\n[![Standard JS](https://img.shields.io/badge/code_style-standard-brightgreen.svg)][standardjs]\n[![npm](https://img.shields.io/npm/v/dat-shell.svg)](https://www.npmjs.com/package/dat-shell)\n[![Build Status](https://travis-ci.org/millette/dat-shell.svg?branch=master)](https://travis-ci.org/millette/dat-shell)\n[![Coverage Status](https://coveralls.io/repos/github/millette/dat-shell/badge.svg?branch=master)](https://coveralls.io/github/millette/dat-shell?branch=master)\n[![Dependency Status](https://gemnasium.com/badges/github.com/millette/dat-shell.svg)](https://gemnasium.com/github.com/millette/dat-shell)\n\u003e Dat shell. Open a remote dat and explore with cd, ls, etc.\n\n## DEPRECATED\n\nNote that `dat-shell` hasn't been updated in a few years. Hoping to get back to it in 2020.\n\ndat-shell is part of the [dat][] Peer-to-Peer universe. It's useful to explore remote dats by their key without having to download them. Think of it as bash for dats, letting you ```cd```, ```ls``` and ```cp``` at will.\n\n![dat-shell screencast][screencast]\n\n## Install\n```sh\n$ npm install --global dat-shell\n```\n\n### Requirements\nYou'll need node 8.9.1 (LTS) or above. I suggest using [n-install] to install the ```n``` node version manager.\n\nYou'll probably need ```git``` too since we're using my (temporary) fork of glob to support hyperdrives (dat archives), and that fork is only available on github and not (yet) on npm. See [below][merge-glob] to help merge my glob fork.\n\n## Usage\n```sh\n$ dat-shell \u003cdat-key\u003e # dat-key is optionnal\n```\n\nFor example, you can access this readme and scripts at: \u003cdat://ae8c136e04a66451c79325681d4593bc3ce30c8005dfa5fc6001e0898ec4573a\u003e\n\n```sh\n$ dat-shell dat://ae8c136e04a66451c79325681d4593bc3ce30c8005dfa5fc6001e0898ec4573a\n# or\n$ dat-shell ae8c136e04a66451c79325681d4593bc3ce30c8005dfa5fc6001e0898ec4573a\n# or\n$ dat-shell dat://dat-shell-millette.hashbase.io/\n```\n\nYou might wonder about \u003cdat://dat-shell-millette.hashbase.io/\u003e but it's perfectly valid since the hostname maps to the ```ae8c...573a``` key through https discovery.\n\n### Commands\n* help: List of commands and their descriptions.\n* .help: Internal repl commands.\n* ln: Pseudo symbolic link (mkfifo).\n* cp: Copy a file from remote dat to local filesystem.\n* cat: View a file (concatenate).\n* ls: List files.\n* file: Detect mimetype.\n* view: Generic view command (text, markdown, html, etc.).\n* sl: Train yourself to avoid typos.\n* cd: Change directory.\n* pwd: Output current working directory.\n* dat: dat -c to close; dat \u003cKEY\u003e to open; dat to output current key.\n* state: Output current state.\n* version: Current dat-shell version.\n* exit or quit: Exit dat-shell (or CTRL-D).\n\n#### ln\nln is a bit weird, not sure how useful it's going to be. As it's currently implemented, ln creates a fifo, writes the specified remote file (in dat) to the fifo and waits for the user to read the fifo before closing and removing it.\n\nFor instance, inside dat-shell, you can do:\n\n```\nln readme.md ~/tmp-readme.md # ~/tmp-readme.md will be overwritten with our temporary fifo\n```\n\nAnd in another terminal (bash, etc.):\n```\ncat ~/tmp-readme.md # or tail, cp, etc.\n```\n\nYou can't currently ```ln``` a video file and play it with vlc or mplayer unfortunately.\n\n## Upgrading\nThe cli now uses [update-notifier][] to let the user know about updates to this program.\n\nUsers have the ability to opt-out of the update notifier by changing\nthe optOut property to true in ~/.config/configstore/update-notifier-dat-shell.json.\nThe path is available in notifier.config.path.\n\nUsers can also opt-out by setting the environment variable NO_UPDATE_NOTIFIER\nwith any value or by using the --no-update-notifier flag on a per run basis.\n\nTo upgrade, simply\n```sh\n$ npm install --global dat-shell\n```\n\n## Contribute\nNeedless to say, I'm 100% open to contributions. Unit tests are coming soon, but for now make sure to follow the [StandardJS][standardjs] coding style (no semi-colons, etc). Run either ```yarn lint``` or ```npm run lint``` to verify.\n\n## TODO\nThere's lots to do, classified here in bugs and features.\n\nI should probably move most of the items below to GitHub issues and establish a roadmap.\n\n### Merge glob\nThere's an [issue on glob to allow other fs implementations][glob280]. This allows glob to work on dat archives (and the hyperdrive beneath).\n\n### Bugs\n* [issue#1] Improve error messages\n* [issue#2] Prevent cd into a file (doh)\n* [issue#3] Copy to directory (currently, a destination filename is required)\n* [issue#4] Improve screencast (demo), see \u003chttps://twitter.com/pfrazee/status/938448616854876160\u003e\n* [issue#16] Ctrl-D doesn't always quit\n* [issue#11] ln should work as expected (for mplayer, etc.)\n\n### Features\n* [issue#7] Add file autocompletion\n* [issue#8] Add text browser mode (*à la* lynx)\n* [issue#9] Enable usage as: dat-shell KEY ls (non-interactive)\n* [issue#10] Browse versions (history)\n* [issue#12] Add status bar (show when files are updated, version, etc.)\n* [issue#13] Unit tests, travis, coveralls\n* [issue#14] Enumerate hosts\n* [issue#15] Improve args quoting (*à la* bash)\n* Add more command\n* Add tail command\n* Add tree command\n* Improve ls handling (arguments, long version, etc.)\n* Colors\n* Make all commands async (promises)\n* Improve user responses\n* Make prompt configurable (*à la* bash)\n* Make statusbar configurable\n* Gemnasium badge\n* Support plugins\n* Add debugging options and output\n* Evaluate [shelljs][] for integration\n* Evaluate [cash][] for integration\n* Evaluate [vorpal][] for integration\n* Evaluate [nsh][] for integration\n* Evaluate [coreutils][] for integration\n* Evaluate [bashful][] for integration\n* Add bookmark support (compatible with beaker, hopefully)\n* Make sure it works cross-platform (posix, windows)\n* Package self-contained binary with pkg\n* \"Implement\" [standard-readme][]\n\n### Optimizations (speed or size)\n* Replace marked-terminal and update-notifier with smaller equivalents\n\n### Ideas from #dat on freenode (IRC)\n* creationix: would be cool to have the ability to run scripts in dat-shell\n* creationix: pluggable vms for running scripts, scripts could list dependencies via dat urls, maybe even load native vm code from dats\n* scriptjs: Would be nice if the licence for dat-shell was aligned with the dat ecosystem MIT please\n\n## Related projects\n* [Reimagining the browser as a network OS][] by Paul Frazee\n\n### Maybe related\nSee [features] above.\n\n* [shelljs][]\n* [cash][]\n* [vorpal][]\n* [nsh][]\n* [coreutils][]\n* [bashful][]\n\n## License\nAGPL-v3 © 2017 [Robin Millette][]\n\n[Robin Millette]: \u003chttp://robin.millette.info\u003e\n[update-notifier]: \u003chttps://github.com/yeoman/update-notifier\u003e\n[dat]: \u003chttps://datproject.org/\u003e\n[shelljs]: \u003chttps://github.com/shelljs/shelljs\u003e\n[cash]: \u003chttps://github.com/dthree/cash\u003e\n[vorpal]: \u003chttps://github.com/dthree/vorpal\u003e\n[n-install]: \u003chttps://github.com/mklement0/n-install\u003e\n[glob280]: \u003chttps://github.com/isaacs/node-glob/issues/280#issuecomment-348816454\u003e\n[merge-glob]: \u003c#merge-glob\u003e\n[features]: \u003c#features\u003e\n[standard-readme]: \u003chttps://github.com/RichardLitt/standard-readme\u003e\n[standardjs]: \u003chttps://standardjs.com/\u003e\n[Reimagining the browser as a network OS]: \u003chttps://pfrazee.hashbase.io/blog/reimagining-the-browser-as-a-network-os\u003e\n[mkfifo]: \u003chttps://github.com/avz/node-mkfifo\u003e\n[nsh]: \u003chttps://github.com/piranna/nsh\u003e\n[coreutils]: \u003chttps://github.com/piranna/coreutils.js\u003e\n[bashful]: \u003chttps://github.com/substack/bashful\u003e\n\n[issue#1]: \u003chttps://github.com/millette/dat-shell/issues/1\u003e\n[issue#2]: \u003chttps://github.com/millette/dat-shell/issues/2\u003e\n[issue#3]: \u003chttps://github.com/millette/dat-shell/issues/3\u003e\n[issue#4]: \u003chttps://github.com/millette/dat-shell/issues/4\u003e\n[issue#5]: \u003chttps://github.com/millette/dat-shell/issues/5\u003e\n[issue#6]: \u003chttps://github.com/millette/dat-shell/issues/6\u003e\n[issue#7]: \u003chttps://github.com/millette/dat-shell/issues/7\u003e\n[issue#8]: \u003chttps://github.com/millette/dat-shell/issues/8\u003e\n[issue#9]: \u003chttps://github.com/millette/dat-shell/issues/9\u003e\n[issue#10]: \u003chttps://github.com/millette/dat-shell/issues/10\u003e\n[issue#11]: \u003chttps://github.com/millette/dat-shell/issues/11\u003e\n[issue#12]: \u003chttps://github.com/millette/dat-shell/issues/12\u003e\n[issue#13]: \u003chttps://github.com/millette/dat-shell/issues/13\u003e\n[issue#14]: \u003chttps://github.com/millette/dat-shell/issues/14\u003e\n[issue#15]: \u003chttps://github.com/millette/dat-shell/issues/15\u003e\n[issue#16]: \u003chttps://github.com/millette/dat-shell/issues/16\u003e\n\n[screencast]: output.gif \"dat-shell screencast\"\n","funding_links":[],"categories":["Using Dat"],"sub_categories":["Dat Utilities"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmillette%2Fdat-shell","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmillette%2Fdat-shell","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmillette%2Fdat-shell/lists"}