The version of kratos must be v2.0.0 or above.
These environments and tools must be installed properly.
The GO111MODULE should be enabled.
go env -w GO111MODULE=onIf you faced with network problem (especially you are in China Mainland), please setup GOPROXY
You can do it either way.
go install github.com/go-kratos/kratos/cmd/kratos/v2@latestgit clone https://github.com/go-kratos/kratoscd kratosmake install# create project's layoutkratos new helloworld
cd helloworld# pull dependenciesgo mod download# installation dependencygo get github.com/google/wire/cmd/wire@latest# generate all codes of proto and wire etc.go generate ./...
# run the applicationkratos runcurl 'http://127.0.0.1:8000/helloworld/kratos'
The response should be{ "message": "Hello kratos"}Kratos CLI always pull the layout project from GitHub for project creation. The layout project is: