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
| Variable | Default | Purpose |
|---|---|---|
service_name | my-app | Service name; also drives the standardized/snake-case variants. |
environment | prod | Environment label. When dev, a local ./my-app directory is used as the project root if present. |
project | fountain | Project label. |
author_name | Kim Ericko | Author used in generated file headers. |
author_email | [email protected] | Author email used in headers. |
copyright_owner | Okela | Copyright owner in headers. |
copyright_website | okela.io | Copyright website in headers. |
repo_git_url | (empty) | The service's git/module URL. |
fountain_repo_git_url | gitlab.soludian.com/soludian/fountain | The Fountain module path used in generated imports. |
go_version / go_version_main | detected Go version | Go 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(andsql_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
Related: the env.sh setup script
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.