LiteCLI - SQLite Client with Autocomplete
Written by Nikos Vaggalis   
Tuesday, 22 January 2019

LiteCLI is a new open source command line client with many good features. Built in Python it is hosted on GitHub.

There are quite a few SQLite GUI clients, such as DB Browser and Sqliteman, but not that many command line/terminal ones.
Despite being command line, the new offering, LiteCLI, is feature rich, including:

  • auto-completion when writing commands and SQL queries
  • auto-suggestion of tables having read the database schema
  • syntax highlighting 
  • saving and re-running favorite queries
  • table output in various formats
  • key bindings for emacs or vi
  • separate configuration file for persistence.

It all makes for a really smooth experience.

Installing it is just as easy. This is the way I'd suggest if you're on Windows:

Open a powershell session as admin and run:

>Set-ExecutionPolicy Bypass -Scope Process -Force;
         iex ((New-Object System.Net.WebClient).DownloadString(


>choco install python 

For a better terminal experience than the default cmd.exe, install Hyper which is based on Electron:

>choco install hyper

Open hyper and run:

>pip install -U litecli 

To take it for a test run, let's copy the places.sqlite database, where Firefox keeps the user's bookmarks, history etc to a test folder and run:

>litecli places.sqlite

Now inside the client, we can check the schema and work with the tables, say "moz_places", which can even be chosen from the list of the auto suggestions: 


However, because the output of the row exceeds the width of the terminal, it doesn't look that good:

Thankfully LiteCLI has a very nice feature in going vertical :


Auto-suggestion aside, there's also Auto-completion:

And if there's a query that you frequently run, you can even save it as favorite and re-run it by just calling it by its nickname:

Another advantage of LiteCLI is that it's also fully customizable. For example you can change the syntax_style of the key bindings:

# Keybindings: Possible values: emacs, vi.
# Emacs mode: Ctrl-A is home, Ctrl-E is end.
 # All emacs keybindings are available in the REPL.

# When Vi mode is enabled you can use modal
 # editing features offered by Vi in the REPL.

key_bindings = emacs 

the table format output as seen when running SQL queries:

# Table format. Possible values: ascii, double, github,
# psql, plain, simple, grid, fancy_grid, pipe, orgtbl,
 # rst, mediawiki, html,# latex, latex_booktabs,
 # textile, moinmoin, jira, vertical, tsv, csv.

# Recommended: ascii
table_format = ascii

and much more.

I had been on the lookout for a good cli alternative like this for quickly running queries on databases stored inside Android emulators. 

It would had certainly come handy at the time I was doing my Android developer Nanodegree Capstone project. I could have  accessed my custom SQLite database simply as:

adb pull data/data/
       /databases/smadeseek.db & litecli smadeseek.db



Better late than never!

More Information


Related Articles

Insider's Guide to Udacity Android Developer Nanodegree Part 7 - Full Stack Android


To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on Twitter, Facebook or Linkedin.



.NET MAUI VS Code Extension Now Generally Available

Microsoft has announced that .NET MAUI VS Code extension is out of preview, and that it includes long-awaited new features – including XAML IntelliSense and Hot Reload.

Tetris - Still A Winner After 40 Years

Tetris, the classic and addictive puzzle game where you rotate and position falling blocks, has been played by at least a billion people. It was invented 40 years ago and to mark the occasion the BBC  [ ... ]

More News


C book



or email your comment to:

Last Updated ( Tuesday, 22 January 2019 )