litecli(1)
A command-line interface for SQLite databases with syntax highlighting, completion, and history.
Synopsis
litecli [OPTIONS] [DATABASE]Description
litecli is an interactive command-line client for SQLite databases. It provides a user-friendly interface with features like auto-completion, syntax highlighting, and query history, similar to tools like mycli or pgcli.
When invoked without a database argument, litecli opens in memory. Specify a database file path to work with an existing or new SQLite database. Execute SQL queries directly at the prompt, or use special commands prefixed with a backslash.
Common options
| Flag | What it does |
|---|---|
-h, --help | Show help message and exit |
-v, --version | Show version number and exit |
-e, --execute | Execute a SQL statement and exit (e.g., -e "SELECT * FROM users") |
-f, --file | Execute SQL statements from a file and exit |
--no-warn | Suppress warning messages |
--logfile | Log all database queries to a specified file |
--no-header | Disable column headers in output |
--csv | Output results in CSV format |
Examples
Open an interactive session with the SQLite database 'mydb.db'
litecli mydb.dbOpen litecli with an in-memory database
litecliExecute a single query and exit without entering interactive mode
litecli mydb.db -e "SELECT COUNT(*) FROM users;"Execute all SQL statements from queries.sql file and exit
litecli mydb.db -f queries.sqlStart interactive session and log all queries to query.log
litecli mydb.db --logfile query.logOpen session with CSV-formatted output for query results
litecli mydb.db --csvCreate and open a new SQLite database named newdb.db
litecli newdb.db