Skip to content

ftkit env

How ftkit reads its configuration from the environment and a .env file.

Not a subcommand

Unlike init, new, verify and header, there is no ftkit env subcommand registered in the CLI. This page documents the environment-variable configuration that ftkit loads on startup (see cmd/env.go), which influences scaffolding and template rendering. There are no flags to document here.

What it does

When ftkit starts, it loads variables from a .env file in the current directory (via godotenv) and reads a number of environment variables to build the template data used by init, new and header. It also runs go list -m to determine the current module path and derives the service name and naming variants from it.

If a .env file cannot be loaded, ftkit reports it but continues with defaults.

Recognized variables

These are read from the environment / .env (defaults in parentheses):

Identity and metadata

VariableDefaultPurpose
service_namemy-appService name; also drives the standardized/snake-case variants.
environmentprodEnvironment label. When dev, a local ./my-app directory is used as the project root if present.
projectfountainProject label.
author_nameKim ErickoAuthor used in generated file headers.
author_email[email protected]Author email used in headers.
copyright_ownerOkelaCopyright owner in headers.
copyright_websiteokela.ioCopyright website in headers.
repo_git_url(empty)The service's git/module URL.
fountain_repo_git_urlgitlab.soludian.com/soludian/fountainThe Fountain module path used in generated imports.
go_version / go_version_maindetected Go versionGo version stamped into generated files.

Feature toggles

These booleans (default false unless noted) decide which servers, caches, databases, storages and registries the scaffolding enables:

  • Servers: http_server_enable, grpc_server_enable, tcp_server_enable, udp_server_enable
  • Cache: redis_cache_enable
  • Databases: mysql_db_enable, postgres_db_enable (and sql_db_enable, defaulting to MySQL OR Postgres)
  • Storages: cassandra_storage_enable, es_storage_enable, s3_storage_enable
  • DAO manager: dao_manager_enable (defaults to true if any cache/db/storage is enabled)
  • Registries: k8s_reg_enable, etcd_reg_enable, consul_reg_enable

Generated service projects ship with a scripts/env.sh helper (in the service layout, not part of the CLI). It configures Git and Go for the private GitLab host — writing a .netrc/_netrc entry and setting GOPRIVATE, GOINSECURE, GONOPROXY and GONOSUMDB for gitlab.soludian.com/*. See Getting Started for the equivalent manual setup needed to install ftkit and Fountain.