egg_cli
A fast and simple command line interface for creating fullstack web applications with the egg framework. egg_cli provides an interactive setup wizard that scaffolds complete Go web applications with modern tooling, database integration, authentication, and frontend build configuration.
What is egg_cli?
egg_cli is a project generator that creates production-ready Go web applications with:
- π REST API with controllers and routes
- ποΈ Database integration with SQLC for type-safe queries
- π Authentication services and middleware
- π³ Docker setup for containerized deployment
- β‘ Frontend build system with RSBuild support
- π Organized project structure following Go best practices
- π οΈ Development tools and configurations
Installation
From Go
go install github.com/adamkali/egg_cli@latest
Build from Source
git clone https://github.com/adamkali/egg_cli.git
cd egg_cli
make build
Quick Start
Creating a New Project
The init command launches an interactive wizard that guides you through setting up your new egg project:
egg_cli init
The wizard will ask you about:
- Project name and description
- Database configuration (PostgreSQL, MySQL, SQLite)
- Authentication setup
- Frontend framework choice (React/Svelte with RSBuild)
- Additional libraries and tools
Using Environment Files
Skip the interactive wizard by providing a pre-configured environment file:
egg_cli init --env production.yaml
Commands
init
Creates a new egg project with the interactive setup wizard.
egg_cli init [flags]
Flags:
--env string: Use an existing environment configuration file
generate
Generates additional configuration files for existing projects. Useful for creating different environment configurations (development, staging, production).
egg_cli generate [flags]
Flags:
--env string: Base configuration file to extend
--name string: Name of the new configuration file
Example:
# Generate a production config based on development settings
egg_cli generate --env development.yaml --name production
Project Structure
egg_cli generates projects with this structure:
my-awesome-app/
βββ main.go # Application entry point
βββ Dockerfile # Container configuration
βββ docker-compose.yml # Multi-service setup
βββ config/
β βββ development.yaml # Environment configuration
βββ internal/
β βββ controllers/ # HTTP request handlers
β βββ models/ # Data models
β βββ services/ # Business logic
β βββ middleware/ # HTTP middleware
βββ migrations/ # Database migrations
βββ queries/ # SQLC database queries
βββ frontend/ # Frontend application (if selected)
βββ src/
βββ rsbuild.config.js
Development
Building
make build
Running Tests
go test ./...
Development Dependencies
- Go 1.21+
- Make (for build automation)
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Run tests:
go test ./...
- Submit a pull request
License
MIT License. See LICENSE for details.
Support