Skip to content

ftkit CLI

What is ftkit?

ftkit is the command-line companion to the Fountain framework. It is a CLI that can create new services, generate service components, verify that a repository follows the Fountain standard, and edit source files — so you can scaffold a project and keep it conformant without writing the boilerplate by hand.

The CLI's own description (from cmd/root.go) puts it as: "ftkit — create microservices and components with the Fountain framework" — a CLI that can create, verify, and edit Fountain services and the components inside them.

  • Module: gitlab.soludian.com/soludian/ftkit
  • Built on top of the Fountain module (gitlab.soludian.com/soludian/fountain) and Cobra.

Install

ftkit is distributed as a private Go module on GitLab, so installing it requires the same GOPRIVATE setup as the framework itself:

bash
go install gitlab.soludian.com/soludian/ftkit@latest

Because gitlab.soludian.com is a private host, configure Go to skip the public proxy/checksum database before installing — see Getting Started for the full GOPRIVATE / .netrc instructions:

bash
go env -w GOPRIVATE=gitlab.soludian.com/*
go env -w GONOSUMDB=gitlab.soludian.com/*

The binary installs as ftkit on your $GOPATH/bin. Maintainers of the CLI itself can also build it from the repository:

  • nopush_build.sh — builds a stripped binary into $GOPATH/bin/ftkit.exe (and compresses it with upx if available).
  • build.sh — does the same, then uploads a dated build artifact to S3.

TIP

Make sure $GOPATH/bin is on your PATH so the ftkit command is available everywhere.

Commands

ftkit registers the following subcommands (each command also has a short alias):

CommandAliasDescription
initiScaffold a brand-new Fountain service from the built-in layout.
newnAdd a component (controller, handler, DAO, server, package, client) to an existing service via an interactive prompt.
verifyvRun 20 standards checks against a service repository and report pass / warning / error.
headerhPrepend the standard file-header template to Go files that are missing it.

In addition, the way ftkit reads its configuration from the environment and a .env file is documented on the env page.

Version

The CLI version is embedded at build time (ftkit --version); the default in source is 0.0.1.