← The three ways to use DataTug with AI
CLI commands
Commands your agent can run with or without a skill.
An AI coding agent can run any datatug command in a shell. These are the ones worth knowing: each was run on public sample data, and each has real output on datatug.io.
Four things agents ask for.
What each command does, how an agent reads the result, and whether the plugin has a skill for it today.
datatug compareAvailableCompare two databases
Reads the schema and every row of two copies of a database and reports what was added, removed or changed.
Add
--json: one document with a summary, the schema changes and a record of each difference. The exit status is 0 even when the databases differ, so the agent reads the summary to decide.No skill yetRead the page with real output
datatug db copy · datatug db exportAvailableBack up, restore and move tables without date columns
Copies tables between databases, or exports a database to plain files that belong in Git. Compare the result with the source to prove it.
These print progress and errors on stderr and have no
--jsontoday. Finish withdatatug compare --jsonfor a verdict the agent can read. Dates and foreign keys have known limits, listed on the page.No skill yetRead the page with real output
datatug query runAvailableRun a query, get rows back
Runs a query against a database URL and prints the rows as JSON, JSONL, CSV or YAML on stdout. Access policies apply unless they are turned off.
Use
--format jsonand read stdout. The policies that applied are reported on stderr, so the agent sees what was held back.No skill yetRead the page with real output
datatug scan · datatug showAvailableRead a database's structure
Scans a database into a DataTug project, then prints its schemas, tables, columns and primary keys.
datatug show --format jsonprints the same listing as one JSON document; the text form is stable, so two runs can be compared.Scan has a skill; show does notRead the page with real output
What an agent reads from compare.
The JSON from the compare run on datatug.io: two Northwind copies, and in the right one two prices changed, a category added, a shipper deleted and a column added. One shipper is shown below.
The command
datatug compare northwind-sqlite northwind-sqlite \
--project ./datatug-demo-project/demo-project-1 \
--left-environment dev --right-environment dev \
--left-source env:LEFT_DB --right-source env:RIGHT_DB \
--json --details --limit 20 > compare.json
jq -c '.summary, .schemaChanges' compare.json
jq '.relations[] | select(.name == "Shippers")' compare.jsonThe output
{"added":1,"removed":1,"changed":6,"unchanged":3303}
["Regions.Note exists only in right"]
{
"name": "Shippers",
"kind": "relation",
"identity": "primary-key",
"leftRows": 3,
"rightRows": 2,
"counts": {
"added": 0,
"removed": 1,
"changed": 0,
"unchanged": 2
},
"details": [
{
"id": "ShipperID=3",
"status": "removed",
"fields": [
{
"name": "CompanyName",
"before": "Federal Shipping",
"after": null,
"afterAbsent": true
},
{
"name": "Phone",
"before": "(503) 555-9931",
"after": null,
"afterAbsent": true
},
{
"name": "ShipperID",
"before": "3",
"after": null,
"afterAbsent": true
}
]
}
]
}Run with datatug 0.78.0 on 2026-10-15, on public sample data only. Statements about other databases, speed and scale are not made here.
Where the plugin stops. For now.
The plugin has skills for install, init, projects, scan, validate and serve. Compare, copy and export, query run and show have no skill, so an agent runs them in a shell. A skill for each is a follow-up, not something to rely on today.