# caerun

Fortified command runner with output capture and safety checks.

## Purpose

`caerun` (from Welsh *caer*, fortified + *rhedeg*, to run) provides a safe
wrapper around process execution. Commands are captured, timed, and validated
before their output is made available.

## Features

- **Output capture** — stdout and stderr captured as bytes or strings
- **Timeout enforcement** — configurable per-runner timeout
- **Size limits** — prevent runaway output from consuming memory
- **Strict mode** — fail on non-zero exit codes
- **Environment injection** — pass env vars to child processes
- **Structured results** — exit code, timing, and output in one struct

## Install

```bash
cargo add caerun
```

## Usage

```rust
use caerun::{CommandRunner, RunConfig};

let runner = CommandRunner::new(RunConfig::default());

// Basic run
let result = runner.run("echo", &["hello"]).unwrap();
assert!(result.success());
assert_eq!(result.stdout_str().trim(), "hello");

// Strict mode (fails on non-zero exit)
let result = runner.run_strict("echo", &["ok"]);

// Custom config
let runner = CommandRunner::new(
    RunConfig::default()
        .with_timeout(std::time::Duration::from_secs(5))
        .with_env("MY_VAR", "value")
);
```

## License

MIT OR Apache-2.0
