migrate CLI

migrate CLI applies versioned database changes in order, with a chosen step count or target schema version for each run.

  • 19,007 ★ on the repository
  • Last commit
CLI

Extended access

Why this level

  • The CLI executes prepared migrations with database connection privileges, affecting schema and data.
All reasons and checks

golang-migrate/migrate

Install

Manual install

curl -L https://github.com/golang-migrate/migrate/releases/download/$version/migrate.$os-$arch.tar.gz | tar xvz

First CLI README method. Set version, os and arch to match the selected release archive; the command downloads and extracts it.

Access and checks

How we review

Extended accessThe tool runs code or makes network calls and only reads external data.

  • The CLI executes prepared migrations with database connection privileges, affecting schema and data.

This is third-party code. Review the repository files before installing.

What it does

migrate CLI reads migration files and applies them sequentially to a selected database. Separate forward and reverse files define each change. Users can apply a step count or move to a target schema version. Drivers support multiple databases and local or remote migration sources. The CLI wraps the Go library and passes prepared instructions to the driver. Ctrl-C requests a stop at a safe point.

Who it is for. Backend teams storing schema changes beside application code and applying them by version.

Good fit when

  • An application release needs a repeatable sequence of schema changes.
  • A test database should receive only a few migration steps.
  • A release needs the current database version checked against a target.
  • Migration files come from one agreed local or remote source.

Not a fit when

  • You expect SQL to be generated automatically from application changes.
  • A reverse operation must restore deleted data without a prepared migration.
  • The target production database is unclear from the connection settings.

Example request

Check the test database version and prepare a plan for the next two migrations. Show the SQL before execution.

Limitations

Prepared migrations and the correct database driver are required; the CLI does not repair invalid instructions. Connection strings use URL syntax, so reserved characters in their components need encoding. A Go-built binary’s database and source support depends on its build tags. Forcing a version number does not execute SQL or repair a failed migration’s effects, so inspect database state separately before using it.

How to disable. Request a graceful stop with Ctrl-C and wait for the current step. Uninstalling the CLI does not undo database changes.

FAQ

How do I choose a binary release?

Choose a release archive for your operating system and architecture, then set `$version`, `$os` and `$arch` in the download template to match it.

Can I apply only a few changes?

Yes. Supply a step count after `up` and inspect file order and the current version first.

What does force do?

It sets the stored version without running a migration. Inspect actual schema state before using it.

How does rollback work?

It runs the corresponding down files. Review them first; their existence does not guarantee recovery of deleted data.

Can I stop it?

Yes. Ctrl-C requests a graceful stop. Wait for completion, then check the database version.

Discussion

No questions or reviews yet.

CLI tools

The CLI selects and changes JSON, YAML and other structured values so agents can transform data with one query language.

CLIExtended access8.1KRepository stars

The Go CLI reads and edits YAML, JSON and related formats for targeted agent-assisted configuration transformations.

CLIExtended access16.2KRepository stars

Busabase CLI backs up a shared workspace; restoring the archive requires an empty destination prepared by the user.

CLIBroad access714Repository stars

The CLI imports CSV and JSON into SQLite, runs SQL and reshapes tables for agent-assisted local data preparation.

CLIExtended access2.2KRepository stars

The SQL client combines terminal database browsing with batch queries for agents using named connections and JSON results.

CLIExtended access5KRepository stars

vi-sql is a terminal SQL client with a built-in MCP server: the agent sees the schema and drafts queries straight in your editor

MCP serverExtended access212Repository stars

README in short

The create command prepares file pairs with sequential numbers or timestamps. The CLI does not search hidden configuration paths.

README badge

Report a problem

Foxx AImigrate CLI
Foxx AI

I am Foxx AI and I have already vetted this tool. Ask about install, setup or anything else, and I will keep it simple.