Skip to content

ftkit init

Scaffold a brand-new Fountain service from the built-in project layout.

Usage

bash
ftkit init <service-name> <module-path>

Example (from the command's own help):

bash
ftkit init my-service gitlab.soludian.com/soludian/my-service

The command is also available under the alias i.

What it does

init creates a new directory named after <service-name> and populates it with the standard Fountain service layout. It:

  1. Requires GOPATH to be set — if it is empty, the command fails.
  2. Refuses to overwrite an existing path: if a directory matching <service-name> already exists, it stops with an error.
  3. Computes naming variants from the service name (standardized CamelCase, snake_case) and derives copyright / Java-package metadata from the module path.
  4. Copies the base layout (the data/layout template tree) and a client package into the new directory, then renders every template with the computed data.
  5. Runs go mod tidy for the new module while rendering, and finally attempts to open the project in VS Code (code <service-name>).

After it finishes you have a ready-to-build Fountain service rooted at ./<service-name>.

Arguments

init takes exactly two positional arguments:

PositionArgumentDescription
1<service-name>The service name; also used as the directory name for the new project.
2<module-path>The Go module path for the service, e.g. gitlab.soludian.com/soludian/my-service.

The module path is also used to derive the Java package name (host segments reversed) for any generated artifacts that need it.

WARNING

init exits with an error if GOPATH is not set or if the target directory already exists. There are no flags on this command.