Skip to the content.

AI layer (opt-in)

explain and fix are optional helpers over easel’s deterministic results. The core analysis never uses AI — these commands are a thin layer on top of findings.

Privacy first

Nothing leaves your machine unless you pass --send. The default is a dry run that prints the exact prompt that would be sent, so you can review it before opting in.

# Dry run — no network. Prints the prompt.
easel explain ./MyApp --rule PA1009

# Actually call a provider (you choose which).
export EASEL_AI_KEY=sk-...
easel explain ./MyApp --rule PA1009 --send \
  --endpoint https://api.openai.com/v1/chat/completions --model gpt-4o-mini

Commands

explain

Explains a finding with its formula context.

easel explain <path> --rule <id> [--send] [--endpoint <url>] [--model <id>] [--api-key-env <VAR>]

fix

Suggests a corrected formula as a diff. Never auto-applies. Any suggestion is validated by re-parsing it with Power Fx before it is shown.

easel fix <path> --rule PF0001 [--send] [--endpoint <url>] [--model <id>]

Fix procedures. For rules with a known-good rewrite (all formula-level performance rules: PA1001, PA1002, PA1006, PA1014–PA1018) the prompt includes a deterministic repair procedure — e.g. PA1016: rewrite CountRows(Filter(source, condition)) as CountIf(source, condition) — so the model follows the prescribed recipe instead of improvising.

Fix validation. Beyond re-parsing, the suggestion is re-checked against the same AST pattern that produced the finding:

Provider

The provider is OpenAI-compatible (/v1/chat/completions), so it works with:

Option Meaning Default
--endpoint Chat-completions URL — (required with --send)
--model Model id gpt-4o-mini
--api-key-env Env var holding the API key EASEL_AI_KEY

What is sent

Only when --send is set: the rule id, message, location and the single formula in question. No file trees, no other formulas, no credentials. Review the exact payload any time by dropping --send (dry run).