@dokebi/cli 0.4.90 → 0.4.92

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/AI.md CHANGED
@@ -69,15 +69,15 @@ The `blog` plan, depending on the answers: `init` (when the folder is not a proj
69
69
  | `dokebi plugins search <word\|capability>` | `{ query, status: found\|absent\|unknown, matches[], recipes[], absent[{capability, summary, instead, message}] }`. When no package matches it returns the matching absent entries, so "not found" differs from "does not exist" |
70
70
  | `dokebi plugins info <id\|package>` · `plugins doc <id\|package>` | One package: capabilities, variants, what it does not do, dependencies, option keys, installed version and compatibility / the AI.md of the **installed version** (`path`, `content`, `version`). Unknown: `UNKNOWN_PLUGIN` (details hold the search result and absent entries; a guessed short name of an installed package, such as `dokebi-core`, gets `details.package`, `path` and `fix`: `npx dokebi plugins doc @dokebi/core --json (or read node_modules/@dokebi/core/AI.md)`); not installed: `NOT_INSTALLED` (hint: `add --dry-run`); no AI.md: `DOC_MISSING` |
71
71
  | `dokebi add <package\|tgz> [--set <path>=<value>]... [--adapter <id>] [--startup <required\|optional>] [--no-first-app] [--dry-run]` | Install and register a plugin. Required plugins named in the manifest (with `package`) are installed with it (`autoInstalled`). **Without a version** it picks the highest version that fits the project core (`resolved{package, version, source: registry\|snapshot, core, registry, deprecated?}`). It also has to fit the installed packages: the peers it names accept the versions the project has (`@dokebi/session` 0.4.4 needs `@dokebi/web` ^0.4.3), and the installed plugins' manifest ranges accept it. A newer version they hold back is the warning `NEWER_VERSION_HELD_BACK` (`path: <package>@<version>`, `hint`: what it needs and the commands, `npx dokebi upgrade <id>` first); when no version fits it is `INCOMPATIBLE_VERSION` (phase `plan`, `details.conflicts`, `details.fix`). The required plugins it brings (`autoInstalled`) get their versions the same way, inside the range its manifest names, in the same npm run (npm alone took the newest of the range, which could need a newer core). A named version whose peers do not fit stops in npm with `ERESOLVE`; that `NPM_FAILED` then has `details.conflicts` and `details.fix` (upgrade the installed package first) instead of the generic `hint`. The registry is the one npm really uses for that package (a scope setting such as `@dokebi:registry` first; environment, project, user and global `.npmrc`; see "Version selection" below). Pre-releases (`-rc.1` and the like) and `0.0.0-…` placeholders are never picked (name one with `add <package>@<version>`); a deprecated version only when there is no other, with the warning `DEPRECATED_VERSION`. Not in the registry: `NOT_PUBLISHED`; no version fits: `NO_COMPATIBLE_VERSION`; outside `@dokebi/`: warning `THIRD_PARTY_PACKAGE`. `--adapter` (@dokebi/db): the adapter file `src/infra/db/adapters/<id>.ts`, an entry file with the connection `main`, `connections.main` (the URL is a placeholder) and the driver (pg also gets `@types/pg`); it works on an installed db too (an edited entry file is kept: `CONNECTIONS_KEPT`). `--adapter <anthropic\|openai\|gemini>` (@dokebi/ai, D-0186): installs that provider's official SDK only (also on an installed @dokebi/ai); a plugin without adapters refuses the flag (`USAGE`), an unknown id is `UNKNOWN_ADAPTER` (`details.adapters`). `--startup <required|optional>` (with `--adapter` only, D-0127) writes `connections.main.startup`; left out, nothing is written and the default `required` applies. `--no-first-app` (@dokebi/app): no first app `main`. The version already installed is no change (`changed: []`); with `--set` it is `INVALID_SET` (`details.paths`, `details.fix`: `npx dokebi config set …`), since add writes no options then. When an installed plugin's install module names a secret option (`configSecrets`, for example @dokebi/session's `secrets`) that has no value yet, add writes a generated secret (32 random bytes, base64url, as `config secret`) into dokebi.yaml and reports `generatedSecrets[{plugin, option, file}]` (`option: '<id>.<path>'`, `file: 'dokebi.yaml'`): the name, never the value. `--dry-run` reports the same list. A plugin published before that still names an environment variable (`envSecrets`, deprecated, removed in 0.5) gets it appended to `.env` as before, with the warning `DEPRECATED_PLAN_FIELD` (`deprecated: 'envSecrets'`) |
72
- | `dokebi config show [<id>[.<path>]]` | Prints the options of dokebi.yaml with every secret hidden (AI-M05): Every config command (`show`, `diff`, `set`, `unset`, `secret`) works on the settings file the app reads (M50): the file `DOKEBI_CONFIG` names when it is set and not empty (a relative path is from the project folder, as `dokebi dev`, the generated `src/main.ts` and dokebi-migrate take it), else dokebi.yaml; the result names it in `file` (and in `changed`, `paths`, `removed[].files`). A named file outside the project is read by `show` and `diff` but never written (`UNSAFE_PATH`, as with a linked dokebi.yaml); a named file that is not there is `READ_FAILED`, never dokebi.yaml instead. The sample stays the project's one dokebi.example.yaml. `{ file, path, value, defaults[], secrets[], warnings? }`. `value` is every section (installed plugins without a section too), one section or one value; options the file does not set are filled from the schema `default` and listed in `defaults` (the human YAML marks them `# default`). Hidden as `<secret: set>`: values the plugin schema marks secret (`writeOnly`, as `dokebi check` secret-in-config reads it, also through `patternProperties`, `prefixItems` or a `then`/`else` branch that may apply; a list of them is one entry of `secrets`), values under a name core's log rule masks (`redaction.isSecretField` of `@dokebi/core/libraries`, the one rule: `password`, `secret`, `token`, `apiKey`, `authorization`, `cookie`, `credentials`, `sessionId`, `jwt`, `pin`, … — text, or the text of a list or of an object whose schema does not declare its fields; a number only under a password, PIN or code name; never a boolean; `key`, `cacheKey`, `maxKeys` are not secret names), unless the schema marks the option plain (`x-dokebi-secret: false`, core option `plain`, as `secretsEnv` and `routeIds.*` are), and the recipe's first admin password (`first-admin.initialPassword`, or the older `blog-admin.initialPassword`); credentials inside text, found by core's `redaction.maskCredentials`, show as `<secret>`: `scheme://user:<secret>@host` (also a password with a raw `/` or `@`), `scheme://<secret>@host` for a user or token without a password, `Password=<secret>` of a connection string. A default under a name that would be hidden is not filled in; a default is not filled in beside a set old name of the option either (D-0071 alias: `bodyLimit` holds `maxBodyBytes`). The plugin id of the logger (`dokebi-logger`, whose section is `logging`) is `PATH_MISMATCH` with the `config show logging.<path>` to use. When a plugin's schema cannot be read, all its text is hidden (warning `OPTIONS_SCHEMA_UNREADABLE`). No value is ever printed, in the human output, `--json`, errors or debug logs. A list item is named by its index, its `name` or the `type` of an item without a name, as `config set` names it (`config show logging.targets.pretty`); a path that is not set and has no default is `UNKNOWN_OPTION` (`details.keys`; in a list `details.items`, how each item is named). Read only, no lock. **Use it instead of cat, sed, grep or head on dokebi.yaml** |
72
+ | `dokebi config show [<id>[.<path>]] [--process <name>]` | Prints the options of dokebi.yaml with every secret hidden (AI-M05): Every config command (`show`, `diff`, `set`, `unset`, `secret`) works on the settings file the app reads (M50): the file `DOKEBI_CONFIG` names when it is set and not empty (a relative path is from the project folder, as `dokebi dev`, the generated `src/main.ts` and dokebi-migrate take it), else dokebi.yaml; the result names it in `file` (and in `changed`, `paths`, `removed[].files`). A named file outside the project is read by `show` and `diff` but never written (`UNSAFE_PATH`, as with a linked dokebi.yaml); a named file that is not there is `READ_FAILED`, never dokebi.yaml instead. The sample stays the project's one dokebi.example.yaml. `{ file, path, value, defaults[], secrets[], warnings? }`. `value` is every section (installed plugins without a section too), one section or one value; options the file does not set are filled from the schema `default` and listed in `defaults` (the human YAML marks them `# default`). Hidden as `<secret: set>`: values the plugin schema marks secret (`writeOnly`, as `dokebi check` secret-in-config reads it, also through `patternProperties`, `prefixItems` or a `then`/`else` branch that may apply; a list of them is one entry of `secrets`), values under a name core's log rule masks (`redaction.isSecretField` of `@dokebi/core/libraries`, the one rule: `password`, `secret`, `token`, `apiKey`, `authorization`, `cookie`, `credentials`, `sessionId`, `jwt`, `pin`, … — text, or the text of a list or of an object whose schema does not declare its fields; a number only under a password, PIN or code name; never a boolean; `key`, `cacheKey`, `maxKeys` are not secret names), unless the schema marks the option plain (`x-dokebi-secret: false`, core option `plain`, as `secretsEnv` and `routeIds.*` are), and the recipe's first admin password (`first-admin.initialPassword`, or the older `blog-admin.initialPassword`); credentials inside text, found by core's `redaction.maskCredentials`, show as `<secret>`: `scheme://user:<secret>@host` (also a password with a raw `/` or `@`), `scheme://<secret>@host` for a user or token without a password, `Password=<secret>` of a connection string. A default under a name that would be hidden is not filled in; a default is not filled in beside a set old name of the option either (D-0071 alias: `bodyLimit` holds `maxBodyBytes`). The plugin id of the logger (`dokebi-logger`, whose section is `logging`) is `PATH_MISMATCH` with the `config show logging.<path>` to use. When a plugin's schema cannot be read, all its text is hidden (warning `OPTIONS_SCHEMA_UNREADABLE`). No value is ever printed, in the human output, `--json`, errors or debug logs. A list item is named by its index, its `name` or the `type` of an item without a name, as `config set` names it (`config show logging.targets.pretty`); a path that is not set and has no default is `UNKNOWN_OPTION` (`details.keys`; in a list `details.items`, how each item is named). Read only, no lock. **Use it instead of cat, sed, grep or head on dokebi.yaml** With `--process <name>` (D-0251) it shows the options that process of the file gets: the shared `options` with its `processes.<name>.options` merged in; the result names `process`, `processes` and `run`. |
73
73
  | `dokebi config diff [<id>] [--write [--values] [--prune] [--dry-run]]` | Compares dokebi.yaml with dokebi.example.yaml by option path (AI-M45: an agent dumped both files to compare them and printed secrets): `{ file, example, section, inSync, onlyInConfig[], onlyInExample[], different[], secrets[], exampleSecrets[], warnings? }`. A subtree one file lacks is one path, a list one value; `different` names paths both set to other non-secret values (a sample value may differ). Secrets of dokebi.yaml (as `config show` hides them) are never compared and never count as missing from the sample; a secret path that holds a value in the sample is in `exampleSecrets` (remove it; a sample value is judged by the sample's own rule: in a section nothing declares, such as one `dokebi remove` kept, by name and credentials only; a URL without a password, a `<password>` in place of one and the scaffold's `<set … here>` text, also as list items, are placeholders, not leaks). Secret names follow core's rule as in `config show` (text under them is a secret, a count such as `transientLogMaxKeys: 256` or a boolean is compared; a plain option is compared). `inSync` is true when no path is only in one file and the sample holds no secret. `warnings` are `config show`'s for either file: with `OPTIONS_SCHEMA_UNREADABLE` that plugin's text counts as secret in both files, so its sample values are in `exampleSecrets` until its schema can be read again (`npm install`), not values to remove. Values never appear in the result, errors or logs. No sample: `EXAMPLE_MISSING` `--write` (AI-M46: a builder copied set values into the sample with a script of its own) copies the paths only in dokebi.yaml into dokebi.example.yaml in one transaction, comments kept: secrets inside them are left out (a list holding one is left out whole; a path holding nothing else counts as a secret, in `secrets`), paths both files set keep the sample's value — with `--values` (Studio v2) they get dokebi.yaml's value too, every path of `different` (never a secret: secrets are not compared; a list or mapping without its secrets, or left out when one item is secret), listed in `valuesWritten`. The result adds `written` (paths) and `diff` (the comparison after the copy); a copy that would leave a secret in the sample is refused (`SAMPLE_SECRET`, nothing written). `--prune` (with `--write`) also removes from the sample only what nothing reads — a section no installed plugin, settings declaration or core reads (an old `dokebi-logger`), keys a schema does not declare and refuses (an option a plugin dropped; an object without `additionalProperties: false` takes any key, so its keys stay) — and any secret with a value in it (`exampleSecrets`, including one inside a list item such as a log target's `token`); a declared option only the sample shows stays; dokebi.yaml is never changed; the result adds `pruned`. Never edit the sample by hand: `config set` writes dokebi.yaml only, then `config diff --write [--prune]` |
