Command line MySQL client with auto-completion, syntax highlighting, and smart context-sensitive suggestions
mycli is a MySQL command line client that replaces the standard mysql client with enhanced interactive features. Built using Python Prompt Toolkit, it provides auto-completion for SQL keywords, table names, views, and column names as the user types. The tool includes context-sensitive smart completion that suggests only relevant options based on query context - for example, showing only table names after SELECT * FROM or only column names in WHERE clauses.
The client offers syntax highlighting through Pygments, fuzzy history search integration with fzf, and support for multiline queries. Users can save favorite queries with positional parameters using \fs <alias> <query> and execute them with \f <alias>. Additional features include query timing, optional logging of all queries and results to files, and shell-style output redirection with $>, $>>, and $| operators.
mycli supports SSL connections, password storage in the system keyring, and includes experimental support for querying LLMs with schema context. The tool creates a configuration file at ~/.myclirc on first run, allowing users to customize behavior, colors, and feature settings. It requires Python 3.10 or later and is tested on macOS and Linux, with Windows support available through WSL.
# via Homebrew
brew update && brew install mycli
# via pip
pip install -U 'mycli[all]'
# via apt
sudo apt-get install mycli

