Skip to content

Latest commit

 

History

History
90 lines (67 loc) · 1.85 KB

README.md

File metadata and controls

90 lines (67 loc) · 1.85 KB

tipsy

tipsy is command line interface helps you work with the gin framework

English | 简体中文

Introduction

Tipsy is a command-line tool written in Go for Gin framework projects. Similar to Laravel's artisan, it can initialize a new Gin project and quickly generate various components like entities, repositories, controllers, middlewares, and services.

Installation

go install github.com/YianAndCode/tipsy/cmd/tipsy@latest

Usage

Create a new project

To create a new Gin project:

tipsy create <project-name>

This command will generate a well-structured Gin project with the following directory layout:

.
├── cmd
│   └── api
│       └── bootstrap
└── internal
    ├── config
    ├── contract
    │   ├── constant
    │   │   └── errcode
    │   ├── datatype
    │   └── error
    ├── controller
    │   └── user
    ├── data
    ├── entity
    ├── log
    ├── middleware
    │   └── auth
    ├── repo
    │   └── user
    ├── router
    ├── server
    └── service
        └── user

Generate components

Tipsy provides several commands to generate different components:

  1. Create a new entity:
tipsy new entity <entity-name>
  1. Create a new repo:
tipsy new repo <repo-name>
  1. Create a new controller:
tipsy new controller <controller-name>
  1. Create a new middleware:
tipsy new middleware <middleware-name>
  1. Create a new service:
tipsy new service <service-name>

Each command will generate the corresponding Go source files with proper structure and basic implementations.

License

This project is licensed under the MIT License - see the LICENSE file for details.