# sema-dotenv 0.1.0 — API reference

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

## dotenv/get

```sema
(dotenv/get key . default)
```

Get an environment variable, falling back to default (nil when omitted).

[Source line 104](https://pkg.sema-lang.com/packages/sema-dotenv/0.1.0/source/package.sema#L104)

## dotenv/load

```sema
(dotenv/load path . opts)
```

Read a .env file and set its variables in the process environment. Already-set env vars are NOT overridden unless {:override #t} is passed. Returns the full parsed map.

[Source line 85](https://pkg.sema-lang.com/packages/sema-dotenv/0.1.0/source/package.sema#L85)

## dotenv/load-if-exists

```sema
(dotenv/load-if-exists path . opts)
```

Like dotenv/load, but returns {} instead of erroring when the file does not exist. Accepts the same {:override #t} option.

[Source line 98](https://pkg.sema-lang.com/packages/sema-dotenv/0.1.0/source/package.sema#L98)

## dotenv/parse

```sema
(dotenv/parse content)
```

Parse .env file contents into a {"KEY" "value"} map. Handles comments, export prefixes, quoted values, inline comments, and CRLF line endings; strips a leading UTF-8 BOM; malformed lines are skipped. When a key repeats, the last line wins.

[Source line 75](https://pkg.sema-lang.com/packages/sema-dotenv/0.1.0/source/package.sema#L75)

## dotenv/read

```sema
(dotenv/read path)
```

Read and parse a .env file from disk into a map. Errors if the file does not exist.

[Source line 81](https://pkg.sema-lang.com/packages/sema-dotenv/0.1.0/source/package.sema#L81)

## dotenv/require

```sema
(dotenv/require . required-keys)
```

Assert that every listed environment variable is set — errors naming the missing ones.

[Source line 111](https://pkg.sema-lang.com/packages/sema-dotenv/0.1.0/source/package.sema#L111)

---

Parser: sema-reader 1.37.0

Archive SHA-256: `c9b6a548684b2b7d73682984b8c7980dc2cc69597fd9ace82a142029dc7c57b8`
