mycli: A MySQL Terminal Client with Smart Completion and Dataframes
Rich MySQL Terminal Client with AutoCompletion, Syntax Highlighting, and Dataframes
At a glance
- What is it?
- mycli is a Python-based MySQL terminal client that replaces the default mysql shell with context-sensitive auto-completion, syntax highlighting, fuzzy history search, and Polars dataframe output. It connects to MySQL, MariaDB, Percona, TiDB, and Apache Doris.
- Who is it for?
- mycli is the right tool for engineers who run frequent ad-hoc queries against MySQL-compatible databases from a terminal and want completion for table names, column names, and enums without switching to a GUI. The LLM integration, Polars transforms, and fzf-powered history search are additions on top of a solid core.
- Can I use it commercially?
- Yes. BSD-3-Clause is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository received new commits within the last day.
- What is it written in?
- Mainly Python, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on September 30, 2026, and from our analysis. They are not legal advice.
Editorial analysis
What mycli Solves for MySQL Terminal Users
The standard mysql command-line client provides no completion for table names, column names, or SQL keywords beyond basic line editing. mycli replaces it with a prompt that completes context-sensitively: after `SELECT * FROM ` the tab key shows only table names; after `SELECT * FROM users WHERE ` it shows only column names from that table. That specificity means fewer round trips to check schema details in a separate window.
The project targets MySQL, MariaDB, Percona, TiDB, and Apache Doris. These are the databases the README lists as known-compatible. Postgres users are pointed to pgcli, which the README mentions as the equivalent tool from the same dbcli organisation.
Release 2.0.0 introduced breaking changes documented in its changelog. The most recent releases were v2.26.0 on 2026-09-26, v2.25.3 on 2026-09-19, and v2.25.2 on 2026-09-16. The project requires Python 3.11 or later.
Installation and First Connection
The fastest installation is via pip:
pip install --upgrade 'mycli[all]'The `[all]` extra installs optional components. On macOS with Homebrew:
brew update && brew install mycli pygmentsOn Debian or Ubuntu:
apt-get install mycli fzf python3-pygmentsTo try mycli without installing it, the README offers a uv one-liner:
uv tool run 'mycli[all]' --helpOr a Docker image from the GitHub Container Registry:
docker run --pull=always -it ghcr.io/dbcli/mycli:latestThe README notes that the DockerHub images are out of date and the `ghcr.io` image should be preferred.
After connecting to a server, mycli creates `~/.myclirc` on the first run. That file controls completion behaviour, output formatting, colour themes, and other settings. Shell completions can be configured for the current session with:
eval "$(mycli --completions SHELL)"where SHELL is `bash`, `zsh`, or `fish`.
Smart Completion, Syntax Highlighting, and Fuzzy Search
mycli's completion is context-sensitive in a specific way. The README states that `SELECT * FROM ` followed by Tab shows only table names, and `SELECT * FROM users WHERE ` followed by Tab shows only column names. This applies to tables, views, columns, and enums. Completion is driven by PyMySQL querying the information schema in the background.
Syntax highlighting is provided by Pygments, which is listed as an optional dependency. When installed, SQL keywords, string literals, numbers, and comments receive distinct colours in both the input prompt and query output.
Fuzzy history search is built on fzf. The README documents it as an optional dependency for both history search and as an output explorer reachable via the `\x` special command. If fzf is absent, history search still works but without the fuzzy interface.
Favorite Queries, Dataframes, and LLM Integration
mycli has a saved-query feature documented in the README. You save a query with a named alias:
/fs alias <query>and execute it later with named or positional parameters:
/f alias --key=valueThe query is stored in `~/.myclirc` and rendered through Jinja, so you can include template variables.
Polars dataframe output is a newer addition. The README describes `.|` as the transform operator for Polars expressions and `.>` for saving query output to a Parquet file. For exploratory data work this means you can apply Polars transforms, aggregations, and plots directly on query results inside the terminal without leaving the session.
The LLM integration is documented at `mycli.net/llm`. Invoking `/llm` sends a query to a language model with context from your current schema. The pyproject.toml lists `llm` as an optional dependency under the `[llm]` extra. This feature requires a network connection and a configured LLM backend.
The `$>` and `$>>` operators redirect output to files in the shell style. `$|` pipes output to another command.
Platform Support, Integrations, and Limits
The README documents integrations with SSH, Kubernetes, HashiCorp Vault, and HashiCorp Boundary. These allow mycli to connect through SSH tunnels or to databases in Kubernetes clusters via the configured access control tools. The README references them as supported features but provides no configuration examples inline; the documentation site at mycli.net/docs covers them in more detail.
Passwords can be stored in the system keyring rather than in the config file, through the `keyring` library listed in pyproject.toml.
Windows support is noted as limited. The README states that the libraries are Windows-compatible but there are known test suite failures, and this configuration is not supported software. WSL is described as a better option for Windows users. Pull requests to address the shortcomings are described as welcome.
The pyproject.toml specifies Python 3.11 through 3.14 as supported versions. The project was originally funded through Kickstarter.
Limitations
Context-sensitive completion depends on connecting to the database at startup to fetch schema information. On large schemas with hundreds of tables, the initial schema load can slow connection startup. The README does not document a way to disable schema introspection if startup time becomes a problem.
The Polars dataframe feature is an addition on top of the core query experience. The README links to a separate document for transforms and plots, and does not inline examples. Callers who need it will need to read that documentation separately.
The Windows path is explicitly flagged as unsupported. A developer who needs to use mycli natively on Windows rather than through WSL is taking on a configuration that the project does not test or maintain.
mycli does not provide a GUI, a visual schema browser, or an entity-relationship diagram view. Engineers who need those capabilities will need a separate tool.
pgcli as the Postgres Counterpart
The README explicitly points Postgres users to pgcli at `pgcli.com` as the equivalent tool. pgcli is a separate project from the same dbcli organisation and provides the same completion-and-highlighting experience for Postgres. The two projects share a common lineage but are maintained independently, and pgcli supports Postgres-specific SQL syntax and system catalogs that mycli does not.
For teams that run both MySQL and Postgres, using mycli for one and pgcli for the other means two separate configuration files and two separate shell completions, which is a management cost worth noting before adopting either.
Editorial conclusion
mycli is the right tool for engineers who run frequent ad-hoc queries against MySQL-compatible databases from a terminal and want completion for table names, column names, and enums without switching to a GUI. The LLM integration, Polars transforms, and fzf-powered history search are additions on top of a solid core. It is not a replacement for a GUI like TablePlus or DBeaver when you need a visual query builder or an entity-relationship diagram. Before adopting it at an organisation that uses Vault or Kubernetes, test the SSH and Boundary integrations against your specific configuration; the README lists them as supported but gives no troubleshooting guidance for edge cases.
Frequently asked questions
Does mycli work with MariaDB and TiDB?
Yes. The README lists MySQL, MariaDB, Percona, TiDB, and Apache Doris as databases that mycli is known to be compatible with.
Where does mycli store its configuration?
mycli creates `~/.myclirc` on the first run. That file controls completion settings, output format, colour themes, and other options including saved favorite queries.
Does mycli support LLM query assistance?
Yes. The README documents a `/llm` command that sends a query to a language model with schema context. It requires the optional `llm` extra (`pip install 'mycli[all]'`) and a configured LLM backend.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/dbcli-mycli)