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-serviceThe 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:
- Requires
GOPATHto be set — if it is empty, the command fails. - Refuses to overwrite an existing path: if a directory matching
<service-name>already exists, it stops with an error. - Computes naming variants from the service name (standardized CamelCase, snake_case) and derives copyright / Java-package metadata from the module path.
- Copies the base layout (the
data/layouttemplate tree) and a client package into the new directory, then renders every template with the computed data. - Runs
go mod tidyfor 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:
| Position | Argument | Description |
|---|---|---|
| 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.