drp-go-cli

module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 2, 2026 License: MIT

README

DRP — Developer Rapid Productivity

A lightweight, SQL-first CLI for Go backend development. Inspired by Laravel Artisan. Not a framework. Not an ORM. Just a tool that generates plain, idiomatic Go code and gets out of your way.

Why

DRP removes repetitive backend setup work — project scaffolding, migrations, seeders, CRUD boilerplate — without locking your project into a runtime dependency. Code DRP generates never imports a drp runtime package, and there's no third-party ORM or migration library: everything is built on database/sql.

Features

  • Project Scaffolding: drp init sets up a clean, robust standard Go layout.
  • Built-in Auth: Option for built-in JWT authentication and user management (drp init --auth).
  • Migrations: drp migrate creates, runs, and rolls back migrations with zero dependencies.
  • Code Generation: drp create:crud instantly generates models, handlers, repositories, services, and routes.
  • Zero Lock-in: Output is standard Go code using database/sql and standard libraries.

Quickstart

# Install DRP
go install github.com/DarpanAdhikari/drp-go-cli/cmd/drp@latest

# Create a new project
drp init myapp
cd myapp
# edit .env
drp migrate:seed
drp create:crud product
drp run api --watch

See docs/getting-started.md.

Repository Layout

See docs/architecture.md for the full breakdown of cmd/, internal/, templates/, and pkg/.

License

MIT — see LICENSE.

Directories

Path Synopsis
cmd
Package cmd contains all Cobra CLI commands for drp.
Package cmd contains all Cobra CLI commands for drp.
drp command
internal
config
Package config loads and validates the project's .env configuration.
Package config loads and validates the project's .env configuration.
db
Package db handles database connectivity: opening connections, creating the target database if it doesn't exist, and ensuring the schema_history bookkeeping table exists.
Package db handles database connectivity: opening connections, creating the target database if it doesn't exist, and ensuring the schema_history bookkeeping table exists.
db/driver
Package driver defines the Driver interface that every database driver must satisfy, and provides a factory for resolving the correct driver from a config string.
Package driver defines the Driver interface that every database driver must satisfy, and provides a factory for resolving the correct driver from a config string.
doctor
Package doctor implements the environment checks for `drp doctor`.
Package doctor implements the environment checks for `drp doctor`.
generator/embedded
Package embedded holds the fallback copies of every DRP template, embedded into the binary at compile time.
Package embedded holds the fallback copies of every DRP template, embedded into the binary at compile time.
migration
Package migration implements the core migration engine: file discovery, schema_history bookkeeping, and up/down/rollback/fresh execution.
Package migration implements the core migration engine: file discovery, schema_history bookkeeping, and up/down/rollback/fresh execution.
output
Package output provides consistent, symbol-prefixed CLI output used by every command instead of ad-hoc fmt calls.
Package output provides consistent, symbol-prefixed CLI output used by every command instead of ad-hoc fmt calls.
seeder
Package seeder implements the seeder engine: creating seeder files and running them against the database in order.
Package seeder implements the seeder engine: creating seeder files and running them against the database in order.
pkg
mailer
Package mailer provides a simple SMTP mailer for generated projects.
Package mailer provides a simple SMTP mailer for generated projects.
response
Package response provides consistent JSON HTTP response helpers for generated handlers.
Package response provides consistent JSON HTTP response helpers for generated handlers.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL