Skip to content
Back to search

nunu

A CLI tool for building Go applications.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/go-nunu--nunu/badge.svg)](/listings/go-nunu--nunu)

HTML

<a href="/listings/go-nunu--nunu"><img src="/api/listings/go-nunu--nunu/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

You can install Nunu with the following command:

go install github.com/go-nunu/nunu@latest

> Tips: If `go install` succeeds but the `nunu` command is not recognized, it is because the environment variable is not configured. You can add the GOBIN directory to the environment variable.

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 226 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. <a href="https://trendshift.io/repositories/9047" target="_blank"><img src="https://trendshift.io/api/badge/repositories/9047" alt="go-nunu%2Fnunu | Trendshift" style="width: 250px; height: 55px;" width="250" height="55"/></a>
  2. # Nunu — A CLI tool for building Go applications.
  3. Nunu is a scaffolding tool for building Go applications. Its name comes from a game character in League of Legends, a little boy riding on the shoulders of a Yeti. Just like Nunu, this project stands on the shoulders of giants, as it is built upon a combination of popular libraries from the Go ecosystem. This combination allows you to quickly build efficient and reliable applications.
  4. 🚀Tips: This project is very complete, so updates will not be very frequent, welcome to use.
  5. - [简体中文介绍](https://github.com/go-nunu/nunu/blob/main/README_zh.md)
  6. - [Português](https://github.com/go-nunu/nunu/blob/main/README_pt.md)
  7. - [日本語](https://github.com/go-nunu/nunu/blob/main/README_jp.md)
  8. ![Nunu](https://github.com/go-nunu/nunu/blob/main/.github/assets/banner.png)
  9. ## Documentation
  10. * [User Guide](https://github.com/go-nunu/nunu/blob/main/docs/en/guide.md)
  11. * [Architecture](https://github.com/go-nunu/nunu/blob/main/docs/en/architecture.md)
  12. * [Getting Started Tutorial](https://github.com/go-nunu/nunu/blob/main/docs/en/tutorial.md)
  13. * [Unit Testing](https://github.com/go-nunu/nunu/blob/main/docs/en/unit_testing.md)
  14. * [MCP Server](https://github.com/go-nunu/nunu-layout-mcp/blob/main/README.md)
  15. * [Monorepo Layout](https://github.com/go-nunu/nunu-layout-monorepo)
  16. ## AI-assisted Development
  17. [Nunu Skills](https://github.com/go-nunu/nunu-skills) provides `build-with-nunu`, an Agent Skill that helps coding agents such as Codex and Claude Code understand Nunu project layouts and implement complete, tested features across handlers, services, repositories, routers, Wire dependency injection, jobs, tasks, and MCP servers.
  18. Install it in your project with:
  19. ```bash
  20. npx skills add go-nunu/nunu-skills --skill build-with-nunu
  21. ```
  22. See the [Nunu Skills repository](https://github.com/go-nunu/nunu-skills) for supported layouts, agent-specific installation options, and example prompts.
  23. ## Features
  24. - **Gin**: https://github.com/gin-gonic/gin
  25. - **Gorm**: https://github.com/go-gorm/gorm
  26. - **Wire**: https://github.com/google/wire
  27. - **Viper**: https://github.com/spf13/viper
  28. - **Zap**: https://github.com/uber-go/zap
  29. - **Golang-jwt**: https://github.com/golang-jwt/jwt
  30. - **Go-redis**: https://github.com/go-redis/redis
  31. - **Testify**: https://github.com/stretchr/testify
  32. - **Sonyflake**: https://github.com/sony/sonyflake
  33. - **Gocron**: https://github.com/go-co-op/gocron
  34. - **Go-sqlmock**: https://github.com/DATA-DOG/go-sqlmock
  35. - **Gomock**: https://github.com/golang/mock
  36. - **Swaggo**: https://github.com/swaggo/swag
  37. - **Casbin**: https://github.com/casbin/casbin
  38. - **Pitaya**: https://github.com/topfreegames/pitaya
  39. - **MCP-GO**: https://github.com/mark3labs/mcp-go
  40. - More...
  41. ## Key Features
  42. * **Low Learning Curve and Customization**: Nunu encapsulates popular libraries that Gophers are familiar with, allowing you to easily customize the application to meet specific requirements.
  43. * **High Performance and Scalability**: Nunu aims to be high-performance and scalable. It uses the latest technologies and best practices to ensure that your application can handle high traffic and large amounts of data.
  44. * **Security and Reliability**: Nunu uses stable and reliable third-party libraries to ensure the security and reliability of your application.
  45. * **Modular and Extensible**: Nunu is designed to be modular and extensible. You can easily add new features and functionality by using third-party libraries or writing your own modules.
  46. * **Complete Documentation and Testing**: Nunu has comprehensive documentation and testing. It provides extensive documentation and examples to help you get started quickly. It also includes a test suite to ensure that your application works as expected.
  47. ## Concise Layered Architecture
  48. Nunu adopts a classic layered architecture. In order to achieve modularity and decoupling, it uses the dependency injection framework `Wire`.
  49. ![Nunu Layout](https://github.com/go-nunu/nunu/blob/main/.github/assets/layout.png)
  50. ## Nunu CLI
  51. ![Nunu](https://github.com/go-nunu/nunu/blob/main/.github/assets/screenshot.jpg)
  52. ## Directory Structure
  53. ```
  54. .
  55. ├── api
  56. │   └── v1
  57. ├── cmd
  58. │   ├── migration
  59. │   ├── server
  60. │   │   ├── wire
  61. │   │   │   ├── wire.go
  62. │   │   │   └── wire_gen.go
  63. │   │   └── main.go
  64. │   └── task
  65. ├── config
  66. ├── deploy
  67. ├── docs
  68. ├── internal
  69. │   ├── handler
  70. │   ├── middleware
  71. │   ├── model
  72. │   ├── repository
  73. │   ├── server
  74. │   └── service
  75. ├── pkg
  76. ├── scripts
  77. ├── test
  78. │   ├── mocks
  79. │   └── server
  80. ├── web
  81. ├── Makefile
  82. ├── go.mod
  83. └── go.sum
  84. ```
  85. The project architecture follows a typical layered structure, consisting of the following modules:
  86. * `cmd`: This module contains the entry points of the application, which perform different operations based on different commands, such as starting the server or executing database migrations. Each sub-module has a `main.go` file as the entry file, as well as `wire.go` and `wire_gen.go` files for dependency injection.
  87. * `config`: This module contains the configuration files for the application, providing different configurations for different environments, such as development and production.
  88. * `deploy`: This module is used for deploying the application and includes deployment scripts and configuration files.
  89. * `internal`: This module is the core module of the application and contains the implementation of various business logic.
  90. - `handler`: This sub-module contains the handlers for handling HTTP requests, responsible for receiving requests and invoking the corresponding services for processing.
  91. - `job`: This sub-module contains the logic for background tasks.
  92. - `model`: This sub-module contains the definition of data models.
  93. - `repository`: This sub-module contains the implementation of the data access layer, responsible for interacting with the database.
  94. - `server`: This sub-module contains the implementation of the HTTP server.
  95. - `service`: This sub-module contains the implementation of the business logic, responsible for handling specific business operations.
  96. * `pkg`: This module contains some common utilities and functions.
  97. * `scripts`: This module contains some script files used for project build, test, and deployment operations.
  98. * `storage`: This module is used for storing files or other static resources.
  99. * `test`: This module contains the unit tests for various modules, organized into sub-directories based on modules.
  100. * `web`: This module contains the frontend-related files, such as HTML, CSS, and JavaScript.
  101. In addition, there are some other files and directories, such as license files, build files, and README. Overall, the project architecture is clear, with clear responsibilities for each module, making it easy to understand and maintain.
  102. ## Requirements
  103. To use Nunu, you need to have the following software installed on your system:
  104. * Go 1.25.8 or higher
  105. * Git
  106. * Docker (optional)
  107. * MySQL 5.7 or higher (optional)
  108. * Redis (optional)
  109. ### Installation
  110. You can install Nunu with the following command:
  111. ```bash
  112. go install github.com/go-nunu/nunu@latest
  113. ```
  114. > Tips: If `go install` succeeds but the `nunu` command is not recognized, it is because the environment variable is not configured. You can add the GOBIN directory to the environment variable.
  115. ### Create a New Project
  116. You can create a new Go project with the following command:
  117. ```bash
  118. nunu new projectName
  119. ```
  120. By default, it pulls from the GitHub source, but you can also use an accelerated repository in China:
  121. ```
  122. // Use the basic template
  123. nunu new projectName -r https://gitee.com/go-nunu/nunu-layout-basic.git
  124. // Use the advanced template
  125. nunu new projectName -r https://gitee.com/go-nunu/nunu-layout-advanced.git
  126. // Use the monorepo template
  127. nunu new projectName -r https://github.com/go-nunu/nunu-layout-monorepo.git
  128. ```
  129. This command will create a directory named `projectName` and generate an elegant Go project structure within it.
  130. ### Create Components
  131. You can create handlers, services, repositories, and models for your project using the following commands:
  132. ```bash
  133. nunu create handler user
  134. nunu create service user
  135. nunu create repository user
  136. nunu create model user
  137. ```
  138. or
  139. ```
  140. nunu create all user
  141. ```
  142. These commands will create components named `UserHandler`, `UserService`, `UserRepository`, and `UserModel`, respectively, and place them in the correct directories.
  143. ### Run the Project
  144. You can quickly run the project with the following command:
  145. ```bash
  146. nunu run
  147. ```
  148. This command will start your Go project and support hot-reloading when files are updated.
  149. ### Compile wire.go
  150. You can quickly compile `wire.go` with the following command:
  151. ```bash
  152. nunu wire
  153. ```
  154. This command will compile your `wire.go` file and generate the required dependencies.
  155. ## Contribution
  156. If you find any issues or have any improvement suggestions, please feel free to raise an issue or submit a pull request. Your contributions are highly appreciated!
  157. ## License
  158. Nunu is released under the MIT License. For more information, see the [LICENSE](LICENSE) file.
  159. ## Star History
  160. [![Star History Chart](https://star-history.dera.page/svg?repos=go-nunu/nunu&type=Date)](https://star-history.dera.page/#go-nunu/nunu&Date)

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.