Skip to content

loadConfiguredHistoryDbPath

loadConfiguredHistoryDbPath(commandLineConfigOverrides): Promise<string | undefined>

Defined in: packages/core/src/config/loader.ts:980

GS2-119 — the configured history.dbPath, read without building a model, or undefined when no layer sets a usable one.

The read-only history commands (gth history list / search / show / prune / rebuild and gth insights) must open the store the recorder writes, so they resolve --db, then this, then the default. They cannot use initConfig: it builds the model, and a machine with no API key in its environment, or with no config at all, must still be able to list what it recorded.

Layering matches a run for this one key: the project layer (through its extends chain) wins over the global one, and a layer that does not set it defers. Quiet and fail-soft like loadConfiguredConsoleLevel: a config it cannot read is a config with no dbPath, and the command falls back to the default store — the same one a run with that config would fail to load before reaching its recorder.

CommandLineConfigOverrides

Promise<string | undefined>