74
74
  | `dokebi config init [--dry-run]` | **A fresh copy of the project** (a clone, a CI checkout: dokebi.yaml stays out of version control, D-0163): writes dokebi.yaml (0600) from dokebi.example.yaml with a new generated secret for each one `add` writes (the install plans' `configSecrets`, such as `dokebi-session.secrets`) and each required secret of a settings section (D-0155); a secret someone supplies (an SMTP password) is never made up. `{ file, generatedSecrets[{plugin, option, file}], placeholders[], nextSteps }`: names only, values never shown; `placeholders` are the sample's `<…>` values still to fill (the database URL: `npx dokebi dev-infra`, the first next step). An existing file is `CONFIG_EXISTS` (never replaced); no sample is `EXAMPLE_MISSING`. Without dokebi.yaml, `doctor` (one `NOT_A_PROJECT` error), `dev-infra up`, `verify` and the other config commands answer `NOT_A_PROJECT` with this command in `details.fix` |
75
75
  | `dokebi config secret <id>.<path> [--stdin] [--rotate]` | Writes a random secret (32 bytes; a one-item list when the schema wants a list) into dokebi.yaml, or with `--stdin` a secret you were given (the token of a log receiver: `config secret logging.targets.studio.token --stdin < token.txt`, or typed without echo when stdin is a terminal; one line, at most 64 KiB, nothing or several lines is `INVALID_SET`; the result has `generated: false, stdin: true`). The value never appears in output or logs; an existing value stays (`SECRET_KEPT`, with a `hint` naming `--rotate`); an empty one (`token:`, `''`, `[]`) holds no secret and is filled, and so is the sample's placeholder (`<set the postgres URL here or run npx dokebi dev-infra>`, what `config init` lists in `placeholders`). An address (a key `url` or `uri`, or one ending in `Url` or `Uri`) is never generated: without `--stdin` it is `INVALID_SET` with `details.fix` (`config secret dokebi-db.connections.main.options.url --stdin < url.txt`). A key a provider issues (a key `apiKey` or `api_key`, or one ending in `ApiKey`, such as `dokebi-ai.connections.main.apiKey`) is never generated either: `INVALID_SET` with `details.fix` (`--stdin`). Example: `config secret dokebi-websocket-hub.secret`. `logging.<path>` is `options.logging` (the @dokebi/logger options); a list item is named by its `name` (else its `type`) or its index (`logging.targets.studio.token`, `logging.targets.3.token`); a name that is not there is `INVALID_SET` with `details.items`. A secret a plugin declares (such as `dokebi-session.secrets`) is already written by `add`; run it after you removed one. `--rotate` replaces an existing value (AI-M05): a list (`dokebi-session.secrets`, `dokebi-csrf.secrets`, `dokebi-auth.secrets`: the first signs, all verify) gets the new secret **first** and keeps the previous ones after it, at most 2 (`kept`); older ones are dropped (`dropped`, warning `SECRETS_DROPPED` with `count`), and fewer are kept when the schema allows fewer items; when the schema takes no list with a kept one (only a new string or a one-item list), every previous secret is dropped and counted the same way. A string is replaced. The result is `secret{path, list, generated, rotated, kept, dropped}` and a next step to restart the app (`dev` restarts on its own); never a value. What a rotation changes: session cookies signed with a kept secret still verify and are re-signed with the new one as they are used (@dokebi/session); CSRF tokens of a kept secret still verify (@dokebi/csrf); auth stamps signed with a kept key still verify, and remember-me and API tokens are never re-signed, so keep the old key for their longest lifetime (@dokebi/auth AI.md §9). A dropped secret (or a replaced string) invalidates what it signed: sessions end, open forms fail once, logins end. An environment override of the option (`secretsEnv`), where it is set, still wins over dokebi.yaml |
76
- | `dokebi config set <id>.<path>=<value>...` | Non-secret options into dokebi.yaml (the value is JSON when it parses, otherwise text; checked against the plugin schema, only a missing required value becomes `configRequired`). A plugin id that is not installed is `UNKNOWN_PLUGIN`; any other section nothing declares is `UNDECLARED_SECTION` (D-0155: declare it with `npx dokebi settings add <name>`). `logging.<path>` sets `options.logging` (D-0151): with @dokebi/logger every key of its schema (`config set logging.level=debug logging.targets.file.enabled=true`; list items by `name`, else `type`, or index); without it only `logging.level` and `logging.plugins.<plugin>` (core's levels), anything else is `INVALID_SET` with the add command in `fix`. An old option name (D-0071 alias, `dokebi-web.bodyLimit` of `maxBodyBytes`) and its new name both set is `INVALID_PLUGIN_OPTIONS` (`details.errors[]` with `keyword: "conflict"` and the `field`; `fix`: `config unset` the old name), since the plugin refuses both at start; nothing is written. `add` and `upgrade` write no default beside a set old name for the same reason. The results of `config set`, `unset`, `secret` and `diff --write` carry `paths`: for each file it changed, the option paths it `removed`, `set` and `added` (`{ "dokebi.yaml": { removed: ["logging.redact"], set: [], added: [] } }`; a list is one path; never a value). A path outside the ones asked for (named list items count as their list) is `PATH_MISMATCH`: refused, or a warning in a `--dry-run`, which therefore shows exactly what a run would change. Spell paths as the files do (`npx dokebi config show`; the logger's are `logging.<path>`). |
77
- | `dokebi config unset <id>[.<path>]...` | Removes options ([D-0153](https://git.nyx-zone.com/dokebi/framework/-/blob/main/docs/decisions/D-0153-config-unset.md)) from dokebi.yaml and from dokebi.example.yaml where the sample has them, in one transaction, with the mappings left empty (the plugin section stays): `{ removed: [{ option, files }], changed, warnings?, configRequired? }`. Values are never printed. A path that is not set is the warning `OPTION_NOT_SET` (a repeated call changes nothing); a secret may be removed (warning `SECRET_REMOVED`: what it signed no longer verifies; to replace one use `config secret --rotate`). The plugin need not be installed (a section `dokebi remove` kept). `logging.<path>` removes from `options.logging`, list items by `name` (else `type`) or index (`config unset logging.targets.studio` removes that target); an item that is not there is `OPTION_NOT_SET`. The removal may only leave missing required values (`configRequired`) or issues the options already had (warning `OPTIONS_STILL_INVALID` with the next `hint`); a new issue is `INVALID_PLUGIN_OPTIONS` and nothing is written. Use it for a key a plugin does not know: `INVALID_PLUGIN_OPTIONS` (from add, config set, doctor) names `npx dokebi config unset <id>.<key>` in its `fix`, and a key that moved to another plugin (`dokebi-web.files` → `dokebi-static.mounts`, D-0147) says where it went and the commands that carry it over A section a file still holds as written is that section, never the plugin the name belongs to: in a sample with the old `options.dokebi-logger` (now `options.logging`), `config unset dokebi-logger.level` removes that old key and warns `SECTION_NOT_READ`, and the live `logging.level` stays (AI-M47 report: it removed the live one before); with no such section the plugin id is `PATH_MISMATCH` (name it `logging.<path>`). List indexes and names are of each file as it is before the call, whichever name reaches the section; one item named twice (`logging.targets.studio` and its index) is removed once. A section alone (`config unset dokebi-logger`) removes a whole section nothing reads; a plugin's, the settings' or a core section (`logging`, `reload`) that way is `INVALID_SET` |
76
+ | `dokebi config set <id>.<path>=<value>... [--process <name>]` | Non-secret options into dokebi.yaml (the value is JSON when it parses, otherwise text; checked against the plugin schema, only a missing required value becomes `configRequired`). A plugin id that is not installed is `UNKNOWN_PLUGIN`; any other section nothing declares is `UNDECLARED_SECTION` (D-0155: declare it with `npx dokebi settings add <name>`). `logging.<path>` sets `options.logging` (D-0151): with @dokebi/logger every key of its schema (`config set logging.level=debug logging.targets.file.enabled=true`; list items by `name`, else `type`, or index); without it only `logging.level` and `logging.plugins.<plugin>` (core's levels), anything else is `INVALID_SET` with the add command in `fix`. An old option name (D-0071 alias, `dokebi-web.bodyLimit` of `maxBodyBytes`) and its new name both set is `INVALID_PLUGIN_OPTIONS` (`details.errors[]` with `keyword: "conflict"` and the `field`; `fix`: `config unset` the old name), since the plugin refuses both at start; nothing is written. `add` and `upgrade` write no default beside a set old name for the same reason. The results of `config set`, `unset`, `secret` and `diff --write` carry `paths`: for each file it changed, the option paths it `removed`, `set` and `added` (`{ "dokebi.yaml": { removed: ["logging.redact"], set: [], added: [] } }`; a list is one path; never a value). A path outside the ones asked for (named list items count as their list) is `PATH_MISMATCH`: refused, or a warning in a `--dry-run`, which therefore shows exactly what a run would change. Spell paths as the files do (`npx dokebi config show`; the logger's are `logging.<path>`). With `--process <name>` (D-0251) the values go to `processes.<name>.options` (what that process changes from the shared options), checked against the schema as that process reads it; the file must declare `processes` (`PROCESS_UNKNOWN` otherwise), and a name it does not declare yet is added (without `run` it then starts here too). |
77
+ | `dokebi config unset <id>[.<path>]... [--process <name>]` | Removes options ([D-0153](https://git.nyx-zone.com/dokebi/framework/-/blob/main/docs/decisions/D-0153-config-unset.md)) from dokebi.yaml and from dokebi.example.yaml where the sample has them, in one transaction, with the mappings left empty (the plugin section stays): `{ removed: [{ option, files }], changed, warnings?, configRequired? }`. Values are never printed. A path that is not set is the warning `OPTION_NOT_SET` (a repeated call changes nothing); a secret may be removed (warning `SECRET_REMOVED`: what it signed no longer verifies; to replace one use `config secret --rotate`). The plugin need not be installed (a section `dokebi remove` kept). `logging.<path>` removes from `options.logging`, list items by `name` (else `type`) or index (`config unset logging.targets.studio` removes that target); an item that is not there is `OPTION_NOT_SET`. The removal may only leave missing required values (`configRequired`) or issues the options already had (warning `OPTIONS_STILL_INVALID` with the next `hint`); a new issue is `INVALID_PLUGIN_OPTIONS` and nothing is written. Use it for a key a plugin does not know: `INVALID_PLUGIN_OPTIONS` (from add, config set, doctor) names `npx dokebi config unset <id>.<key>` in its `fix`, and a key that moved to another plugin (`dokebi-web.files` → `dokebi-static.mounts`, D-0147) says where it went and the commands that carry it over A section a file still holds as written is that section, never the plugin the name belongs to: in a sample with the old `options.dokebi-logger` (now `options.logging`), `config unset dokebi-logger.level` removes that old key and warns `SECTION_NOT_READ`, and the live `logging.level` stays (AI-M47 report: it removed the live one before); with no such section the plugin id is `PATH_MISMATCH` (name it `logging.<path>`). List indexes and names are of each file as it is before the call, whichever name reaches the section; one item named twice (`logging.targets.studio` and its index) is removed once. A section alone (`config unset dokebi-logger`) removes a whole section nothing reads; a plugin's, the settings' or a core section (`logging`, `reload`) that way is `INVALID_SET` With `--process <name>` (D-0251) only that process's own value goes (it then reads the shared one); dokebi.example.yaml is not changed. |
78
78
  | `dokebi config secrets` | The secret option paths the app needs, **by name, never values** ([D-0184](https://git.nyx-zone.com/dokebi/framework/-/blob/main/docs/decisions/D-0184-production-deploy.md)): `{ file, secretsFile, listed, secrets[{path, source, listed, required, type}], missing }` from the settings the app reads (`DOKEBI_CONFIG`, else dokebi.yaml) merged with the secrets file `DOKEBI_SECRETS` names. `source` is `config`, `secrets` or `null` (not set: absent, empty or a `<placeholder>`); `listed` means the document's `secrets:` list names it (the app refuses to start without it), `required` that an installed plugin's install plan generates it (`dokebi-session.secrets`). A secret inside a list item is named by the item where the settings name it (`logging.targets.studio.token` for `logging.targets.1.token`: its `name`, else the `type` of an item without a name, when no other item shares it): the key a secrets file fills that field with, the list staying in the settings (@dokebi/config 0.4.4). `type` is the option's JSON Schema type (`string`; `array` for a list such as `dokebi-session.secrets`, `dokebi-auth.secrets`, `dokebi-csrf.secrets`, `dokebi-mail.secrets`; several as a list; `null` without a schema): a tool that writes the secrets file writes an `array` as a YAML list, even of one value (a text there is `INVALID_PLUGIN_OPTIONS`). Exit 1 with `ok: false` while `missing` is not empty. Warnings `SECRET_IN_CONFIG_FILE` (with `DOKEBI_SECRETS` set, the settings file still holds a secret) and `SECRETS_PLAN_UNREADABLE` (a plugin's install module could not run: npm install). A secrets file readable by others, the same option in both files, or a list item the settings do not have, fails as the app would (`CONFIG_SECRETS_UNSAFE`, `CONFIG_SECRETS_CONFLICT`, `CONFIG_SECRETS_UNMATCHED`) |
79
79
  | `dokebi deploy init [--target <systemd\|compose>] [--instance <name>]... [--port <n>] [--dry-run]` | **An existing project made ready for a server** (D-0184, §11): per instance (with @dokebi/web: `production` port 3000, `staging` 3001, another name needs `--port`, two instances never share a port: `PORT_IN_USE`; without it nothing listens: no port (0, `— (no web server)` in DEPLOY.md) and `--port` is `USAGE`) `deploy/<instance>/dokebi.example.yaml` (the sample without its secrets, with the instance's web host/port/trustProxy, storage folder and a `secrets:` list), `deploy/<instance>/secrets.example.yaml` (the secret paths with placeholders; a secret inside a list item is that field only, named by the item: `logging.targets.studio.token`, the list staying in the settings sample), `deploy/systemd/<app>-<instance>.service` (or `deploy/compose/<instance>.yaml` with `--target compose`, and Dockerfile/.dockerignore when missing), with @dokebi/db also `deploy/systemd/<app>-<instance>-backup.service`/`.timer`, `deploy/backup.mjs` and `deploy/restore-drill.mjs`, and `DEPLOY.md`. Result `{ app, target, instances[{instance, port, unit, settings, secrets, code, data, logs, backups, database}], secrets, changed, unchanged, kept }`. A second run changes nothing; a file you edited since is kept (`kept`, warning `DEPLOY_FILE_KEPT`); an untouched one is rewritten (DEPLOY.md gains a new instance). Errors `NOT_A_PROJECT`, `APP_NAME_INVALID` (package.json name), `EXAMPLE_MISSING`, `PORT_REQUIRED`, `PORT_IN_USE`, `OPTIONS_SCHEMA_UNREADABLE` (npm install first: without a plugin's schema its secrets cannot be told apart) |
80
- | `dokebi deploy proxy --caddy\|--nginx --domain <host>... [--instance <name>] [--dry-run]` | The reverse proxy file of an instance (D-0184): `deploy/proxy/<app>-<instance>.Caddyfile` or `.nginx.conf`, from `deploy/<instance>/dokebi.example.yaml` (port, health routes, body limit, request timeout): TLS (Caddy's automatic certificates; nginx with certbot's paths and an http → https redirect), `X-Forwarded-For/Proto/Host`, WebSocket upgrades (nginx: other requests send no `Connection` upstream, so `keepalive 16` reuses connections, idle for at most 60 s, below the app's 72 s), unbuffered SSE (the app sends `X-Accel-Buffering: no`) and a long read timeout when the app keeps streams (SSE, WebSocket, MCP), only the listed names (nginx answers another `Host` with 421; Caddy serves only its site names), `/health/live` and `/health/ready` passed through with one `Cache-Control: no-store` (the app's own replaced), the app's own `Cache-Control` and compression left as they are. Warnings `TRUST_PROXY_MISSING` (the sample's `dokebi-web.trustProxy` lacks 127.0.0.1 or ::1) and `DOMAIN_NOT_MAPPED` (a domain not in `dokebi-app.domains`). Errors `WEB_NOT_INSTALLED`, `INSTANCE_UNKNOWN` (deploy init first) |
80
+ | `dokebi deploy proxy --caddy\|--nginx --domain <host>... [--front cloudflare\|cloudfront\|none] [--instance <name>] [--dry-run]` | The reverse proxy file of an instance (D-0184): `deploy/proxy/<app>-<instance>.Caddyfile` or `.nginx.conf`, from `deploy/<instance>/dokebi.example.yaml` (port, health routes, body limit, request timeout): TLS (Caddy's automatic certificates; nginx with certbot's paths and an http → https redirect), `X-Forwarded-For/Proto/Host`, WebSocket upgrades (nginx: other requests send no `Connection` upstream, so `keepalive 16` reuses connections, idle for at most 60 s, below the app's 72 s), unbuffered SSE (the app sends `X-Accel-Buffering: no`) and a long read timeout when the app keeps streams (SSE, WebSocket, MCP), only the listed names (nginx answers another `Host` with 421; Caddy serves only its site names), `/health/live` and `/health/ready` passed through with one `Cache-Control: no-store` (the app's own replaced), the app's own `Cache-Control` and compression left as they are. Warnings `TRUST_PROXY_MISSING` (the sample's `dokebi-web.trustProxy` lacks 127.0.0.1 or ::1) and `DOMAIN_NOT_MAPPED` (a domain not in `dokebi-app.domains`). Errors `WEB_NOT_INSTALLED`, `INSTANCE_UNKNOWN` (deploy init first) With `--nginx --front cloudflare\|cloudfront\|none` (D-0252) it writes one server on port 80 for domains a CDN ends TLS for, or reached over plain HTTP (`none`): `X-Forwarded-For $proxy_add_x_forwarded_for` (appended, never replaced), Host as sent, and the front's scheme (`$http_x_forwarded_proto`, `$http_cloudfront_forwarded_proto`, `$scheme`). Its first line `# dokebi-proxy-format: 1 front=<front>` names a stable format a server agent can copy. The app then lists the CDN in `dokebi-web.edges` (@dokebi/web AI.md §2.6). |
81
81
  | `dokebi dev-infra [up\|start\|stop\|down\|status] [--file <path>] [--db-port <n>] [--dry-run]` | Without an action: prepare compose.yaml and the database URL in dokebi.yaml; no .env is generated. With an action: run Docker Compose using the YAML password in the child environment only. Repeat --file for additional Compose files. down retains data volumes. --db-port and --dry-run apply only to preparation. On a kept compose.yaml (`COMPOSE_KEPT`, its published port is the URL's) `--db-port <n>` changes only the published host port of `services.db` in it (every other byte of the file stays) and the URL in dokebi.yaml, with the warning `COMPOSE_PORT_CHANGED` (`hint`: `dev-infra up` recreates a running container on the new port and keeps its data volume); a taken port is `PORT_IN_USE`. A port entry the CLI cannot read (a variable, a range) refuses `--db-port` with `COMPOSE_PORT_UNKNOWN` (`details.file`, `details.fix`: set the entry yourself) and nothing is written; without the flag the run keeps the URL's port and warns `COMPOSE_PORT_UNKNOWN`. A MongoDB is a single-node replica set (`rs0`, D-0103): the generated mongod gets `--replSet rs0` and a key file made inside the container at each start (mongod needs one for a replica set with authentication), the healthcheck initiates the set once and passes when the member is the writable primary (so `up` returns when transactions work), and the URL ends with `replicaSet=rs0&directConnection=true`; `service.replicaSet` says so. A kept compose.yaml whose server is standalone (written before) keeps a standalone URL and gives the warning `DEV_INFRA_STANDALONE`, whose `hint` is the switch: `dev-infra down`, move compose.yaml away, `dev-infra --db-port <its port>`, `dev-infra up` (password and data volume kept). `DEV_INFRA_CONFIG_INVALID` means the main database URL is invalid/unset; `DEV_INFRA_FAILED` means the Compose action failed. |
82
82
  | `dokebi verify [--wait-ms <n>] [--test-timeout-ms <n>]` · `verify --remote <https-url> [--timeout-ms <ms>]` | With `--remote` (D-0184) only that site is checked, nothing local runs: `{ ok, url, checks[{name, ok, warning?, status?, detail, ms}], certificate? }` with the checks `tls` (the certificate is valid for the host; under 14 days left is a warning), `redirect` (http answers a redirect to https; a warning otherwise), `live` and `ready` (the health routes of the settings when run in a project, else `/health/live` and `/health/ready`, must answer 200), `headers` (HSTS and `X-Content-Type-Options: nosniff`; on an HTML answer also `X-Frame-Options` or CSP `frame-ancestors`, and `Referrer-Policy` (a warning); `X-Powered-By` fails; HSTS under 180 days is a warning); exit 1 when a check fails. Without it: `{ ok, checks[{name, ok, skipped?, ms, code?, message?, details?}], urls[], listen[], tests?, tellUser?, relay?, finalReport?, warnings? }` (`warnings`: `ENV_DOKEBI_CONFIG_IGNORED` when `.env` sets `DOKEBI_CONFIG`, §2.2): doctor → check (`dokebi check` below, reusing the doctor result) → typecheck (skipped without the script) → build (Vite) → test (the package.json `test` script, skipped without one: `no test script`; see **Tests in verify** below) → preflight (`ALREADY_RUNNING`, `PORT_IN_USE`, `DB_URL_MISSING`; a taken web port is the user's call as in the recipe preflight: the problem has `alternative` (the first free port after it), `fix` (`npx dokebi config set dokebi-web.port=<alternative>`), `waitForUser`, `question` and `next`, and the result repeats `waitForUser`, `question` and `next`; `waitForUser` is false when the last recipe ran with `--defaults`) → start (`--wait-ms`, default 30000) → HTTP (connects to the listening address: `/health/ready`, and `GET /` with the Host header of every app domain; with neither a readiness route (`healthRoutes: false`) nor an app domain, one identity probe `GET /` that passes with any status below 500 carrying this run's header, so HTTP never passes without a request: `details.requests[].identity: true`; each request must complete within 5 s, a response cut off or never finished is `HTTP_FAILED`) → stop. `urls` are the addresses the app answers (see `start`), `listen` the bound addresses. `ok` only when everything passes (otherwise exit 1). A doctor or preflight failure skips the start; a check failure does not. It never stops an app that already runs. **HTTP counts only answers from the app verify started**: it passes a random token in `DOKEBI_VERIFY_TOKEN` and @dokebi/web echoes it in the response header `x-dokebi-verify` (only while that variable is set, no cost in production). An answer without the token comes from another server on the port: `FOREIGN_SERVER` (`details.requests[].instance: other`). When the app did not start, HTTP is skipped and fails (`NOT_STARTED`). A settings file with `dokebi-web.listen: false` (a worker process of the same code picked with `DOKEBI_CONFIG`, D-0221) skips HTTP as passed (`skipped: 'listen: false (dokebi-web): this process opens no port'`) and the preflight's port check; start still proves the app started (0.4.45) and returns at its ready signal instead of waiting out `--wait-ms` for a listening line that never comes (0.4.46). stop ends the processes verify started by the pid start returned (no `ps` needed, works in a sandbox); `APP_EXITED` when the app ended by itself first, `STOP_FAILED` when a signal cannot be sent; a SIGINT, SIGTERM or SIGHUP to verify while its app runs stops that app first (forced after 5 s), then verify ends as the signal says (also while the start step still waits for the app: nothing it started is left running). With `ok: true` and an applied recipe (`.dokebi/recipe.json`), `tellUser: string[]` holds the lines your final message must include (each choice with who made it: `<id> = <value>: your answer`, `: chosen by the AI (you left the choice to it)` followed by `: <aiReason>` when you gave one, `: chosen by default (<reason>)`; then the notices); a notice that names the app address (the admin login) is filled in with the address the app has now (`urls`, else `dokebi-web.port`), so a later port change shows the new one; with them comes `relay: { tellUser: 'verbatim', instruction }` (AI-M05 F6): copy the lines unchanged into your final message, never translated, reworded or summarized, and add your own summary only after them; when verify also has `finalReport`, the instruction adds that the table or list a heading announces (Database practice, Silenced check rules) is written right under it in the same message — a results file or a link does not replace it; the human output ends with them under `Tell the user exactly these lines.` and the same instruction. An EJS blog without @dokebi/session gets a notice that offers it to the user (AI-M05 F3: with `--defaults` the next step says not to add it, since the defaults are the plan; with `--answers-from user` the next step says to ask first). Without a recipe record there is no `tellUser`. With `ok: true` and @dokebi/db installed, `finalReport: string[]` (D-0105 §4) says what your final message must also contain, written by you rather than copied: the table of section 6 of `node_modules/@dokebi/db/AI.md`, one row per rule with the queries or jobs it applies to, the measurement and the verdict (pass, or the fix you made) (a results file does not replace it); the human output lists it under `Your final message must also contain:`, and when there are `tellUser` lines they end with a heading for each (`Database practice (@dokebi/db AI.md section 6): the table below, here in this message, has one row per rule of that section (6.1 Cost follows the page, not the table; …), …`, naming the rules of the installed AI.md, `Silenced check rules (dokebi-check allow markers), each followed below, here in this message, by why the rule does not apply there: …`): relay them as they are and write the table or the reasons under them |
83
83
  | `dokebi mail preview <name> [--locale <locale>]` | Render preview.json without network connections or data hooks; JSON includes subject, html, text and locale |
@@ -93,9 +93,9 @@ The `blog` plan, depending on the answers: `init` (when the folder is not a proj
93
93
  | `dokebi app remove <name>` · `app link <app> <domain> [--template] [--seal]` · `app unlink <domain>` · `app list` | Manage apps and domains. `app remove` fails with `APP_IN_USE` while a domain still points to the app (unlink first); it removes the registration and `options.dokebi-app.apps.<name>` (D-0061 per-app settings) from dokebi.yaml and the sample (0.2.5; otherwise the next start fails with `UNKNOWN_APP`) and the app's recorded view from `.dokebi/recipe.json`. The folder stays (user code; the result lists it in `preserved` with the warning `APP_FOLDER_KEPT`) |
94
94
  | `dokebi module add <name> [--no-views]` · `module remove` · `module list` · `module sync` | Feature modules `src/shared/modules/<name>` (D-0032). `--no-views`: the routes answer JSON. Add and remove rewrite `src/dokebi.modules.generated.ts` (D-0227, §4); `sync` writes it from the registered modules, for a project made before cli 0.4.54 |
95
95
  | `dokebi settings add <section>` · `settings sync` · `settings remove <section>` · `settings list` | The settings of the application itself in `options.<section>` (D-0155): `add` writes `src/shared/settings/<section>.ts` (core's `defineSettings` with a `defineOptions` declaration; an existing one default-exporting it is adopted), its schema `src/shared/settings/<section>.schema.json`, the defaults in dokebi.yaml and the example (with the `# reloadable` marks), and registers it, so the app checks the section at start and `config show/set/unset/secret`, doctor and reloads treat it like a plugin section. Code reads `<name>Settings.read(context.app.config)` (typed, cached per configuration, new after a reload). After changing the declaration run `settings sync` (doctor warns `SETTINGS_SCHEMA_STALE`). A value that is still the default the CLI wrote (the old schema's, such as the `pageSize: 50` and `workers: 2` placeholders of `settings add`) follows a changed default, in dokebi.yaml and the example (`sections[].followed`); a value set by hand stays. Then each section is checked against the new schema as doctor checks it: a missing required value is `configRequired`, anything else (a value set by hand above a lowered maximum, a value of an option the declaration dropped) is `INVALID_PLUGIN_OPTIONS` with `details.paths` and a `fix` (`npx dokebi config unset <paths>` or correct it by hand, then sync again), and nothing is written (AI-M49 D2: sync answered ok on what doctor and the app refuse). A section of a plugin, `logging` or `reload` is `SETTINGS_SECTION_CONFLICT`; `remove` keeps the files and the options. A section nothing declares has one code in every config command: `UNDECLARED_SECTION` (`UNKNOWN_PLUGIN` when the name is a plugin that is not installed); `config set` and `secret` refuse it, `config show` (text values hidden) and `unset` work on what is there and warn with it, and doctor and `dokebi check` (`undeclared-section`) report it |
96
- | `dokebi dev` | Development run (in the foreground). The app leads a process group of its own: what it started and left running when it stops (a restart, Ctrl+C) or crashes is ended (SIGTERM, SIGKILL after 2 s) and dev says so, so a restart never meets a port a helper of the old app holds. When `src/` or `.env` change it drains and starts again; when only `dokebi.yaml` changed it first asks the running app to read it again (D-0154): every changed option reloadable → applied without a restart (`dokebi.yaml reloaded without a restart: <paths>`), an invalid file → the app keeps its settings, anything else (an option that needs a restart, an app without reloads) → a restart as before. With a Vite config and template-inertia ≥0.1.2 it serves views from the Vite dev server with `DOKEBI_VITE_DEV=1` for **HMR** (no build needed; `.vue` and `views/` changes need no restart, D-0045). With template-inertia 0.4.0 that Vite is one host process per dev session, shared by every cluster worker and kept across app restarts (`DOKEBI_VITE_DEV_URL`, `DOKEBI_VITE_DEV_KEY`, D-0045 addendum 3); with 0.1.2 to 0.3 it runs inside the app. With an older template-inertia: a watch build and restarts. The app gets `DOKEBI_DEV=1`, so a cluster app runs one worker (`DOKEBI_DEV_WORKERS`, D-0044, D-0045), and the project's `.env`, read again at every restart (§2.2). What dev shows (the app, Vite and its own `[dokebi dev]` lines) is also written to `.dokebi/run/dev.log` (the previous session and one past 16 MB move to `dev.log.1`) and dev writes its pid to `.dokebi/run/dev.pid`, so `dokebi logs [-f]` shows the dev session from another shell (D-0201); with a terminal the app gets `DOKEBI_LOG_COLOR=1`, so the logger keeps its colours through the pipe |
97
- | `dokebi reload [--timeout-ms <ms>]` | Makes the background app (`dokebi start`) read dokebi.yaml again (D-0154): SIGHUP to the proven pid (through its log writer when this shell may not signal it), then the outcome the app wrote (`.dokebi/run/reload.json`, whatever its log level). `outcome: applied` (with `paths` and `revision`) or `unchanged`; `RELOAD_RESTART_REQUIRED` (`details.restartRequired`: nothing applied, restart to apply), `RELOAD_INVALID` (the app keeps its settings; `details` names the line or paths), `RELOAD_FAILED`, `RELOAD_UNSUPPORTED` (core older than 0.4.2, or `src/main.ts` gives the app no `configFile` or changed after the start: no signal is sent, it would end the app). Not running: exit 3. A running app also reads the file when it is saved (`options.reload.watch`) |
98
- | `dokebi start [--foreground] [--wait-ms <ms>] [--log-max-mb <MB>] [--log-files <n>]` · `stop [--timeout-ms <ms>] [--force]` · `status` · `logs [-n <lines>] [-f]` | Background run, stop, state, logs and log rotation (§2.1 below, D-0044, D-0053) |
96
+ | `dokebi dev` | Development run (in the foreground). The app leads a process group of its own: what it started and left running when it stops (a restart, Ctrl+C) or crashes is ended (SIGTERM, SIGKILL after 2 s) and dev says so, so a restart never meets a port a helper of the old app holds. When `src/` or `.env` change it drains and starts again; when only `dokebi.yaml` changed it first asks the running app to read it again (D-0154): every changed option reloadable → applied without a restart (`dokebi.yaml reloaded without a restart: <paths>`), an invalid file → the app keeps its settings, anything else (an option that needs a restart, an app without reloads) → a restart as before. With a Vite config and template-inertia ≥0.1.2 it serves views from the Vite dev server with `DOKEBI_VITE_DEV=1` for **HMR** (no build needed; `.vue` and `views/` changes need no restart, D-0045). With template-inertia 0.4.0 that Vite is one host process per dev session, shared by every cluster worker and kept across app restarts (`DOKEBI_VITE_DEV_URL`, `DOKEBI_VITE_DEV_KEY`, D-0045 addendum 3); with 0.1.2 to 0.3 it runs inside the app. With an older template-inertia: a watch build and restarts. The app gets `DOKEBI_DEV=1`, so a cluster app runs one worker (`DOKEBI_DEV_WORKERS`, D-0044, D-0045), and the project's `.env`, read again at every restart (§2.2). What dev shows (the app, Vite and its own `[dokebi dev]` lines) is also written to `.dokebi/run/dev.log` (the previous session and one past 16 MB move to `dev.log.1`) and dev writes its pid to `.dokebi/run/dev.pid`, so `dokebi logs [-f]` shows the dev session from another shell (D-0201); with a terminal the app gets `DOKEBI_LOG_COLOR=1`, so the logger keeps its colours through the pipe With `processes` in dokebi.yaml (D-0251) dev starts one app per process of `run` (`DOKEBI_PROCESS=<name>`; `processes: web, worker` is said first, with any `PROCESS_*` finding), tags each line with its process (a JSON record gets a leading `"process"` field, any other line `[<name>] `), restarts all of them on a change, reloads the settings in place only when every process applied it, and gives Vite only to processes that open the web port (template-inertia 0.4.14 then reads no build in the others). |
97
+ | `dokebi reload [--timeout-ms <ms>]` | Makes the background app (`dokebi start`) read dokebi.yaml again (D-0154): SIGHUP to the proven pid (through its log writer when this shell may not signal it), then the outcome the app wrote (`.dokebi/run/reload.json`, whatever its log level). `outcome: applied` (with `paths` and `revision`) or `unchanged`; `RELOAD_RESTART_REQUIRED` (`details.restartRequired`: nothing applied, restart to apply), `RELOAD_INVALID` (the app keeps its settings; `details` names the line or paths), `RELOAD_FAILED`, `RELOAD_UNSUPPORTED` (core older than 0.4.2, or `src/main.ts` gives the app no `configFile` or changed after the start: no signal is sent, it would end the app). Not running: exit 3. A running app also reads the file when it is saved (`options.reload.watch`) With several processes (D-0251) each one reads the file and writes its own outcome; the answer is the worst of them, with the paths of all, `processes: { <name>: <code> }`, and `details.process` naming the one that refused. |
98
+ | `dokebi start [--foreground] [--wait-ms <ms>] [--log-max-mb <MB>] [--log-files <n>]` · `stop [--timeout-ms <ms>] [--force]` · `status` · `logs [-n <lines>] [-f]` | Background run, stop, state, logs and log rotation (§2.1 below, D-0044, D-0053); with `processes` in dokebi.yaml, one app per process of `run` (D-0251, §2.1) |
99
99
 
100
100
  **Tests in verify** (D-0077 H). The `test` step runs after the build and before the preflight and the start (never next to the app). It gets the app's environment (the project's `.env` under the CLI's, `NODE_ENV=test` unless one of them sets it) and a time limit (`--test-timeout-ms`, default 300000; `TEST_TIMEOUT` when reached). `init` writes `"test": "node --test \"tests/**/*.test.ts\""`, so a `*.test.ts` file anywhere under `src` is a test (Node strips its types; none at first, which passes).
101
101
  - A script that is a plain `node … --test …` command (optionally after `KEY=value` words) runs directly with verify's own node:test reporter: `tests: { runner: 'node', total, passed, failed, skipped, todo, ms, exitCode, results[{ name, id?, ok, ms, file?, skipped?, todo?, error? }], omitted? }`. `name` is the test's name after its suites and parent tests (`suite > test`); only leaf tests are listed (and a suite or parent that failed by itself, such as a hook); `file` is relative to the project; `error` is the first line of the failure, secrets masked; when node wrote the assertion message itself (`Expected values to be strictly equal:`) the values it compared follow when they are numbers, booleans, null or upper-case codes (`401 !== 200`, `'CSRF_FAILED'`; any other string only by its length, such as a test password, and an object by its kind), and it ends with where in the test file it was thrown (`(at portal.test.ts:688)`). **`id` is a leading `[ID]` tag of the name** (`test('[TC-3] rejects a wrong password', …)`, pattern `^\[([A-Za-z][A-Za-z0-9._-]{0,63})\]\s`), else the tag of the nearest suite or parent; the framework gives it no meaning. Glob patterns are expanded by node (quote them in package.json so `npm test` runs the same files).
@@ -134,7 +134,8 @@ Most commands support `--json` (one machine document); interactive `dev`, `logs`
134
134
 
135
135
  - Every app the CLI runs (`dev`, `start`, `start --foreground`, `verify`) gets an existing project `.env` under the CLI's own environment (§2.2).
136
136
 
137
- - One project = one process (`src/main.ts`; several apps share it). Run files live in `.dokebi/run/` (`app.pid`, `app.log`, `app.log.1`…, `log-writer.log`; the `.gitignore` inside is `*`, so Git never takes them).
137
+ - One project = one entry (`src/main.ts`; several apps share it), started once, or (D-0251) once per process of one settings file.
138
+ - **Several processes from one dokebi.yaml (D-0251).** When the settings declare `processes` (each with what it changes from the shared `options`, @dokebi/config AI.md §1.2) and `run` (the ones this folder starts; default: all), `dev` and `start` start `src/main.ts` once per process of `run`, each with `DOKEBI_PROCESS=<name>`, so each reads its own options (a web process, and a worker with `dokebi-web.listen: false` that takes the job queues, runs the schedules and the outbox). Under `start` several processes run under one supervisor (the pid of the PID file): their lines go to app.log tagged with the process, `ready` comes once every process started (their IPC message or start line), `stop` and `reload` reach all of them, and one that ends while the others run is written to the log (`PROCESS_EXITED`) and ends the others, as one app's crash would. The result and `status` name `processes`. One process in `run` (a worker-only folder: another deployment of the same file with `run: [worker]`) starts alone, its lines untagged. Before the start, what the set leaves undone is a warning (also in `doctor`): `PROCESS_QUEUE_NOT_TAKEN` (a job queue no declared process takes: jobs only pile up), `PROCESS_WORK_NOT_RUN` (no process runs the outbox, the schedules or partition upkeep), `PROCESS_SCHEDULES_TWICE` (several processes run the schedules without `coordination`); two processes of `run` listening on one port (`PROCESS_PORT_SHARED`) or sharing a websocket-hub `serverId` (`PROCESS_SERVER_ID_SHARED`) are errors and refuse the start (`PROCESS_SET_INVALID`). A process declared but not in `run` counts as running elsewhere. Under `dev` a process whose own options set `application-runtime.workers` runs that many cluster workers, and `DOKEBI_DEV_WORKERS` (default 1) is for the processes that set none: dev says which got what first (`workers: web 4 (DOKEBI_DEV_WORKERS), worker 1 (its own application-runtime.workers)`). `doctor` also checks each process's own options against the plugin schemas (`INVALID_PLUGIN_OPTIONS` with `path: dokebi.yaml (processes.<name>)`). A settings file per process (`DOKEBI_CONFIG=dokebi.worker.yaml node src/main.ts`, D-0221) still works. Run files live in `.dokebi/run/` (`app.pid`, `app.log`, `app.log.1`…, `log-writer.log`; the `.gitignore` inside is `*`, so Git never takes them).
138
139
  - **Log rotation (D-0053)**: `start` launches a separate log writer process, and the writer starts the app with stdout and stderr pipes and writes `app.log` line by line. When the next line would pass `--log-max-mb` (default 50, 1–10240), it moves the file to `app.log.1` at a line boundary and keeps `--log-files` files (default 5, 1–100). Fast writes lose no line (a slow disk makes the app's writes wait). Out of range is `USAGE`, and so is combining them with `--foreground`. There is no dokebi.yaml setting (put fixed values in a package.json script). The writer ignores SIGTERM and, when the app ends (crashes included), writes one line `--- dokebi: app exited (…) ---` and ends. The app runs in a process group of its own: processes it started and left running when it ended (stopped, crashed or killed) get SIGTERM and, 2 s later, SIGKILL, and app.log says so (`--- dokebi: processes the app started were still running; ended them (…) ---`), so nothing it left holds a port after `stop` or `verify`. Start a process that must outlive the app in a group of its own (`detached: true`). The writer's own errors go to `.dokebi/run/log-writer.log` as one JSON line each (`level: error`, `code`, the full `error`): `LOG_OPEN_FAILED`, `LOG_WRITE_FAILED`, `LOG_ROTATE_FAILED`, `LOG_LINES_DROPPED`, `APP_SPAWN_FAILED`, `APP_OUTPUT_FAILED`.
139
140
  - `start`: the inspect checks (an error diagnostic is `START_CHECK_FAILED`), then a background run with `NODE_ENV=production` (kept when already set). The app also gets a random per-start `DOKEBI_INSTANCE_TOKEN`, kept with the pid, the `urls` and the log writer's loopback `control` port in `.dokebi/run/app.pid` (0600) for the proofs below; it never appears in output. When the log shows `Dokebi application started` (the line the generated main writes), or the app sends `{ dokebi: 'started' }` on its IPC channel (the generated main does after `app.start()`, so a `logging.level` above info, which hides the line, still counts as started; AI-M43), `ready: true`. The result has `logWriter` (pid), `logMaxBytes`, `logFiles`, `listen` (the bound addresses from the web server's listening line, such as `http://127.0.0.1:3000`) and `urls`, the addresses the app answers: with @dokebi/app the Host name picks the app, so `urls` are `http://<domain>:<port>` for every configured domain that resolves to this machine (`localhost`, `*.localhost`, `127.x.x.x`), plus `listen` when `unknownDomain` names an app; without @dokebi/app they equal `listen` (`0.0.0.0` shown as `127.0.0.1`). Open and test `urls`: a request to the bound IP gets 404 when that IP is not an app domain (do not add one with `app link` for that). `urls` is empty when only public domains are configured (they answer through DNS or a proxy). `dokebi dev` prints the same addresses (from `dokebi-web.port`) when it starts. Without that line within `--wait-ms` (default 10000) it reports `ready: false` and a warning, even if the process lives. When the process ends before that: `START_FAILED` (details.tail: the last 30 log lines; details.logWriterLog: the end of the writer's diagnostics). Already running: `ALREADY_RUNNING`; a SIGINT, SIGTERM or SIGHUP before `start` answered ends the log writer and the app it spawned and removes the pid file and the start lock, then the command ends as the signal says (an interrupted start leaves nothing running); another start in progress: `START_IN_PROGRESS` (one start at a time holds `.dokebi/run/start.lock` from before it checks the running state until the pid file is written, so of two concurrent starts exactly one runs the app and the other starts nothing).
140
141
  - **Without process information** (no `ps`, a sandbox blocks it, /proc unreadable; D-0073), `status`, `stop` and `start` (with a PID file) ask the app instead: `kill(pid, 0)` saying the pid does not exist makes the PID file stale; otherwise they send a random challenge in the request header `x-dokebi-instance` to the recorded address (or `dokebi-web.port` of dokebi.yaml), and @dokebi/web answers with HMAC-SHA256 of its `DOKEBI_INSTANCE_TOKEN` (the token itself never goes on the wire). Only the right answer proves the pid is this start's app: `status` then reports `proof: "http"` (no `rssMb`) and `stop` signals it (`proof: "http"` in its result). When the proof fails (no web plugin, another server on the port, a PID file of an older CLI without a token), they fail with `PROCESS_INFO_FAILED` as before (the reason in `cause`; `details.pid`, `source`, `hint` (run outside the sandbox or allow `ps` or /proc), `manualStop` (check the pid yourself, `kill -TERM <pid>`, then delete `.dokebi/run/app.pid`) and `instanceProof{tried, reason}`), signal nothing and **keep** the PID file (the app may still live). With `ps` the behaviour is unchanged (`proof: "process"`). `verify` stops the process it started seconds ago with the pid start returned (only `kill(pid, 0)` and SIGTERM).
@@ -240,9 +241,9 @@ Every command also works in an npm workspace member folder. Packages are found t
240
241
  ## 8. Error and diagnostic codes
241
242
 
242
243
  - AI entry (D-0065): `ANSWERS_REQUIRED` (exit 2), `ANSWERS_SOURCE_REQUIRED` (applying without `--answers-from user` or `--defaults`), `AI_CHOICE_UNKNOWN`, `AI_CHOICE_FIXED`, `AI_CHOICE_WITHOUT_ANSWER`, `AI_REASON_WITHOUT_CHOICE`, `INVALID_AI_REASON` (D-0095: `--ai-chose`/`--ai-reason` refused), `UNKNOWN_RECIPE`, `INVALID_ANSWER`, `OPTION_ABSENT`, `OPTION_NOT_APPLICABLE` (an answer another answer rules out: `--admin login` with `--db none`), `RECIPE_FILE_CONFLICT` (a file the recipe writes exists with other content; `details.path`, `fix`), `NOT_A_PROJECT`, `PREFLIGHT_FAILED` (details.preflight: `DOCKER_MISSING`, `PORT_IN_USE`), `RECIPE_STEP_FAILED`, `STEP_COMMAND_FAILED`, `NOT_PUBLISHED`, `NO_COMPATIBLE_VERSION`, `UNKNOWN_ADAPTER`, `ADAPTER_TEMPLATE_MISSING`, `DB_PLUGIN_MISSING`, `CONNECTION_MISSING`, `DEV_INFRA_UNSUPPORTED`, `COMPOSE_CONFLICT`, `COMPOSE_PORT_UNKNOWN`, `COMPOSE_INVALID`, `NOT_INSTALLED`, `DOC_MISSING`, `CATALOG_MISSING`, `CATALOG_INVALID`. check (D-0072): `TYPESCRIPT_UNAVAILABLE`, `TSCONFIG_INVALID`. drift (D-0120): `DRIFT_EXPECTED_INVALID`. verify check codes: `DOCTOR_FAILED`, `CHECK_FAILED` (details: `problems`), `TYPECHECK_FAILED`, `BUILD_FAILED`, `ALREADY_RUNNING`, `PORT_IN_USE`, `DB_URL_MISSING`, `NOT_READY`, `URL_UNKNOWN`, `HTTP_FAILED`, `FOREIGN_SERVER` (another server answered), `NOT_STARTED` (the app did not start, so no HTTP), `STOP_FORCED`, `APP_EXITED`, `CHECK_ERROR`, `TEST_FAILED` (details: `failures`, the counts and `exitCode`), `TEST_TIMEOUT` (the tests did not finish within `--test-timeout-ms`). Before any check, verify refuses a folder without `package.json`, `dokebi.yaml` or `.dokebi/state.json` with `NOT_A_PROJECT` (`details.file`, `details.fix`; the state file is the CLI's and belongs in version control, so a copied project needs it). The changing commands (`add`, `upgrade`, `remove`, `migrate`, `app`, `module`, `settings`, `config set`/`unset`/`secret`) and the app, module and settings lists do the same outside a project: `NOT_A_PROJECT` with `details.file` (`.dokebi/state.json`, or `dokebi.yaml` in a folder that has the state) and `details.fix`. For a missing dokebi.yaml the fix is `npx dokebi config init` (D-0163), which answers `CONFIG_EXISTS` when the file is there and `EXAMPLE_MISSING` without dokebi.example.yaml.
243
- - Commands: `USAGE`, `UNKNOWN_COMMAND`, `PROJECT_EXISTS`, `UNSUPPORTED_PROJECT`, `INVALID_SPEC`, `INVALID_PACKAGE`, `INVALID_MANIFEST`, `INCOMPATIBLE_VERSION`, `MISSING_DEPENDENCY`, `DEPENDENCY_CYCLE`, `DUPLICATE_PLUGIN`, `UNKNOWN_PLUGIN`, `REVERSE_DEPENDENCY`, `REQUIRED_PLUGIN`, `INVALID_PLUGIN_OPTIONS`, `INVALID_SET`, `PATH_MISMATCH` (config set, unset and secret: the command would change an option path it was not asked for — the plugin id `dokebi-logger` reaching `options.logging`, an old or renamed section; refused before anything is written, a warning with `--dry-run`; `details.outside` and `details.paths` name them; `config show` of such a plugin id names the section in `details.outside` and `fix`), `SAMPLE_SECRET` (`config diff --write`: the copy would leave a secret in dokebi.example.yaml; nothing written), `FILE_CONFLICT`, `PATH_CONFLICT`, `PACKAGE_CONFLICT`, `NPM_FAILED`, `REGISTRY_MISMATCH`, `INTERRUPTED` (a Ctrl+C, SIGTERM or SIGHUP before the commit: nothing applied, no lock left; run the command again), `LOCK_FAILED` (.dokebi/lock cannot be created: not writable), `PROJECT_LOCKED` (`details`: `pid`, `running`, `since` and `fix`, as doctor says it), `INVALID_ENV`, `CONCURRENT_CHANGE`, `COMMIT_FAILED`, `UPGRADE_DOWNGRADE`, `UPGRADE_IDENTITY_CHANGED`, `UPGRADE_ENTRY_MOVED`, `UPGRADE_CONFIG_CONFLICT`, `APP_EXISTS`, `APP_IN_USE`, `APPS_PRESENT`, `APP_PLUGIN_MISSING`, `DOMAIN_IN_USE`, `UNKNOWN_APP`, `UNKNOWN_DOMAIN`, `MODULE_EXISTS`, `MODULE_PLUGIN_MISSING`, `UNKNOWN_MODULE`, `HOST_MISSING`, `HOST_CONFLICT`, and for the server commands `ENTRY_MISSING`, `START_CHECK_FAILED`, `ALREADY_RUNNING`, `START_IN_PROGRESS`, `START_FAILED`, `STOP_TIMEOUT`, `STOP_FAILED` (verify could not signal the pid it started, or stop could not signal the app and its log writer could not be asked), `PROCESS_INFO_FAILED`, `NO_LOG`, `UNSUPPORTED_PLATFORM`; D-0154 `RELOAD_UNSUPPORTED`, `RELOAD_RESTART_REQUIRED`, `RELOAD_INVALID`, `RELOAD_FAILED` (`dokebi reload`); D-0155 `INVALID_SETTINGS`, `SETTINGS_EXISTS`, `SETTINGS_SECTION_CONFLICT`, `UNKNOWN_SETTINGS`, `SETTINGS_SCHEMA_FAILED`, `UNDECLARED_SECTION` (`settings` commands; doctor also `SETTINGS_SCHEMA_MISSING` and the warning `SETTINGS_SCHEMA_STALE`).
244
+ - Commands: `USAGE`, `UNKNOWN_COMMAND`, `PROJECT_EXISTS`, `UNSUPPORTED_PROJECT`, `INVALID_SPEC`, `INVALID_PACKAGE`, `INVALID_MANIFEST`, `INCOMPATIBLE_VERSION`, `MISSING_DEPENDENCY`, `DEPENDENCY_CYCLE`, `DUPLICATE_PLUGIN`, `UNKNOWN_PLUGIN`, `REVERSE_DEPENDENCY`, `REQUIRED_PLUGIN`, `INVALID_PLUGIN_OPTIONS`, `INVALID_SET`, `PROCESS_UNKNOWN` (config set or unset `--process` on a file that declares no processes, D-0251), `PROCESS_SET_INVALID` (dev or start: two processes of `run` on one port or one hub server id; `details.issues`, `fix`), `PATH_MISMATCH` (config set, unset and secret: the command would change an option path it was not asked for — the plugin id `dokebi-logger` reaching `options.logging`, an old or renamed section; refused before anything is written, a warning with `--dry-run`; `details.outside` and `details.paths` name them; `config show` of such a plugin id names the section in `details.outside` and `fix`), `SAMPLE_SECRET` (`config diff --write`: the copy would leave a secret in dokebi.example.yaml; nothing written), `FILE_CONFLICT`, `PATH_CONFLICT`, `PACKAGE_CONFLICT`, `NPM_FAILED`, `REGISTRY_MISMATCH`, `INTERRUPTED` (a Ctrl+C, SIGTERM or SIGHUP before the commit: nothing applied, no lock left; run the command again), `LOCK_FAILED` (.dokebi/lock cannot be created: not writable), `PROJECT_LOCKED` (`details`: `pid`, `running`, `since` and `fix`, as doctor says it), `INVALID_ENV`, `CONCURRENT_CHANGE`, `COMMIT_FAILED`, `UPGRADE_DOWNGRADE`, `UPGRADE_IDENTITY_CHANGED`, `UPGRADE_ENTRY_MOVED`, `UPGRADE_CONFIG_CONFLICT`, `APP_EXISTS`, `APP_IN_USE`, `APPS_PRESENT`, `APP_PLUGIN_MISSING`, `DOMAIN_IN_USE`, `UNKNOWN_APP`, `UNKNOWN_DOMAIN`, `MODULE_EXISTS`, `MODULE_PLUGIN_MISSING`, `UNKNOWN_MODULE`, `HOST_MISSING`, `HOST_CONFLICT`, and for the server commands `ENTRY_MISSING`, `START_CHECK_FAILED`, `ALREADY_RUNNING`, `START_IN_PROGRESS`, `START_FAILED`, `STOP_TIMEOUT`, `STOP_FAILED` (verify could not signal the pid it started, or stop could not signal the app and its log writer could not be asked), `PROCESS_INFO_FAILED`, `NO_LOG`, `UNSUPPORTED_PLATFORM`; D-0154 `RELOAD_UNSUPPORTED`, `RELOAD_RESTART_REQUIRED`, `RELOAD_INVALID`, `RELOAD_FAILED` (`dokebi reload`); D-0155 `INVALID_SETTINGS`, `SETTINGS_EXISTS`, `SETTINGS_SECTION_CONFLICT`, `UNKNOWN_SETTINGS`, `SETTINGS_SCHEMA_FAILED`, `UNDECLARED_SECTION` (`settings` commands; doctor also `SETTINGS_SCHEMA_MISSING` and the warning `SETTINGS_SCHEMA_STALE`).
244
245
  - `UNSUPPORTED_PROJECT`: a package.json the CLI cannot install for: npm workspaces of its own, `workspace:` or `link:` specs, URLs. A tarball dependency is fine as an absolute path or a path inside the project (`file:vendor/web-0.4.3.tgz`, as npm writes it when installed from the project; it stays relative, so the project can move). `file:~/…` (npm's form of `npm install ~/x.tgz`) is the home folder for npm, not the project, and is refused, as is an absolute path npm reads the same way (`file:/~/…`, `file://~/…`: not the folder `/~`; `dokebi add` or `upgrade --to` of such a path is `INVALID_SPEC`); a listed tarball the folder lacks (an ignored `vendor/`) is npm's `NPM_FAILED` naming the file, as for an absolute path, and a folder at its path is `UNSUPPORTED_PROJECT` with `details.path`. Outside Windows a backslash in a `file:` tarball path (`file:vendor\x.tgz`) is refused too, with `details.path` and a `fix` that writes it with `/` (npm reads it as part of a file name there and saves the path with `/`, another file; `add` or `upgrade --to` of such a path: `INVALID_SPEC`); on Windows it is a separator, as for npm. `dokebi add ./vendor/web-0.4.3.tgz` and `upgrade --to vendor/web-0.4.3.tgz` write a tarball inside the project relative too; one outside it, reached through a symbolic link that leads out, or in a project folder named `~` (npm would read the home folder), is written absolute. `INVALID_OPTIONS_SCHEMA`: a plugin's options schema cannot be checked — with `details.keyword` and `details.config` it uses an `x-dokebi-*` keyword the @dokebi/config of this CLI does not know (a schema of a newer release: run the @dokebi/cli of the same release as the plugins; nothing is damaged), with `details.validator: true` the validator itself cannot load (restore node_modules), otherwise that plugin's schema is broken (reinstall it).
245
- - Diagnostics (inspect, doctor): `ENV_DOKEBI_CONFIG_IGNORED` (warning, R4CC-7: a `.env` line sets `DOKEBI_CONFIG`, which the app never gets from there; `path` `.env:<line>`, `hint`), `MIGRATION_REQUIRED`, `CONFIG_CONFLICT`, `INVALID_CORE`, `PACKAGE_VERSION_MISMATCH`, `MISSING_CORE_DEPENDENCY`, `MISSING_PACKAGE_DEPENDENCY`, `MODIFIED_REGISTRATION`, `MODULE_LIST_MODIFIED` (D-0227: `src/dokebi.modules.generated.ts` differs from the registered modules), `MODULE_LIST_MISSING` (warning, D-0227: a project with `@dokebi/module` has no module list yet; `npx dokebi module sync`), `MODIFIED_TEMPLATE` (warning: only `owner: "cli"` files), `MANIFEST_CHANGED`, `INVALID_PLUGIN_OPTIONS`, `ENTRY_MISSING`, `LEGACY_ADMIN_SECTION` (warning, D-0115: `options.blog-admin` of an older recipe keeps working; the hint says how to rename it with the seed), `LEGACY_LAYOUT`, `TEMPLATE_FIX_MISSING` (warning: a `src/infra/db/adapters/<id>.ts` — or a copy moved or renamed under `src/`, a file that imports the driver and @dokebi/db's `ResourceAdapter` — copied from @dokebi/db's template before a fix the installed template has — the handling of a socket error of a client in use (@dokebi/db's client failure code), `lazy`, `usage`, pg `failed-connect` (a client whose connect fails ends its socket, else a URL without a password kept the process alive), mariadb `url-query` (a URL query such as `?ssl=true` is refused, not dropped) and `ipv6`, pg and mariadb `lost` (a lost connection takes readiness down at once), mysql2 and mariadb `idle` (idle connections end after `idleTimeoutMs`), pg, mysql2 and mariadb `repeats` (errors of many pooled connections at once are logged once per `logRepeatWindowMs`, the rest counted), mysql2 `connect-cause` (a pool wait that ran out while the caller's own connect was pending names it, so a frozen server takes readiness down) and `queue-leave` (a caller that gave up leaves mysql2's queue instead of counting against `maxWaiting`); and, with @dokebi/template-inertia installed, a `vite.config.*` or `vite.ssr.config.*` without `build.emptyOutDir: false` (`keep-chunks`: a rolling deploy needs the previous build's chunks) or, when the installed apps host's template has it, without `vue({ script: { fs } })` (`vue-type-files`: a page whose props type is imported from another file fails `vite build`, since TypeScript 7 gives the Vue compiler no file access), an Inertia app's `views/app.js` or `views/ssr.js` that does not import `virtual:dokebi/module-pages` while a module under `src/` keeps Vue pages in its views folder (`module-pages`, D-0218: a module page answers "Unknown page"; `details.page` names one) and a Vite config without `dokebiInertia()` while an entry imports it (`module-pages-plugin`: the build cannot resolve the import); and a `src/main.ts` that reads `process.env.DOKEBI_CONFIG ??` (`empty-config-env`, `plugin: null`: an empty `DOKEBI_CONFIG` is taken for a path and the app stops with `CONFIG_READ_FAILED`, while every CLI command reads dokebi.yaml then; the generated main.ts uses `||`; doctor only); `details.missing` and `details.template` name them, `hint` names the file and the change; the copy is yours, compare and bring them over), `RELOAD_NOT_WIRED` (warning: `src/main.ts` passes no `configFile` to `new Application` or `ClusterRunner`, so dokebi.yaml is never read again and `dokebi dev` restarts on every change, saying so; or the cluster workers' `src/infra/runtime/application.ts` builds `new Application` without it, so a worker cannot take the reload its primary asks for), `VUE_TYPECHECK_MISSING` (warning: an Inertia app under `src/apps` and a `typecheck` script without `vue-tsc`, from before `app add --inertia` prepared the Vue check; the hint lists the files and devDependencies to add), `DEV_FILES_UNGUARDED` (D-0129: an Inertia app under `src/apps` and an installed @dokebi/template-inertia without the dev file policy, so `dokebi dev` serves every project file such as `dokebi.yaml?raw`; an error when `options.dokebi-template-inertia.devHosts` is set, a warning otherwise; the hint says to upgrade the package and change secrets that were reachable), `MISSING_REQUIRED_PLUGIN`, `STALE_REQUIREMENTS`, `PLUGIN_CHECK` (details `code`, `optionPath`, and the plugin's `hint`), `GUIDE_BLOCK_MODIFIED` (warning: the installed list in AGENTS.md was edited between its markers by hand, D-0072), `GUIDE_PROJECT_BLOCK_INVALID` (warning: the `dokebi:project` markers of AGENTS.md cannot be read, D-0077), `PROJECT_LOCKED`, `RECOVERY_REQUIRED`, `UNSAFE_PATH`, `INVALID_LOGGING_CONFIG` (error: a level value of `options.logging`, or `options.logging` that is not an object), `LOGGING_PLUGIN_UNKNOWN` (warning: a level for a plugin that is not installed), `LOGGING_OPTIONS_UNUSED` (warning, D-0151: keys other than `level` and `plugins` in `options.logging` without the logger plugin; core warns the same at startup; with @dokebi/logger installed its options schema checks them as `INVALID_PLUGIN_OPTIONS`).
246
+ - Diagnostics (inspect, doctor): `PROCESS_QUEUE_NOT_TAKEN`, `PROCESS_WORK_NOT_RUN`, `PROCESS_SCHEDULES_TWICE` (warnings), `PROCESS_PORT_SHARED`, `PROCESS_SERVER_ID_SHARED` (errors; D-0251, §2.1), `ENV_DOKEBI_CONFIG_IGNORED` (warning, R4CC-7: a `.env` line sets `DOKEBI_CONFIG`, which the app never gets from there; `path` `.env:<line>`, `hint`), `MIGRATION_REQUIRED`, `CONFIG_CONFLICT`, `INVALID_CORE`, `PACKAGE_VERSION_MISMATCH`, `MISSING_CORE_DEPENDENCY`, `MISSING_PACKAGE_DEPENDENCY`, `MODIFIED_REGISTRATION`, `MODULE_LIST_MODIFIED` (D-0227: `src/dokebi.modules.generated.ts` differs from the registered modules), `MODULE_LIST_MISSING` (warning, D-0227: a project with `@dokebi/module` has no module list yet; `npx dokebi module sync`), `MODIFIED_TEMPLATE` (warning: only `owner: "cli"` files), `MANIFEST_CHANGED`, `INVALID_PLUGIN_OPTIONS`, `ENTRY_MISSING`, `LEGACY_ADMIN_SECTION` (warning, D-0115: `options.blog-admin` of an older recipe keeps working; the hint says how to rename it with the seed), `LEGACY_LAYOUT`, `TEMPLATE_FIX_MISSING` (warning: a `src/infra/db/adapters/<id>.ts` — or a copy moved or renamed under `src/`, a file that imports the driver and @dokebi/db's `ResourceAdapter` — copied from @dokebi/db's template before a fix the installed template has — the handling of a socket error of a client in use (@dokebi/db's client failure code), `lazy`, `usage`, pg `failed-connect` (a client whose connect fails ends its socket, else a URL without a password kept the process alive), mariadb `url-query` (a URL query such as `?ssl=true` is refused, not dropped) and `ipv6`, pg and mariadb `lost` (a lost connection takes readiness down at once), mysql2 and mariadb `idle` (idle connections end after `idleTimeoutMs`), pg, mysql2 and mariadb `repeats` (errors of many pooled connections at once are logged once per `logRepeatWindowMs`, the rest counted), mysql2 `connect-cause` (a pool wait that ran out while the caller's own connect was pending names it, so a frozen server takes readiness down) and `queue-leave` (a caller that gave up leaves mysql2's queue instead of counting against `maxWaiting`); and, with @dokebi/template-inertia installed, a `vite.config.*` or `vite.ssr.config.*` without `build.emptyOutDir: false` (`keep-chunks`: a rolling deploy needs the previous build's chunks) or, when the installed apps host's template has it, without `vue({ script: { fs } })` (`vue-type-files`: a page whose props type is imported from another file fails `vite build`, since TypeScript 7 gives the Vue compiler no file access), an Inertia app's `views/app.js` or `views/ssr.js` that does not import `virtual:dokebi/module-pages` while a module under `src/` keeps Vue pages in its views folder (`module-pages`, D-0218: a module page answers "Unknown page"; `details.page` names one) and a Vite config without `dokebiInertia()` while an entry imports it (`module-pages-plugin`: the build cannot resolve the import); and a `src/main.ts` that reads `process.env.DOKEBI_CONFIG ??` (`empty-config-env`, `plugin: null`: an empty `DOKEBI_CONFIG` is taken for a path and the app stops with `CONFIG_READ_FAILED`, while every CLI command reads dokebi.yaml then; the generated main.ts uses `||`; doctor only); `details.missing` and `details.template` name them, `hint` names the file and the change; the copy is yours, compare and bring them over), `RELOAD_NOT_WIRED` (warning: `src/main.ts` passes no `configFile` to `new Application` or `ClusterRunner`, so dokebi.yaml is never read again and `dokebi dev` restarts on every change, saying so; or the cluster workers' `src/infra/runtime/application.ts` builds `new Application` without it, so a worker cannot take the reload its primary asks for), `VUE_TYPECHECK_MISSING` (warning: an Inertia app under `src/apps` and a `typecheck` script without `vue-tsc`, from before `app add --inertia` prepared the Vue check; the hint lists the files and devDependencies to add), `DEV_FILES_UNGUARDED` (D-0129: an Inertia app under `src/apps` and an installed @dokebi/template-inertia without the dev file policy, so `dokebi dev` serves every project file such as `dokebi.yaml?raw`; an error when `options.dokebi-template-inertia.devHosts` is set, a warning otherwise; the hint says to upgrade the package and change secrets that were reachable), `MISSING_REQUIRED_PLUGIN`, `STALE_REQUIREMENTS`, `PLUGIN_CHECK` (details `code`, `optionPath`, and the plugin's `hint`), `GUIDE_BLOCK_MODIFIED` (warning: the installed list in AGENTS.md was edited between its markers by hand, D-0072), `GUIDE_PROJECT_BLOCK_INVALID` (warning: the `dokebi:project` markers of AGENTS.md cannot be read, D-0077), `PROJECT_LOCKED`, `RECOVERY_REQUIRED`, `UNSAFE_PATH`, `INVALID_LOGGING_CONFIG` (error: a level value of `options.logging`, or `options.logging` that is not an object), `LOGGING_PLUGIN_UNKNOWN` (warning: a level for a plugin that is not installed), `LOGGING_OPTIONS_UNUSED` (warning, D-0151: keys other than `level` and `plugins` in `options.logging` without the logger plugin; core warns the same at startup; with @dokebi/logger installed its options schema checks them as `INVALID_PLUGIN_OPTIONS`).
246
247
 
247
248
  ### Logs (D-0047)
248
249
 
@@ -294,6 +295,7 @@ One server, several instances (a staging and a production one), installed from t
294
295
  3. **The secrets file.** The settings file names the secrets it needs in a top-level `secrets:` list (`dokebi-db.connections.main.options.url`, `dokebi-session.secrets`, …); the values sit in the file the variable `DOKEBI_SECRETS` names, of the same shape (`schemaVersion: 1`, `options`). `loadConfig` of @dokebi/core (0.4.3) merges it (the app, a cluster, `dokebi-migrate` and every other loader) and refuses before anything starts: `CONFIG_SECRETS_MISSING` (a listed path empty), `CONFIG_SECRETS_UNSAFE` (the file is readable or writable by group or others: 0600 or 0400 only), `CONFIG_SECRETS_CONFLICT` (both files set the same option), `CONFIG_SECRETS_UNMATCHED` (the secrets file names a list item the settings do not have). A field of a list item comes from the secrets file by the item's name, the list staying in the settings: `logging: { targets: { studio: { token: "…" } } }` fills the token of the target named `studio` (@dokebi/config 0.4.4). The errors name paths, never values. On a development machine the secrets stay in dokebi.yaml and `DOKEBI_SECRETS` is unset. `npx dokebi config secrets --json` lists the paths to put in the secret store.
295
296
  4. Before a start, on the server: `NODE_ENV=production DOKEBI_CONFIG=… DOKEBI_SECRETS=… npx -y @dokebi/cli doctor --production --json`.
296
297
  5. A release, in DEPLOY.md's order: a new release folder (`npm ci`, `npm run build --if-present`, `npm prune --omit=dev`) → `npx dokebi-migrate up --phase pre-deploy --json` (exit 0, else stop; `LOCK_TIMEOUT`: another run holds the lock) → switch `current` and restart → `npx -y @dokebi/cli verify --remote https://<domain> --json` → `npx dokebi-migrate up --json` (post-deploy). Rollback: `current` back to the previous release; the pre-deploy migrations only added, so the database stays.
298
+ When the instance settings run several processes (`run` with more than one, D-0251), the unit is a template, `<app>-<instance>@.service`, with `DOKEBI_PROCESS=%i`: `systemctl enable <app>-<instance>@web <app>-<instance>@worker`, restarts and logs by `'<app>-<instance>@*'`; the compose file has a service `app-<process>` per process. DEPLOY.md names them.
297
299
  6. `npx dokebi deploy proxy --caddy --domain <host> --instance <name>` (or `--nginx`) for the reverse proxy.
298
300
  7. Backups (@dokebi/db): the timer runs `node deploy/backup.mjs` daily (`pg_dump -Fc` or `mongodump --archive --gzip` of every postgres or mongodb connection, mode 0600, the newest of 7 days, 4 weeks and 6 months kept, passwords only in the environment or a 0600 file, one JSON line); `node deploy/restore-drill.mjs` with `DOKEBI_RESTORE_URL` (a new, empty scratch database: the live database, by any spelling of its URL, and a database that holds a table or collection are refused) proves the newest backup restores, monthly. Copy the backups off the server. MySQL and MariaDB: `mysqldump --single-transaction` from your scheduler (not scripted).
299
301
 
package/catalog.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "$comment": "Generated by scripts/catalog/build.ts from package.json dokebiCatalog fields and packages/cli/catalog-src (D-0065). Do not edit; run node scripts/catalog/build.ts.",
3
3
  "schemaVersion": 1,
4
- "cli": "0.4.90",
4
+ "cli": "0.4.92",
5
5
  "core": {
6
6
  "package": "@dokebi/core",
7
- "version": "0.4.8"
7
+ "version": "0.4.9"
8
8
  },
9
9
  "capabilities": {
10
10
  "admin.ui": {
@@ -450,7 +450,7 @@
450
450
  {
451
451
  "id": "dokebi-app",
452
452
  "package": "@dokebi/app",
453
- "version": "0.4.14",
453
+ "version": "0.4.15",
454
454
  "kind": "plugin",
455
455
  "summary": "Several apps chosen by request domain (src/apps/<app>) with a template each; installs web, controller and template-ejs with it",
456
456
  "description": "Multiple apps per project for Dokebi: pick the app and template by request domain, with EJS and Inertia skeletons.",
@@ -480,7 +480,7 @@
480
480
  "requires": [
481
481
  {
482
482
  "id": "dokebi-web",
483
- "range": "^0.4.19",
483
+ "range": "^0.4.21",
484
484
  "package": "@dokebi/web",
485
485
  "automatic": true
486
486
  },
@@ -513,6 +513,7 @@
513
513
  ],
514
514
  "optionKeys": [
515
515
  "apps",
516
+ "domainRefreshMs",
516
517
  "domains",
517
518
  "unknownDomain"
518
519
  ],
@@ -589,7 +590,7 @@
589
590
  {
590
591
  "id": "dokebi-auth",
591
592
  "package": "@dokebi/auth",
592
- "version": "0.4.6",
593
+ "version": "0.4.7",
593
594
  "kind": "plugin",
594
595
  "summary": "Login on your own user table: sessions, remember-me, API tokens, route protection, authorize hook, password hashing, login throttling, realms; optional Google/Apple social login",
595
596
  "description": "Login for @dokebi/web on your own user table through an extension class: sessions, remember-me, API tokens (personal, access/refresh), route protection, authorization hook, password hashing, login throttling, realms.",
@@ -830,7 +831,7 @@
830
831
  {
831
832
  "id": null,
832
833
  "package": "@dokebi/cli",
833
- "version": "0.4.90",
834
+ "version": "0.4.92",
834
835
  "kind": "cli",
835
836
  "summary": "Commands to create a project, browse the plugin catalog, run recipes, install plugins and verify (dokebi)",
836
837
  "description": "Project scaffolding, plugin catalog, recipes, install and verification CLI for Dokebi.",
@@ -868,7 +869,7 @@
868
869
  {
869
870
  "id": null,
870
871
  "package": "@dokebi/cluster",
871
- "version": "0.4.3",
872
+ "version": "0.4.4",
872
873
  "kind": "library",
873
874
  "summary": "Runner that starts several app workers from a node:cluster parent process, watches them and replaces them one by one",
874
875
  "description": "node:cluster runner for Dokebi: starts, watches and rolls independent application workers.",
@@ -902,7 +903,7 @@
902
903
  {
903
904
  "id": "dokebi-config",
904
905
  "package": "@dokebi/config",
905
- "version": "0.4.6",
906
+ "version": "0.4.7",
906
907
  "kind": "required",
907
908
  "summary": "Required part of the core that reads and validates dokebi.yaml into read-only settings per app (installed automatically)",
908
909
  "description": "Validated immutable YAML configuration for Dokebi applications.",
@@ -977,7 +978,7 @@
977
978
  {
978
979
  "id": null,
979
980
  "package": "@dokebi/core",
980
- "version": "0.4.8",
981
+ "version": "0.4.9",
981
982
  "kind": "core",
982
983
  "summary": "Application core: settings loading, plugin registration, lifecycle, logger and shared libraries (required)",
983
984
  "description": "Minimal composable Node.js application and plugin lifecycle framework.",
@@ -3457,7 +3458,7 @@
3457
3458
  {
3458
3459
  "id": "dokebi-template-inertia",
3459
3460
  "package": "@dokebi/template-inertia",
3460
- "version": "0.4.13",
3461
+ "version": "0.4.15",
3461
3462
  "kind": "plugin",
3462
3463
  "summary": "Inertia (v3) server adapter: Vue 3 views, Vite build files and optional server-side rendering (SSR)",
3463
3464
  "description": "Inertia v3 server adapter for Dokebi: page JSON, Vite manifest assets and optional server-side rendering.",
@@ -3677,7 +3678,7 @@
3677
3678
  {
3678
3679
  "id": "dokebi-web",
3679
3680
  "package": "@dokebi/web",
3680
- "version": "0.4.20",
3681
+ "version": "0.4.21",
3681
3682
  "kind": "plugin",
3682
3683
  "summary": "Fastify 5 HTTP server (503 before ready, health paths, drain, zero-downtime cluster replacement, security headers and overload protection on by default)",
3683
3684
  "description": "Fastify 5 HTTP server owned by a Dokebi app: 503 before ready, health routes, drain and cluster handover.",
@@ -3722,6 +3723,7 @@
3722
3723
  "developmentErrors",
3723
3724
  "drainGraceMs",
3724
3725
  "drainIdleMs",
3726
+ "edges",
3725
3727
  "formBody",
3726
3728
  "formMaxFields",
3727
3729
  "formOldInputMaxChars",
package/dist/bin.js CHANGED
@@ -422,6 +422,19 @@ async function main() {
422
422
  if (command === 'config') {
423
423
  const action = args.shift();
424
424
  const parseSetOption = await setParser();
425
+ // D-0251: `--process <name>` (show, set, unset): the options of that process of the file.
426
+ const processAt = args.indexOf('--process');
427
+ let processName;
428
+ if (processAt >= 0) {
429
+ if (!['show', 'set', 'unset'].includes(action ?? ''))
430
+ throw new CliError('USAGE', USAGE_LINES);
431
+ processName = args[processAt + 1];
432
+ if (!processName || processName.startsWith('-'))
433
+ throw new CliError('USAGE', USAGE_LINES);
434
+ args.splice(processAt, 2);
435
+ if (args.includes('--process'))
436
+ throw new CliError('USAGE', USAGE_LINES);
437
+ }
425
438
  if (action === 'show') {
426
439
  // Read only: secrets are hidden in every mode (config-show.ts).
427
440
  if (args.length > 1 || args[0]?.startsWith('-'))
@@ -434,7 +447,7 @@ async function main() {
434
447
  // The path is checked like a --set path (segments, no prototype keys).
435
448
  const path = target && dot > 0 ? parseSetOption(`${target.slice(dot + 1)}=0`).path : [];
436
449
  const { configShow, configShowText } = await import('./config-show.js');
437
- const result = await configShow(process.cwd(), section === undefined ? undefined : { section, path });
450
+ const result = await configShow(process.cwd(), section === undefined ? undefined : { section, path }, undefined, processName);
438
451
  print('config show', result, configShowText(result));
439
452
  return;
440
453
  }
@@ -547,7 +560,7 @@ async function main() {
547
560
  if (!targets.length)
548
561
  throw new CliError('USAGE', USAGE_LINES);
549
562
  mutationStarted = true;
550
- const result = await (await newProject()).configUnset(process.cwd(), targets, dryRun);
563
+ const result = await (await newProject()).configUnset(process.cwd(), targets, dryRun, processName);
551
564
  printWarnings(result.warnings);
552
565
  print('config unset', result);
553
566
  return;
@@ -576,7 +589,7 @@ async function main() {
576
589
  if (!assignments.length)
577
590
  throw new CliError('USAGE', USAGE_LINES);
578
591
  mutationStarted = true;
579
- const result = await (await newProject()).configSet(process.cwd(), assignments, dryRun);
592
+ const result = await (await newProject()).configSet(process.cwd(), assignments, dryRun, processName);
580
593
  printWarnings(result.warnings);
581
594
  print('config set', result);
582
595
  return;
@@ -945,6 +958,7 @@ async function deployCommand(input) {
945
958
  let target;
946
959
  let port;
947
960
  let proxy;
961
+ let front;
948
962
  let dryRun = false;
949
963
  const value = (index) => {
950
964
  const text = input[index];
@@ -970,6 +984,8 @@ async function deployCommand(input) {
970
984
  proxy = arg === '--caddy' ? 'caddy' : 'nginx';
971
985
  else if (action === 'proxy' && arg === '--domain')
972
986
  domains.push(value(++index));
987
+ else if (action === 'proxy' && arg === '--front' && front === undefined)
988
+ front = value(++index);
973
989
  else
974
990
  throw new CliError('USAGE', USAGE_LINES);
975
991
  }
@@ -990,8 +1006,13 @@ async function deployCommand(input) {
990
1006
  }
991
1007
  if (!proxy || !domains.length || instances.length > 1)
992
1008
  throw new CliError('USAGE', USAGE_LINES);
1009
+ // D-0252: --front (nginx): what the domains come through; the block the server's agent copies.
1010
+ if (front !== undefined &&
1011
+ (proxy !== 'nginx' || !['cloudflare', 'cloudfront', 'none'].includes(front)))
1012
+ throw new CliError('USAGE', `--front is cloudflare, cloudfront or none, with --nginx\n${USAGE_LINES}`);
993
1013
  const result = await deploy.deployProxy(process.cwd(), {
994
1014
  proxy,
1015
+ ...(front === undefined ? {} : { front: front }),
995
1016
  domains,
996
1017
  instance: instances[0] ?? 'production',
997
1018
  dryRun,
@@ -1098,7 +1119,7 @@ async function serverCommand(input) {
1098
1119
  ? `\nlog writer diagnostics: ${result.logWriterLog}`
1099
1120
  : '';
1100
1121
  print(result, (result.running
1101
- ? `running pid ${result.pid} · up ${result.uptimeSec} s${result.rssMb !== undefined ? ` · ${result.rssMb} MB` : ''}${result.proof === 'http' ? ' · proof: http (no ps; the app answered its instance token)' : result.proof === 'log-writer' ? ' · proof: log-writer (no ps; its log writer proved the instance token)' : ''}${writer}`
1122
+ ? `running pid ${result.pid} · up ${result.uptimeSec} s${result.rssMb !== undefined ? ` · ${result.rssMb} MB` : ''}${result.proof === 'http' ? ' · proof: http (no ps; the app answered its instance token)' : result.proof === 'log-writer' ? ' · proof: log-writer (no ps; its log writer proved the instance token)' : ''}${result.processes ? `\nprocesses: ${result.processes.join(', ')}` : ''}${writer}`
1102
1123
  : result.stale
1103
1124
  ? `stopped: pid ${result.pid} exited without dokebi stop (crashed or killed); see dokebi logs`
1104
1125
  : 'stopped') +
@@ -1364,9 +1385,10 @@ await main().catch((error) => {
1364
1385
  * bound address, which answers only the Host names of the app domains) — AI-M03.
1365
1386
  */
1366
1387
  function addressLines(result) {
1388
+ const processes = result.processes ? `\nprocesses: ${result.processes.join(', ')}` : '';
1367
1389
  const same = result.urls.length === result.listen.length &&
1368
1390
  result.urls.every((url, index) => url === result.listen[index]);
1369
- return `${result.urls.length ? `\nurls: ${result.urls.join(' ')}` : ''}${result.listen.length && !same
1391
+ return `${processes}${result.urls.length ? `\nurls: ${result.urls.join(' ')}` : ''}${result.listen.length && !same
1370
1392
  ? `\nlisten: ${result.listen.join(' ')} (the bound address${result.urls.length ? '' : '; it answers only the Host names of the app domains, none of which is a loopback name such as localhost'})`
1371
1393
  : ''}`;
1372
1394
  }
@@ -62,6 +62,7 @@ export const INTEGRATION_RULES = [
62
62
  '- App logging (D-0151): log through the logger of the plugin context (context.logger in a setup or hook) or of the app (app.logger in src/main.ts), never console.log or process.stdout.write in server code (npx dokebi check warns console-output). A new project has @dokebi/logger: src/main.ts passes createLogger(document.options) from src/dokebi.generated.ts to the Application, and options.logging in dokebi.yaml sets the level, the level per plugin (plugins: { dokebi-web: warn }), the targets (stdout JSON lines, pretty lines for dokebi dev, a rotated file) and redact (keys and dot paths besides the built-in secret names such as password, token, authorization and cookie). Write a fixed English message and a code in each record and pass the error itself (error: err keeps the name, the whole message, the stack and the causes); never log request bodies, tokens or passwords on purpose. DOKEBI_LOG_LEVEL still overrides the app level. To hand records to your own code (warn and error records into an outbox item that a job sends to a central receiver in its own envelope), add a target of type sink to options.logging.targets and register its handler with sink(name, handler) of the logger plugin in the setup of the module that owns the work (the records arrive redacted, limited and level-filtered, in batches from a timer, never on the path that logs); never wrap the app logger to copy records. Turn the file target on in production on a server that keeps its own log files; containers keep stdout, and under dokebi start the log writer already rotates .dokebi/run/app.log, so the file target is skipped there. To ship records to a log receiver add a network target (D-0152): type http (NDJSON batches, for Dokebi Studio url https://log.dokebi.app/v1/logs with the token of the app server as a secret token in dokebi.yaml written by npx dokebi config secret logging.targets.<name>.token --stdin, never on a command line) or type otlp (an OpenTelemetry collector); it sends from its own worker thread, adds hostname and pid, honours Retry-After and never blocks the app. Without the plugin (npx dokebi remove @dokebi/logger) the app writes with the console logger of core. Read `node_modules/@dokebi/logger/AI.md`.',
63
63
  '- @dokebi/metrics: optional HTTP metrics; read its AI.md for collector options and endpoint exposure. Do not replace application logs or expose operational data publicly by default.',
64
64
  '- @dokebi/mail and @dokebi/auth: use queued mail and the documented reset/signup tokens, keep private links in sealed payloads, and retain mail templates even in an Inertia app.',
65
+ '- A web process and a worker process of the same code (D-0221, D-0251): declare them in dokebi.yaml, never with a second settings file made by a script. processes.<name>.options holds what each changes from the shared options (the worker: dokebi-web.listen false; the web process: consume false for the job queues, dokebi-scheduler.enabled false, dokebi-outbox.runner.enabled false) and run names the processes this folder starts; npx dokebi config set --process worker <plugin>.<path>=<value> writes them. npx dokebi dev and start then run src/main.ts once per process of run with DOKEBI_PROCESS set, restart them together and tag their log lines; doctor warns when no declared process takes a queue or runs the outbox or the schedules. A worker on another machine is another deployment of the same file with run: [worker]. Read §1.2 of `node_modules/@dokebi/config/AI.md`.',
65
66
  '- @dokebi/cluster, @dokebi/job and @dokebi/worker solve different tasks: app processes, durable jobs and CPU threads. For multiple app workers, read `node_modules/@dokebi/cluster/AI.md`, keep the runner in src/main.ts and worker factory in src/infra/runtime/application.ts, and resolve one absolute DOKEBI_CONFIG before forking. Share session/auth/rate-limit state through configured providers. A one-use value in the session (a pending consent, a form nonce, a confirmation ticket) goes through await request.session.setOnce(key, value, { ttlMs }) and await request.session.takeOnce(key), never get then delete: of two workers or a form posted twice exactly one takes it. With @dokebi/seal, share the replay nonces of sealed requests too: set dokebi-seal nonces: { driver: redis, connection: <a dokebi-redis connection> } (no WebSocket hub needed; a hub in mode: cluster also works); per-process nonces in a cluster worker refuse to start (SEAL_NONCES_NOT_SHARED). Several workers and production need Redis for the state the processes share (D-0161): dokebi-session store, dokebi-auth tokens and throttle.store, dokebi-oauth store, dokebi-rate-limit driver, dokebi-seal nonces and dokebi-websocket-hub mode: cluster, each as { driver: redis, connection: <a dokebi-redis connection> } (auth tokens and oauth may use sql). A memory store refuses to start in a cluster worker and in a deployment with NODE_ENV=production (an app the CLI runs here, dokebi start, verify or dev, sets DOKEBI_LOCAL_RUN=1 and keeps memory); npx dokebi check reports it as shared-state-memory when application-runtime.workers is above 1. One process in development keeps memory. Development uses one worker unless DOKEBI_DEV_WORKERS is set.',
66
67
  '- Configuration scope: YAML owns application/runtime settings and secrets. Keep standard tool files such as tsconfig.json, package.json and Vite configuration in their supported formats; do not delete the TypeScript project file or generate it only during checks. Editors and the CLI must see the same maintained project. If Vue tooling needs a compatible compiler version, declare and lock that toolchain explicitly without patching node_modules.',
67
68
  "- Route locking with @dokebi/auth: to lock every route by default set dokebi-auth.default: required (top level or apps.<app>.default) and open only the app's own public routes: the login page config: { auth: 'guest' }, sign-up, password reset, public pages and static files the app serves itself config: { auth: false }. Routes that framework plugins serve before a sign-in (health, template-inertia built assets and Vite dev modules, seal browser modules, OAuth and MCP endpoints, the mail development inbox) already declare auth: false, and SSE/WebSocket routes stay guarded by the default, except one for a machine client that authenticates itself (another server presenting a key of its own): its route declares config: { id, auth: false } and its own authenticate is then the only check. Do not fall back to default: optional with a hand-written route-policy test to keep login and assets reachable; check the effective rule per route with npx dokebi describe (the auth section's routes).",
package/dist/commands.js CHANGED
@@ -60,7 +60,7 @@ export const COMMANDS = [
60
60
  },
61
61
  {
62
62
  name: 'config show',
63
- usage: 'dokebi config show [<plugin-id>[.<path>]] [--json]',
63
+ usage: 'dokebi config show [<plugin-id>[.<path>]] [--process <name>] [--json]',
64
64
  summary: 'Print the options of dokebi.yaml (with schema defaults) with every secret hidden, for output you share',
65
65
  },
66
66
  {
@@ -70,12 +70,12 @@ export const COMMANDS = [
70
70
  },
71
71
  {
72
72
  name: 'config set',
73
- usage: 'dokebi config set <plugin-id>.<path>=<value>... [--dry-run] [--json]',
73
+ usage: 'dokebi config set <plugin-id>.<path>=<value>... [--process <name>] [--dry-run] [--json]',
74
74
  summary: 'Set non-secret options in dokebi.yaml (checked against the plugin schema); logging.<path> sets options.logging',
75
75
  },
76
76
  {
77
77
  name: 'config unset',
78
- usage: 'dokebi config unset <plugin-id>[.<path>]... [--dry-run] [--json]',
78
+ usage: 'dokebi config unset <plugin-id>[.<path>]... [--process <name>] [--dry-run] [--json]',
79
79
  summary: 'Remove options from dokebi.yaml (and dokebi.example.yaml where it has them), e.g. a key the plugin no longer knows; never prints values',
80
80
  },
81
81
  {
@@ -100,7 +100,7 @@ export const COMMANDS = [
100
100
  },
101
101
  {
102
102
  name: 'deploy proxy',
103
- usage: 'dokebi deploy proxy --caddy|--nginx --domain <host>... [--instance <name>] [--dry-run] [--json]',
103
+ usage: 'dokebi deploy proxy --caddy|--nginx --domain <host>... [--front cloudflare|cloudfront|none] [--instance <name>] [--dry-run] [--json]',
104
104
  summary: 'Write the reverse proxy configuration of an instance (TLS, forwarded headers, WebSocket upgrade, unbuffered SSE, /health/*, static caching) from its settings sample',
105
105
  },
106
106
  {
@@ -208,12 +208,12 @@ export const COMMANDS = [
208
208
  {
209
209
  name: 'dev',
210
210
  usage: 'dokebi dev',
211
- summary: 'Run the app in the foreground; restart it when src changes, reload dokebi.yaml in place when every changed option is reloadable',
211
+ summary: 'Run the app in the foreground (each process of run in dokebi.yaml, D-0251); restart it when src changes, reload dokebi.yaml in place when every changed option is reloadable',
212
212
  },
213
213
  {
214
214
  name: 'start',
215
215
  usage: 'dokebi start [--foreground] [--wait-ms <ms>] [--log-max-mb <MB>] [--log-files <n>] [--json]',
216
- summary: 'Start the app in the background with rotated logs in .dokebi/run',
216
+ summary: 'Start the app in the background with rotated logs in .dokebi/run (each process of run in dokebi.yaml, D-0251)',
217
217
  },
218
218
  {
219
219
  name: 'stop',
@@ -407,10 +407,14 @@ export const COMMAND_DETAILS = {
407
407
  ],
408
408
  [
409
409
  '--json',
410
- '{ value, defaults, secrets }: secrets (schema writeOnly, keys named like secret/password/token/key, a URL password) show as <secret: set>; never a value',
410
+ '{ value, defaults, secrets, process?, processes?, run? }: secrets (schema writeOnly, keys named like secret/password/token/key, a URL password) show as <secret: set>; never a value',
411
+ ],
412
+ [
413
+ '--process <name>',
414
+ 'the options that process gets (D-0251): the shared options with processes.<name>.options merged in; without it, the process DOKEBI_PROCESS names (else the only one of run), else the shared options',
411
415
  ],
412
416
  ],
413
- example: 'npx dokebi config show dokebi-web --json\nnpx dokebi config show dokebi-web.port',
417
+ example: 'npx dokebi config show dokebi-web --json\nnpx dokebi config show dokebi-web.port\nnpx dokebi config show dokebi-job --process worker',
414
418
  },
415
419
  'config diff': {
416
420
  flags: [
@@ -441,9 +445,13 @@ export const COMMAND_DETAILS = {
441
445
  '<id>.<path>=<value>',
442
446
  'JSON when it parses, else text; checked against the plugin schema. logging.<path> is options.logging (the @dokebi/logger options; without it level and plugins.<plugin> only); a list item is named by its name (else its type) or its index, as in logging.targets.file.enabled=true',
443
447
  ],
448
+ [
449
+ '--process <name>',
450
+ 'set it in processes.<name>.options (what that process changes from the shared options, D-0251), checked against the schema as that process reads it; the file must declare processes (PROCESS_UNKNOWN), a new name is added',
451
+ ],
444
452
  ['--dry-run', 'plan only'],
445
453
  ],
446
- example: 'npx dokebi config set dokebi-web.port=3000 --json\nnpx dokebi config set logging.level=debug logging.targets.file.enabled=true --json',
454
+ example: 'npx dokebi config set dokebi-web.port=3000 --json\nnpx dokebi config set logging.level=debug logging.targets.file.enabled=true --json\nnpx dokebi config set dokebi-web.listen=false dokebi-job.queues.ops.consume=true --process worker --json',
447
455
  },
448
456
  'config unset': {
449
457
  flags: [
@@ -455,9 +463,13 @@ export const COMMAND_DETAILS = {
455
463
  '<id>',
456
464
  'a whole section, only one no installed plugin reads (an old section left in the files); a plugin section is INVALID_SET (remove the plugin instead)',
457
465
  ],
466
+ [
467
+ '--process <name>',
468
+ 'remove it from processes.<name>.options only (D-0251): that process then reads the shared value; dokebi.example.yaml is not changed',
469
+ ],
458
470
  ['--dry-run', 'plan only'],
459
471
  ],
460
- example: 'npx dokebi config unset dokebi-web.files --json\nnpx dokebi config unset dokebi-web.files --dry-run --json\nnpx dokebi config unset dokebi-logger --json',
472
+ example: 'npx dokebi config unset dokebi-web.files --json\nnpx dokebi config unset dokebi-web.files --dry-run --json\nnpx dokebi config unset dokebi-logger --json\nnpx dokebi config unset dokebi-job.queues.ops.concurrency --process worker --json',
461
473
  },
462
474
  'config init': {
463
475
  flags: [
@@ -521,13 +533,17 @@ export const COMMAND_DETAILS = {
521
533
  'write deploy/proxy/<app>-<instance>.nginx.conf (certificate paths of certbot; HTTP redirected to HTTPS)',
522
534
  ],
523
535
  ['--domain <host>', 'repeatable; the first is the main name'],
536
+ [
537
+ '--front cloudflare|cloudfront|none',
538
+ "with --nginx (D-0252): one server on port 80 for domains a CDN ends TLS for (cloudflare, cloudfront) or reached over plain HTTP (none); X-Forwarded-For appended with the address nginx saw and the front's scheme header; a stable format (first line: # dokebi-proxy-format: 1) for a server agent to copy",
539
+ ],
524
540
  [
525
541
  '--instance <name>',
526
542
  'the instance whose deploy/<instance>/dokebi.example.yaml it reads (default production)',
527
543
  ],
528
544
  ['--dry-run', 'plan only'],
529
545
  ],
530
- example: 'npx dokebi deploy proxy --caddy --domain shop.example.com --json\nnpx dokebi deploy proxy --nginx --domain staging.shop.example.com --instance staging --json',
546
+ example: 'npx dokebi deploy proxy --caddy --domain shop.example.com --json\nnpx dokebi deploy proxy --nginx --domain staging.shop.example.com --instance staging --json\nnpx dokebi deploy proxy --nginx --front cloudflare --domain shop.example.com --json',
531
547
  },
532
548
  'dev-infra': {
533
549
  flags: [
@@ -25,16 +25,26 @@ export declare function resolveItems(document: Document, path: readonly string[]
25
25
  * the path as given when the item is not in this file.
26
26
  */
27
27
  export declare function namedItems(source: string, id: string, path: readonly string[]): string[] | undefined;
28
- export declare function applySetOptions(source: string, id: string, sets: readonly SetOption[]): string;
28
+ /**
29
+ * Where a plugin section lives: `options`, or (D-0251) `processes.<name>.options` of a process.
30
+ */
31
+ export declare function optionsBase(process?: string): string[];
32
+ export declare function applySetOptions(source: string, id: string, sets: readonly SetOption[],
33
+ /** D-0251: the process whose own options change (processes.<process>.options). */
34
+ process?: string): string;
29
35
  /** The value at `<id>.<path>` of a dokebi.yaml source (list items by name or index), or undefined. */
30
- export declare function optionAtPath(source: string, id: string, path: readonly string[]): unknown;
36
+ export declare function optionAtPath(source: string, id: string, path: readonly string[],
37
+ /** D-0251: in this process's own options. */
38
+ process?: string): unknown;
31
39
  /**
32
40
  * `dokebi config unset` (D-0153): removes `options.<id>.<path>` for each path that is set, and
33
41
  * the mappings this leaves empty below the plugin section (the section itself stays). Returns
34
42
  * the new source and the paths that were set; a source without any of them comes back as it is.
35
43
  * Values are never read out.
36
44
  */
37
- export declare function applyUnsetOptions(source: string, id: string, paths: readonly (readonly string[])[]): {
45
+ export declare function applyUnsetOptions(source: string, id: string, paths: readonly (readonly string[])[],
46
+ /** D-0251: the process whose own options lose the paths (processes.<process>.options). */
47
+ process?: string): {
38
48
  source: string;
39
49
  removed: string[][];
40
50
  };