All Projects → millette → dat-shell

millette / dat-shell

Licence: other
Dat shell. Open a remote dat and explore with cd, ls, etc.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to dat-shell

hyperhealth
Monitor the health of a hyperfeed (hypercore or hyperdrive), including peer count and peer mirror percentages.
Stars: ✭ 38 (-38.71%)
Mutual labels:  hyperdrive, dat
dat-log
Log History of Dat [ DEPRECATED - More info on active projects and modules at https://dat-ecosystem.org/ ]
Stars: ✭ 12 (-80.65%)
Mutual labels:  dat
Beaker
An experimental peer-to-peer Web browser
Stars: ✭ 6,411 (+10240.32%)
Mutual labels:  hyperdrive
hyper-content-db
A Kappa-style peer-to-peer content database, on top of hyperdrives.
Stars: ✭ 34 (-45.16%)
Mutual labels:  hyperdrive
dat-wot
[WIP] A decentralized public key network with encryption utilities for data collaboration
Stars: ✭ 52 (-16.13%)
Mutual labels:  dat
ACViewer
Viewer / Utility for DAT files for the game Asheron's Call
Stars: ✭ 19 (-69.35%)
Mutual labels:  dat
Datbase
[DEPRECATED] Open data sharing powered by Dat
Stars: ✭ 251 (+304.84%)
Mutual labels:  dat
how-dat-works
Dat documentation [ DEPRECATED - see https://github.com/hypercore-protocol/new-website/tree/master/guides for similar functionality. More info on active projects and modules at https://dat-ecosystem.org/ ]
Stars: ✭ 169 (+172.58%)
Mutual labels:  dat
Blender2NieR
Import/Export WMB/WTP/WTA/DAT/DTT/LAY/COL files for NieR:Automata
Stars: ✭ 115 (+85.48%)
Mutual labels:  dat
frostpunk mod
Frostpunk / Mod Tools / 非公式日本語化MODツール
Stars: ✭ 17 (-72.58%)
Mutual labels:  dat
olaf
A P2P chat using Dat.
Stars: ✭ 24 (-61.29%)
Mutual labels:  dat
dat-storage
Dat specific storage provider for Hyperdrive [ DEPRECATED - More info on active projects and modules at https://dat-ecosystem.org/ ]
Stars: ✭ 36 (-41.94%)
Mutual labels:  dat
dat-utils
Utility functions for Beaker Browser's DatArchive API
Stars: ✭ 13 (-79.03%)
Mutual labels:  dat
pauls-dat-api
Library of functions that make working with dat / hyperdrive easier.
Stars: ✭ 44 (-29.03%)
Mutual labels:  dat
dat-desktop
Peer to peer data syncronization [ DEPRECATED - More info on active projects and modules at https://dat-ecosystem.org/ ]
Stars: ✭ 646 (+941.94%)
Mutual labels:  dat
permanent-seeder
A super seeder for hyperdrives. By GEUT.
Stars: ✭ 22 (-64.52%)
Mutual labels:  hyperdrive
caracara
GEUT LABS. An experimental Dat based collaborative editor.
Stars: ✭ 33 (-46.77%)
Mutual labels:  dat
dat-workshop
How to build web apps using Dat. A workshop by GEUT.
Stars: ✭ 50 (-19.35%)
Mutual labels:  dat
solo
The simplest publication tool
Stars: ✭ 34 (-45.16%)
Mutual labels:  dat
hyperdrive-ln
create symbolic link between hyperdrives
Stars: ✭ 13 (-79.03%)
Mutual labels:  hyperdrive

dat-shell

Standard JS npm Build Status Coverage Status Dependency Status

Dat shell. Open a remote dat and explore with cd, ls, etc.

DEPRECATED

Note that dat-shell hasn't been updated in a few years. Hoping to get back to it in 2020.

dat-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.

dat-shell screencast

Install

$ npm install --global dat-shell

Requirements

You'll need node 8.9.1 (LTS) or above. I suggest using n-install to install the n node version manager.

You'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 to help merge my glob fork.

Usage

$ dat-shell <dat-key> # dat-key is optionnal

For example, you can access this readme and scripts at: dat://ae8c136e04a66451c79325681d4593bc3ce30c8005dfa5fc6001e0898ec4573a

$ dat-shell dat://ae8c136e04a66451c79325681d4593bc3ce30c8005dfa5fc6001e0898ec4573a
# or
$ dat-shell ae8c136e04a66451c79325681d4593bc3ce30c8005dfa5fc6001e0898ec4573a
# or
$ dat-shell dat://dat-shell-millette.hashbase.io/

You might wonder about dat://dat-shell-millette.hashbase.io/ but it's perfectly valid since the hostname maps to the ae8c...573a key through https discovery.

Commands

  • help: List of commands and their descriptions.
  • .help: Internal repl commands.
  • ln: Pseudo symbolic link (mkfifo).
  • cp: Copy a file from remote dat to local filesystem.
  • cat: View a file (concatenate).
  • ls: List files.
  • file: Detect mimetype.
  • view: Generic view command (text, markdown, html, etc.).
  • sl: Train yourself to avoid typos.
  • cd: Change directory.
  • pwd: Output current working directory.
  • dat: dat -c to close; dat to open; dat to output current key.
  • state: Output current state.
  • version: Current dat-shell version.
  • exit or quit: Exit dat-shell (or CTRL-D).

ln

ln 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.

For instance, inside dat-shell, you can do:

ln readme.md ~/tmp-readme.md # ~/tmp-readme.md will be overwritten with our temporary fifo

And in another terminal (bash, etc.):

cat ~/tmp-readme.md # or tail, cp, etc.

You can't currently ln a video file and play it with vlc or mplayer unfortunately.

Upgrading

The cli now uses update-notifier to let the user know about updates to this program.

Users have the ability to opt-out of the update notifier by changing the optOut property to true in ~/.config/configstore/update-notifier-dat-shell.json. The path is available in notifier.config.path.

Users can also opt-out by setting the environment variable NO_UPDATE_NOTIFIER with any value or by using the --no-update-notifier flag on a per run basis.

To upgrade, simply

$ npm install --global dat-shell

Contribute

Needless to say, I'm 100% open to contributions. Unit tests are coming soon, but for now make sure to follow the StandardJS coding style (no semi-colons, etc). Run either yarn lint or npm run lint to verify.

TODO

There's lots to do, classified here in bugs and features.

I should probably move most of the items below to GitHub issues and establish a roadmap.

Merge glob

There's an issue on glob to allow other fs implementations. This allows glob to work on dat archives (and the hyperdrive beneath).

Bugs

Features

  • issue#7 Add file autocompletion
  • issue#8 Add text browser mode (à la lynx)
  • issue#9 Enable usage as: dat-shell KEY ls (non-interactive)
  • issue#10 Browse versions (history)
  • issue#12 Add status bar (show when files are updated, version, etc.)
  • issue#13 Unit tests, travis, coveralls
  • issue#14 Enumerate hosts
  • issue#15 Improve args quoting (à la bash)
  • Add more command
  • Add tail command
  • Add tree command
  • Improve ls handling (arguments, long version, etc.)
  • Colors
  • Make all commands async (promises)
  • Improve user responses
  • Make prompt configurable (à la bash)
  • Make statusbar configurable
  • Gemnasium badge
  • Support plugins
  • Add debugging options and output
  • Evaluate shelljs for integration
  • Evaluate cash for integration
  • Evaluate vorpal for integration
  • Evaluate nsh for integration
  • Evaluate coreutils for integration
  • Evaluate bashful for integration
  • Add bookmark support (compatible with beaker, hopefully)
  • Make sure it works cross-platform (posix, windows)
  • Package self-contained binary with pkg
  • "Implement" standard-readme

Optimizations (speed or size)

  • Replace marked-terminal and update-notifier with smaller equivalents

Ideas from #dat on freenode (IRC)

  • creationix: would be cool to have the ability to run scripts in dat-shell
  • creationix: pluggable vms for running scripts, scripts could list dependencies via dat urls, maybe even load native vm code from dats
  • scriptjs: Would be nice if the licence for dat-shell was aligned with the dat ecosystem MIT please

Related projects

Maybe related

See features above.

License

AGPL-v3 © 2017 Robin Millette

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].