gorun CLI
Written by Rohman Beny Riyanto
Who this page is for
This is a tool for people running this backend project itself (setting up a local database, applying migrations, seeding data) - not something an API consumer needs to touch to call the endpoints. Skip it unless you're setting up or operating this project's own environment.
gorun is github.com/RohmanBenyRiyanto/gorun - a published, standalone CLI toolkit for provisioning a database, applying schema changes ("migrations"), and populating baseline data ("seeders") for a Go project. This project uses it for exactly that during local setup and deployment. Full command/flag reference lives in its own docs:
- docs/commands.md - every command group and subcommand
- docs/configuration.md -
Configfields, engine/database resolution - docs/seeders.md - the
Seeder/SeederRegistryinterfaces,RunnerPathdelegation
Two ways to invoke it, from the repo root:
bash
go run ./cmd/gorun-runner <command> # always up to date, no install needed
gorun <command> # after installing gorun globally + .gorun/config.yaml is set upExample, fully non-interactive:
bash
gorun migrate run --engine mysql --database videotron_v2_dev --forceGotchas
db truncatevstable truncate-db truncate --name Xwipes every table in databaseX,table truncate --name Y --database Xwipes one table. Don't reach for the wrong one.- Schema changes only happen through migration files - there's a config setting for automatic schema syncing, but it isn't actually wired up; it's not a real path for changing the database schema. The versioned SQL migration files, applied via
gorun migrate, are the only way schema changes actually happen. seed run --forceandmigrate run --forcemean different things - migrate's--forceskips the "run these pending migrations?" confirmation; seed's--forceis specifically the guard against accidentally reseeding production. Neither implies the other.