Skip to content

refactor: move all global config into HCL only (no flags)#101

Merged
alecthomas merged 1 commit intomainfrom
aat/global-config
Feb 7, 2026
Merged

refactor: move all global config into HCL only (no flags)#101
alecthomas merged 1 commit intomainfrom
aat/global-config

Conversation

@alecthomas
Copy link
Collaborator

To facilitate this, I added a config.InjectEnvars() function that emulates the envar mapping we were using with Kong. This still allows all global config to be configured via envars automatically.

eg.

CACHEW_GIT_CLONE_FETCH_INTERVAL=10s cachewd

The flags now look like this:

~/dev/cachew $ cachewd --help
Usage: cachewd --config=PATH [flags]

Flags:
  -h, --help           Show context-sensitive help.
      --schema         Print the configuration file schema ($CACHEW_SCHEMA).
      --config=PATH    Configuration file path ($CACHEW_CONFIG).

We could also duplicate some common configuration in flags...like --log-level ... but that would be a bit of extra work. We'll see how we go.

@alecthomas alecthomas requested a review from nssherpa February 7, 2026 19:47
@alecthomas alecthomas requested a review from a team as a code owner February 7, 2026 19:47
To facilitate this, I added a config.InjectEnvars() function that
emulates the envar mapping we were using with Kong. This still allows
all global config to be configured via envars automatically.

eg.

```
CACHEW_GIT_CLONE_FETCH_INTERVAL=10s cachewd
```

The flags now look like this:

```
~/dev/cachew $ cachewd --help
Usage: cachewd --config=PATH [flags]

Flags:
  -h, --help           Show context-sensitive help.
      --schema         Print the configuration file schema ($CACHEW_SCHEMA).
      --config=PATH    Configuration file path ($CACHEW_CONFIG).
```
@alecthomas alecthomas merged commit 20010fc into main Feb 7, 2026
5 checks passed
@alecthomas alecthomas deleted the aat/global-config branch February 7, 2026 22:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant