# `GeminiCliSdk.Configuration`
[🔗](https://github.com/nshkrdotcom/gemini_cli_sdk/blob/v0.2.0/lib/gemini_cli_sdk/configuration.ex#L1)

Centralized numeric constants and compatibility defaults.

After the common runtime replatform, Gemini's streaming/session lane runs on
`cli_subprocess_core`. This module therefore keeps Gemini-owned defaults for
stream lifecycle management, synchronous command execution, public option
defaults, and preserved compatibility knobs.

Override any value via Application configuration:

    # config/config.exs
    config :gemini_cli_sdk,
      stream_timeout_ms: 600_000,
      max_buffer_size: 2_097_152

## Timeouts

| Key | Default | Used By | Description |
|-----|---------|---------|-------------|
| `:command_timeout_ms` | 60,000 | `Command` | Synchronous command timeout |
| `:stream_timeout_ms` | 300,000 | `Stream` | Stream receive timeout |
| `:default_timeout_ms` | 300,000 | `Options` | Default user-facing timeout |
| `:transport_call_timeout_ms` | 5,000 | Legacy compatibility docs | Preserved legacy timeout |
| `:transport_force_close_timeout_ms` | 500 | Legacy compatibility docs | Preserved legacy timeout |
| `:transport_headless_timeout_ms` | 5,000 | Legacy compatibility docs | Preserved legacy timeout |
| `:transport_close_grace_ms` | 2,000 | `Stream` | Close grace period |
| `:transport_kill_grace_ms` | 250 | `Stream` | Kill/demonitor grace period |
| `:command_stop_wait_ms` | 200 | `Command` | Wait after SIGTERM |
| `:command_kill_wait_ms` | 500 | `Command` | Wait after SIGKILL |
| `:finalize_delay_ms` | 25 | Legacy compatibility docs | Preserved legacy delay |

## Buffer Sizes

| Key | Default | Used By | Description |
|-----|---------|---------|-------------|
| `:max_buffer_size` | 1,048,576 | Legacy compatibility docs | Preserved legacy stdout buffer (1 MB) |
| `:max_stderr_buffer_size` | 262,144 | `Options`, `Stream` | Default stderr buffer (256 KB) |

## Limits

| Key | Default | Used By | Description |
|-----|---------|---------|-------------|
| `:max_lines_per_batch` | 200 | Legacy compatibility docs | Preserved legacy batch size |
| `:max_include_directories` | 5 | `Options` | Max include directories |

## Compile-Time vs Runtime

Constants consumed via module attributes (for example in `Stream`) are
evaluated at compile time. Changing these via `Application.put_env/3` at
runtime requires recompilation of the consuming module. Constants consumed via
direct function calls (for example in `Command.run/2`) pick up runtime
changes immediately.

# `all`

```elixir
@spec all() :: keyword(pos_integer())
```

Returns all configuration keys and their current values.

# `command_kill_wait_ms`

```elixir
@spec command_kill_wait_ms() :: pos_integer()
```

Returns the configured value for `command_kill_wait_ms` (default: `500`).

# `command_stop_wait_ms`

```elixir
@spec command_stop_wait_ms() :: pos_integer()
```

Returns the configured value for `command_stop_wait_ms` (default: `200`).

# `command_timeout_ms`

```elixir
@spec command_timeout_ms() :: pos_integer()
```

Returns the configured value for `command_timeout_ms` (default: `60000`).

# `default_timeout_ms`

```elixir
@spec default_timeout_ms() :: pos_integer()
```

Returns the configured value for `default_timeout_ms` (default: `300000`).

# `finalize_delay_ms`

```elixir
@spec finalize_delay_ms() :: pos_integer()
```

Returns the configured value for `finalize_delay_ms` (default: `25`).

# `max_buffer_size`

```elixir
@spec max_buffer_size() :: pos_integer()
```

Returns the configured value for `max_buffer_size` (default: `1048576`).

# `max_include_directories`

```elixir
@spec max_include_directories() :: pos_integer()
```

Returns the configured value for `max_include_directories` (default: `5`).

# `max_lines_per_batch`

```elixir
@spec max_lines_per_batch() :: pos_integer()
```

Returns the configured value for `max_lines_per_batch` (default: `200`).

# `max_stderr_buffer_size`

```elixir
@spec max_stderr_buffer_size() :: pos_integer()
```

Returns the configured value for `max_stderr_buffer_size` (default: `262144`).

# `stream_timeout_ms`

```elixir
@spec stream_timeout_ms() :: pos_integer()
```

Returns the configured value for `stream_timeout_ms` (default: `300000`).

# `transport_call_timeout_ms`

```elixir
@spec transport_call_timeout_ms() :: pos_integer()
```

Returns the configured value for `transport_call_timeout_ms` (default: `5000`).

# `transport_close_grace_ms`

```elixir
@spec transport_close_grace_ms() :: pos_integer()
```

Returns the configured value for `transport_close_grace_ms` (default: `2000`).

# `transport_force_close_timeout_ms`

```elixir
@spec transport_force_close_timeout_ms() :: pos_integer()
```

Returns the configured value for `transport_force_close_timeout_ms` (default: `500`).

# `transport_headless_timeout_ms`

```elixir
@spec transport_headless_timeout_ms() :: pos_integer()
```

Returns the configured value for `transport_headless_timeout_ms` (default: `5000`).

# `transport_kill_grace_ms`

```elixir
@spec transport_kill_grace_ms() :: pos_integer()
```

Returns the configured value for `transport_kill_grace_ms` (default: `250`).

---

*Consult [api-reference.md](api-reference.md) for complete listing*
