# `mix nous.profile.check`
[🔗](https://github.com/nyo16/nous/blob/v0.21.1/lib/mix/tasks/nous.profile.check.ex#L1)

Loads every given `Nous.Profile` and checks it against the agent with
`Nous.Profile.validate/2`, the same checks `Nous.new/2` runs at boot.

    mix nous.profile.check --agent MyApp.Agents.support
    mix nous.profile.check --agent MyApp.Agents.support --profile priv/profiles/support.json
    mix nous.profile.check --agent MyApp.Agents.support --store file:priv/eval \
      --ref support_agent@production

A profile pins the hash of every base text it replaces, so a changed
instruction or tool contract makes it `:stale` and the app would refuse
to boot with it. Run this in CI to find out before deploying; refresh a
stale profile with `mix nous.profile.rebase`. It also reports profiles
addressing a tool the agent no longer has (`:unknown_tool`), a parameter
that no longer exists (`:unknown_param`), and every structural error.

## Options

  * `--agent Mod.fun` - a public 0-arity function returning the
    `%Nous.Agent{}` the profiles are for (required)
  * `--profile PATH` - a profile file (`.json`, `.yaml`, `.yml`);
    repeatable. Without `--profile` and `--ref`, every such file in
    `priv/profiles/` is checked
  * `--store SPEC` - `file:DIR`, `sqlite:PATH` or `duckdb:PATH`, for `--ref`
  * `--ref REF` - a stored profile: `sha256:<hex>`, `name@label` or
    `name#version`; repeatable

## Exit status

  * `0` - every profile applies
  * `1` - a profile is invalid or does not apply (stale, unknown tool, ...)
  * `2` - an operational error: bad arguments, the agent factory failed,
    an unreadable file or store, a ref that resolves to nothing

---

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