Settings
Settings are edited at RedPen → Settings, or written to config/redpen.php where they can be per-environment and version controlled.
Reference
| Setting | Default | Notes |
|---|---|---|
language | en-US | The language rules are evaluated against. |
checkOnLoad | true | Check when an edit screen opens. |
checkOnSave | false | Evaluate on save. Pro. |
blockOnError | false | Let an error actually block the save. Pro. |
backends | ['rules'] | Which checkers run, in order. |
languageToolEndpoint | empty | Base URL of a self-hosted LanguageTool server. Parses env vars. |
languageToolTimeout | 10 | Seconds before giving up on a request. |
languageToolPicky | false | Ask for the picky ruleset too. |
llmProvider | anthropic | anthropic or openai. |
llmApiKey | empty | Your key. Parses env vars. |
llmModel | empty | Empty uses the provider’s default. Parses env vars. |
maxFragmentLength | 20000 | Characters per field sent to a network backend. |
cacheDuration | 300 | Seconds a check result is cached. 0 disables caching. |
logLevel | warning | Verbosity of storage/logs/redpen.log: error, warning, info or debug. |
The config file
Create config/redpen.php and return an array. It supports Craft’s multi-environment shape:
<?php
return [
'*' => [
'checkOnLoad' => true,
'backends' => ['rules'],
],
'production' => [
'checkOnSave' => true,
'blockOnError' => true,
'backends' => ['rules', 'languagetool'],
'languageToolEndpoint' => '$LANGUAGETOOL_URL',
],
];
Anything set in this file overrides the control panel and its field is shown as read-only there, the same as any other Craft plugin.
Environment variables
languageToolEndpoint, llmApiKey and llmModel all parse environment variables, so credentials never land in project config:
# .env
LANGUAGETOOL_URL=http://languagetool.internal:8010
REDPEN_LLM_KEY=sk-…
Then enter $REDPEN_LLM_KEY in the settings field, or set it in config/redpen.php.
Nothing is required
No setting is marked required, on purpose. A required validation rule on any one setting makes saving the settings fail wholesale on a fresh install — so nothing can be saved until that one field is filled in. Values are validated for correctness only when they are present.
Logging
RedPen writes to storage/logs/redpen.log at the level set by logLevel. Set it to debug when working out why a network backend is behaving oddly; it records each request, its duration and the shape of the response, without the content of your entries.