awesome cli.

Databases & storage

Dolt for coding agents

SQL data with Git-like branches, commits, row diffs, merges, and rollback.

Open the official project ↗

This article follows the official documentation. We haven’t tested this tool for a hands-on review.

A coding agent that needs to inspect or update data organized in tables and rows can use Dolt as a local SQL database with Git-like version history. Dolt versions tables and rows, so an agent can review data changes before committing them. It can also create a branch, a separate line of database work, or merge changes when people need to collaborate. The commands run against a local database unless the agent explicitly connects to a remote service.

Dolt fits tasks such as updating a catalog, test fixture, or agent memory stored as rows. It does not version source files or unstructured documents. The example below creates a small local inventory, records a baseline, and shows how an agent previews a later change before saving it in history. Dolt’s official repository describes its Git-like database features.

Install and initialize Dolt

Install Dolt using the operating-system instructions in the installation guide. On macOS, Dolt is available through Homebrew with brew install dolt. Then set the name and email that Dolt writes into commits. Dolt’s README asks for this before you start, and dolt init takes both values from the global config when it creates the first commit. Configure the identity in the local environment, and keep it out of the agent prompt.

dolt config --global --add user.email [email protected]
dolt config --global --add user.name "Your Name"

Open a shell in a new directory for the database. Running dolt init creates a local Dolt repository in that directory, where Dolt stores the database and its history. It does not require a DoltHub account.

mkdir agent-inventory
cd agent-inventory
dolt init

Dolt accepts SQL through its command-line interface, so a separate database server is not required for this local example. The commands below create a table and add one row in the local database.

dolt sql -q "CREATE TABLE inventory (id INT PRIMARY KEY, item VARCHAR(100), quantity INT);"
dolt sql -q "INSERT INTO inventory VALUES (1, 'adapter', NULL);"

Before an agent changes the data, save this starting point as a commit. A commit is a named snapshot in the database’s history. Dolt uses dolt add to stage table changes and dolt commit to record them.

dolt add .
dolt commit -m "Add sample inventory"

Preview a row change

Suppose an agent is asked to change the adapter’s recorded name. It can run an SQL update and inspect the resulting row difference with dolt diff.

dolt sql -q "UPDATE inventory SET item = 'USB-C adapter' WHERE id = 1;"
dolt diff

The SQL update changes the local data. According to the CLI reference, dolt diff without a commit argument shows working changes that are not staged yet. Right after a commit, those are the changes since that commit. The diff shows which table rows changed, including their old and new values. The command is a review step; it does not create a commit or publish data to a remote service. The reference also documents dolt diff -r json for JSON output, which is easier for an agent to read than a table. The agent should read the diff rather than assume the update affected only the intended row.

Only after reviewing the diff should the agent stage and commit the change:

dolt add inventory
dolt commit -m "Rename adapter"

Staging selects the table changes for the next commit. Committing records them in local history. If the agent should only inspect data, it can run a query such as dolt sql -q "SELECT * FROM inventory;" and omit the update, staging, and commit commands.

“In the local Dolt database, change the adapter’s recorded name to USB-C adapter. Show the row change with dolt diff and stop before staging or committing.” A person can then decide whether to save the change.

Keep local and remote work separate

The example uses only local commands. DoltHub provides hosting and sharing for Dolt databases, but pushing data to a remote database is a separate action. Dolt’s documentation describes dolt login for authenticating with DoltHub; keep any account credentials out of prompts and provide them through the operator’s approved environment instead. A local dolt init, SQL query, or diff does not itself authenticate or contact DoltHub.

Dolt works with tabular data, such as inventory rows or structured agent memory. It does not provide Git-style history for arbitrary files, and a database is not a good fit for every agent’s memory or project data. Choose it when an agent needs SQL queries and reviewable row-level history. For workloads where query speed is central, test with representative data before adopting it. Dolt publishes its own latency benchmarks, which compare Dolt with MySQL on standard sysbench tests.

Tool details come from awesome-ai-cli.