> ## Documentation Index
> Fetch the complete documentation index at: https://docs.otter-shell.org/llms.txt
> Use this file to discover all available pages before exploring further.

# otter-conf

> Comptime-generic config parser with mmap I/O, serialization, and inotify hot-reload.

`otter-conf` turns flat `key = value` files into Zig structs. Your struct shape drives a comptime-generated parser. Files load through mmap.

App schemas live in `otter-config-types`; apps load them with `otter-conf`.

## Quick start

```zig theme={null}
const otter_conf = @import("otter_conf");

const Config = struct {
    port: u16 = 8080,
    debug: bool = false,
};

var config = try otter_conf.load(Config, allocator, "/path/to/config.conf", .{});
defer otter_conf.freeConfig(Config, allocator, &config);
```

Example file:

```conf theme={null}
# Application configuration
port = 443
debug = false
```

## Documentation map

<CardGroup cols={2}>
  <Card title="Format and types" icon="file-lines" href="/developers/libraries/otter-conf/format-and-types">
    Syntax, supported field types, strings, enums, arrays.
  </Card>

  <Card title="Loading API" icon="download" href="/developers/libraries/otter-conf/loading-api">
    `load`, `loadFromSlice`, directories, serialization, `save`.
  </Card>

  <Card title="Hot reload" icon="rotate" href="/developers/libraries/otter-conf/hot-reload">
    `hasChanged`, `Watcher`, and poll-loop integration.
  </Card>

  <Card title="Advanced features" icon="code" href="/developers/libraries/otter-conf/advanced-features">
    Nested structs, custom types, `Dynamic`, and `import`.
  </Card>
</CardGroup>

## Conventions

* Every struct field needs a default value.
* Unknown keys are skipped (forward compatible).
* Nested structs flatten to `prefix_field` keys (`clock_enabled`, `clock_text_color`).
* Call `freeConfig` when the struct owns heap strings or slices.

## Dependencies

`otter-utils` (inotify wrapper for `Watcher`).
