1. Install the gofs cli
Info: You need Go 1.24 or greater. If you don’t have Go installed, see Prerequisites. Install the latest gofs cli by running the command:
go install github.com/gofs-cli/gofs@latest
Tip: If you have an existing project, you can install gofs cli with the tool directive feature of Go added in v1.24.
To install gofs cli as a tool, use
go get -tool github.com/gofs-cli/gofs@latest
2. Initialize a project
Navigate to the folder where you want to initialize your project. Provide gofs with a go module name such as github.com/myorg/myapp
If you have created a project folder, from your project folder run
gofs init github.com/myorg/myapp
If you want gofs to create the project folder, run
gofs init github.com/myorg/myapp myfolder
Tip: If you have an existing project and you installed gofs as a tool, run
go tool gofs init github.com/myorg/myapp
The generated project is a complete, runnable app. It contains a Go server, a page layout, vendored web component helpers, an example component, and a sqlc.yaml ready for your first package. There is no package.json and nothing to npm install.
3. Run the project
Info: The Gofs template includes a Makefile for convenience. If you don’t have Make installed, see Prerequisites. From your project directory run
make
Other useful targets are make dbup to start a local Postgres, and make generate to run go generate (which runs sqlc for any package that has queries).