Git for Databases
GFS is an open-source database version control system. Commit, branch, time-travel, and diff your PostgreSQL and MySQL databases. Ships with a built-in MCP server for AI agents.
# Install GFS
curl -fsSL https://gfs.guepard.run/install | bash
# Initialize a new database repository
gfs init --database-provider postgres --database-version 17
# Start working
gfs query "CREATE TABLE users (id SERIAL PRIMARY KEY, name TEXT);"
gfs commit -m "Add users table"
gfs logVersion control your database like you version control code
Commit, branch, checkout, diff. The same workflow you already know. Runs locally with Docker. No cloud account required.
Quick start
From install to first commit in 2 minutes
One curl command to install. One command to init. GFS runs locally via Docker. Your data never leaves your machine. Branch for experiments, rollback mistakes, diff schemas between commits.
# Install GFS
curl -fsSL https://gfs.guepard.run/install | bash
# Initialize a PostgreSQL 17 repository
gfs init --database-provider postgres --database-version 17
# Create a table and insert data
gfs query "CREATE TABLE users (id SERIAL PRIMARY KEY, name TEXT NOT NULL);"
gfs query "INSERT INTO users (name) VALUES ('Alice'), ('Bob');"
# Commit your changes
gfs commit -m "Add users table"
# View history
gfs log
# Branch for a risky migration
gfs checkout -b experiment
gfs query "ALTER TABLE users ADD COLUMN email TEXT;"
gfs commit -m "Add email column"
# Something went wrong? Go back to main
gfs checkout mainCLI Reference
Every command you need
Git-like interface. Zero learning curve.
gfs init
Initialize a new database repository
gfs commit
Snapshot your current database state
gfs log
View full commit history with hashes
gfs checkout
Restore to any previous commit or branch
gfs checkout -b
Create a new branch for isolated work
gfs query
Run SQL or open interactive terminal
gfs schema diff
Diff schemas between any two commits
gfs schema show
Display schema at a specific commit
gfs export
Export data as SQL, custom, or CSV
gfs import
Import from .sql, .dump, or .csv files
gfs providers
List supported database providers & versions
gfs compute
Start, stop, and manage DB compute lifecycle
Git-style revision references
HEADCurrent commitHEAD~1Parent of HEADHEAD~55th ancestormainTip of main branchmain~33 commits before mainabc123...Full 64-char hashFeatures
Everything you'd expect from version control
Branching
Create isolated branches for experimentation without affecting the main database. Work on risky migrations in a branch. Merge or discard when done.
Time Travel
Every commit is a checkpoint. Restore your database to any previous state with gfs checkout HEAD~1. Undo bad migrations in one command.
Safe for AI Agents
Built-in MCP server lets agents commit before risky changes, branch for experiments, and rollback on errors. No shell wrappers. No token waste.
Schema Diffing
Compare schemas between any two commits with gfs schema diff. Catch unintended changes before they reach production. Output as pretty-print or JSON.
Import & Export
Import from .sql, .dump, or .csv files. Export in plain SQL, PostgreSQL binary, or CSV. Move data in and out without bloating your agent's context.
Interactive Query
Run ad-hoc SQL with gfs query "SELECT ..." or drop into an interactive terminal with gfs query. Inspect data at any commit or branch.
AI agents get database superpowers
GFS ships with a native MCP server. Agents can commit, branch, query, and rollback without shell wrappers. Fewer tokens, fewer errors.
claude mcp add gfs -- gfs mcp --path /path/to/your/repo{
"mcpServers": {
"gfs": {
"command": "gfs",
"args": ["mcp", "--path", "/path/to/your/repo"]
}
}
}gfs mcp --path /path/to/your/repoMCP Server Modes
stdio · Default, direct pipehttp · gfs mcp web, HTTP daemonbackground · gfs mcp start/stop# Agent commits before making changes
gfs commit -m "checkpoint before migration"
# Agent branches for safety
gfs checkout -b agent-migration
# Agent runs the migration
gfs query "ALTER TABLE orders ADD COLUMN status TEXT DEFAULT 'pending';"
# Agent verifies the schema
gfs schema diff main agent-migration
# If good → merge. If bad → rollback
gfs checkout main
gfs checkout HEAD~1 # instant rollbackWorks with every MCP-compatible agent
Why GFS
The problem GFS solves
Agents break databases
A bad migration or dropped table destroys your data. GFS makes every change a commit. Rollback to any point with one command.
Branches are free
Create a branch for every experiment. If the agent fails, discard the branch. If it succeeds, merge. Zero risk to your main database.
MCP eliminates token waste
Native MCP tools mean agents don't need shell wrappers or large SQL dumps in context. Direct operations, fewer tokens, fewer errors.