Configuration · Server command runner (CLI)
A root-only console that posts a named Laravel Artisan command plus a JSON parameter object to the backend and reports whether it succeeded.
| Area | Configuration |
| Routes | configuration.cli |
| Centre modules | always available |
| Staff levels | root |
| Models | cli |
| UI label | title.header.configuration.cli / menu.navbar.configuration.cli |
| Coverage | 3 use cases · 1 happy · 5 failure |
Known issues (1)
How it works
The single most privileged feature in the product — cli ability allows root and nobody else. Client-side validation requires a command name and, if parameters are supplied, that they parse as JSON (isJsonString), though that rule carries no message so a malformed payload fails silently on the field. Privacy is handled deliberately: the analytics event records only the command name and the success flag, with an explicit comment that parameters may contain sensitive data. The fetch has a .then but no .catch, so a network failure leaves the form with no feedback at all.
Use cases
Why someone opens this (3)
- Re-running a scheduled job that failed overnight without shell access.
- Clearing a cache or re-indexing after a configuration change.
- Support running a maintenance command for a specific centre.
Path map
flowchart LR F(["Server command runner CLI"]):::feat F --> H1["Command executed"]:::ok F -.-> X1["Command missing"]:::bad F -.-> X2["Parameters not valid JSON"]:::bad F -.-> X3["Command rejected"]:::bad F -.-> X4["Network failure"]:::bad F -.-> X5["Non-root user"]:::bad classDef feat fill:#566066,stroke:#566066,color:#ffffff,font-weight:bold classDef ok fill:#e3f1ea,stroke:#0d6b42,color:#0d4a2e classDef bad fill:#f7e6e2,stroke:#9a2d1c,color:#6e1f13
Happy paths
Command executed
- A root user opens Configuration → CLI.
- Enters the command name and, optionally, a valid JSON parameter object.
executeCommandposts to/api/v4/server_commands/laravel_artisan.- The response is OK, so
configuration.cli.command.successis shown and only the command name is tracked.
Failure paths
Command missing
Cause — Blank command.
What happens —
error.cli.command.required.
Parameters not valid JSON
Cause —
isJsonStringfails.What happens — The custom validation rejects but defines no
message, so the field fails without telling the user why.
Command rejected
Cause — Non-OK response.
What happens —
configuration.cli.command.failedis set as the error message.
Network failure
Cause — The fetch rejects.
What happens — No
.catch()— the promise rejection is unhandled and the UI gives no feedback whatsoever.
Non-root user
Cause — Any role other than root.
What happens —
cli#canReadfalse; the route and menu entry are unavailable.
QA checklist
Tick these off while regression-testing this feature. The boxes are plain Markdown, so progress is visible in git diffs.
- ✅ Command executed
- ⛔ Command missing
- ⛔ Parameters not valid JSON
- ⛔ Command rejected
- ⛔ Network failure
- ⛔ Non-root user
Implementation
app/controllers/configuration/cli.jsapp/routes/configuration/cli.jsapp/models/cli.jsapp/abilities/cli.js
Translation keys (5)
Key English title.header.configuration.cliExecute a command menu.navbar.configuration.cliCLI error.cli.command.requiredcli command is required configuration.cli.command.success⚠️ missing configuration.cli.command.failedcli command failed
Related
- Same area — Centre list & export · Centre editor (modules, app config, integrations) · Staff member list, deletion & restore · Staff member editor (levels, scope, API token) · Channels · Extra attributes · Email template preview & test send · Dashboard configuration · Influence zones · Server incidents · Accessibility statement · Mobile app configuration · Customer login methods (Google, Facebook) · Third-party integrations & connectors · Social wifi & location services
Generated from doc/feature-inventory.json · id config-cli · commit 276788ca6