# sema-config 0.1.1 — API reference

Source declarations extracted without executing package code. Signatures describe declarations, not inferred runtime behavior.

## config/env-overrides

```sema
(config/env-overrides prefix)
```

Collect all environment variables starting with prefix into a nested map: APP_DB__HOST=x → {:db {:host "x"}}. Double underscores nest; single segments become lowercase kebab-case keywords. Values stay strings — coerce at the consumer via :%env or your own parsing.

[Source line 288](https://pkg.sema-lang.com/packages/sema-config/0.1.1/source/package.sema#L288)

## config/get

```sema
(config/get cfg key . default)
```

Get a top-level config value, falling back to default (nil when omitted). Thin wrapper over the stdlib get, kept for API symmetry.

[Source line 307](https://pkg.sema-lang.com/packages/sema-config/0.1.1/source/package.sema#L307)

## config/get-in

```sema
(config/get-in cfg path . default)
```

Get a nested config value at a key path, falling back to default (nil when omitted). Same semantics as the stdlib map/get-in, kept for API symmetry.

[Source line 311](https://pkg.sema-lang.com/packages/sema-config/0.1.1/source/package.sema#L311)

## config/load

```sema
(config/load sources . opts)
```

Load layered configuration: deep-merge sources left-to-right (later wins), apply the selected profile, then expand :%env/:%ref/:%or directives and ${VAR} strings. Sources are file paths and/or maps; a single path or map is also accepted. Options: {:profile :prod} (falls back to the SEMA_PROFILE env var).

[Source line 273](https://pkg.sema-lang.com/packages/sema-config/0.1.1/source/package.sema#L273)

## config/read

```sema
(config/read path . opts)
```

Read one config file by extension (.toml, .json, or .sema) into a keyword-keyed map. Options: {:optional #t} returns {} instead of erroring when the file is missing.

[Source line 263](https://pkg.sema-lang.com/packages/sema-config/0.1.1/source/package.sema#L263)

## config/require!

```sema
(config/require! cfg paths)
```

Assert that every key path in paths exists in cfg — errors listing ALL missing paths at once. Returns cfg for chaining.

[Source line 315](https://pkg.sema-lang.com/packages/sema-config/0.1.1/source/package.sema#L315)

---

Parser: sema-reader 1.37.0

Archive SHA-256: `a2c7e5323994f7e8e0e9c7f6d92f0b879a6a1102dc96a0faa116d95e0fa39ba1`
