Skip to content

Modified/lev

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SYNOPSIS

Complete LevelDB management for your terminal.

FEATURES

  • A Terminal User Interface
  • REPL with colorized auto-complete and key suggestions
  • REPL automatically saves and reloads REPL history
  • Scriptable from the command line
  • Connect to local or network enabled instances

INSTALLATION

$npm install lev -g

TUI

This is the mode entered when you type lev with no arguments. I recommend a modern terminal program like iTerm2 on OSX or [urxvt] on Linux.

On the left you have a list of keys, on the right you have the selected value. You can edit the selected value by clicking on it. Save the modified value by pressing control+s.

img

img

img

CLI

The CLI mode is useful for bash scripting. Here's an example where we get the first 10 keys in the database.

$ lev path/to/db --keys --limit 10

Get the first ten records starting at bazz and ending at zomg.

$ lev path/to/db --limit 10 --start 'bazz' --end 'zomg'

Get the key welcome from inside the 2 sublevels deep

lev ./db --cd greetings/en --get 'welcome'

For connecting to a multilevel enabled instance, specify the port and manifest parameters...

lev --manifest path/to/manifest.json -a 127.0.0.1:1337 --keys ...

REPL

Provide just a path and no flags to start the REPL.

$lev path/to/db

ls List the keys in the current range.

img

start [string]

Sets the start of the current range. When createReadStream() is created on the current sublevel (or root) it will use this value as a parameter.

end [string]

Sets the lower bound of the current range

limit [number]

Limits the number of results in the current range

reverse

Reverse the results in the current range

get [string]

Get a value from the current range

cd [string]

Set the current sublevel

Supports cd .. to navigate down a level. cd / to navigate to the root of the database. And supports paths cd foo/bar/bazz.

USER SETTINGS

A .lev file will be created in your home directory. You can manage this with the TUI or by hand.

{
  "query": {
    "start": "",
    "end": "",
    "reverse": false,
    "limit": 1000
  },
  "key": null,
  "connections": {
    "Default":{
      "path":"",
      "keyEncoding":"utf8",
      "valueEncoding":"json",
      "local":true,
      "compression":true,
      "cacheSize":8388608
    }
  }
}

License

MIT

About

The complete REPL, CLI & Terminal User Interface for LevelDB

Resources

License

Stars

Watchers

Forks

Packages

No packages published