Skip to main content

Interactive Shell

Wvlet Shell (wv command) launches an interactive query editor for the console. In the shell, you can write SQL queries, run them, and see the results interactively.

wvlet shell

Commands

By typing help in the shell, you can see the list of available commands:

$ wv 
wv> help
[commands]
help : Show this help message
quit/exit : Exit the REPL
clear : Clear the screen
clip : Clip the last query and result to the clipboard
clip-result: Clip the last result to the clipboard in TSV format
rows : Set the maximum number of query result rows to display (default: 40)
col-width : Set the maximum column width to display (default: 150)
git : Run a git command in the shell
gh : Run a GitHub command in the shell

Shortcut Keys

Wvlet shell basically uses GNU readline-style shortcut keys. Here is the list of shortcut keys that are most frequently used in the shell:

KeysDescription
ctrl-aHome: Move to the beginning of the line
ctrl-eEnd: Move to the end of the line
ctrl-j aMove to the beginning of the query
ctrl-j eMove to the end of the query
ctrl-pUp
ctrl-nDown
ctrl-fRight
ctrl-bLeft
ctrl-rSearch the history. Type ctrl+r again to continue to search the previous history
ctrl-kDelete until the end of line from the cursor position

Running Queries

KeysDescription
ctrl-j ctrl-rRun the whole query
ctrl-j ctrl-tTest run the query fragment up to the line with debug mode
ctrl-j ctrl-dDescribe the schema of the current line of the query fragment
ctrl-cCancel the current query, or exit the shell