Developers
WP-CLI commands
Every command starts with wp cliedesk. Run wp help cliedesk <command> for all
options.
Rules for every command:
- Exit code 0 on success, not 0 on failure. Errors print the error code and message.
- Commands with
--format=jsonprint valid JSON. - Commands run as the system (shown as
wp-cliin the audit log). Add--user=<id>to run with that person’s permissions and scope. - With Cliedesk Pro: a sensitive Action (one that asks for your password in the app) runs from the command line only
with
--user=<id|login|email>. That person needs the permission, and the password question is skipped (the shell is trusted).wp cliedesk action run <sensitive Action>without--userstops withcliedesk_pro_cli_user_required, because what it creates needs an owner (for example a webhook sends what its owner may see). Pro commands that name the owner themselves (wp cliedesk api key create --owner=…) work as before. - Changes go through the same Actions as the app, so they are validated and audited.
Health and rescue
| Command | What it does |
|---|---|
health [--format=table|json] |
Runs the Setup Health checks. Exit code 1 when a check is critical. Use it in CI/CD. |
app slug get|set|check|reset [<slug>] [--force] |
Reads or changes the app address (/desk). |
app flush |
Flushes the rewrite rules. |
safe-mode status|on|off |
Shows safe mode, turns it on, or confirms production (off). |
automation pause|resume|status |
Stops or restarts every rule. |
automation export [--file=<path>], automation import <file> |
Rules as JSON. Imported rules arrive paused. |
roles list, roles reset [<role>] |
Lists roles, or restores the default roles and gives the Owner every capability. |
security set <key> <value> |
Changes require_2fa, twofa_grace_days, max_session_hours, idle_minutes or sudo_minutes. |
security set ip_allowlist off, security set sso_required off |
Pro emergency switches: turn the IP allowlist or “Require SSO” off, in every licence state (audited). Only off works here; turning them on needs the lock-out check in Cliedesk. See Sign-in and network access. |
lockdown on --reason=<text>, lockdown off |
Emergency lockdown. |
vault status|rekey|test |
Credential vault: key source, re-encrypt under the current key, self-test. |
audit verify |
Verifies the audit log hash chain. |
Jobs and database
| Command | What it does |
|---|---|
jobs run [--queues=<list>] [--time-limit=<s>] |
Runs due jobs. Call it every minute from a real cron job. |
jobs status, jobs dead-letters list|retry|discard [<id>] |
Queue counts and failed jobs. |
db status|migrate, db verify [--fix] |
Schema state, migrations and table checks. |
Support data
| Command | What it does |
|---|---|
conversation list [--status=open|closed] [--limit=<n>] [--format=table|json|csv] |
Recent conversations. |
conversation get <number> [--format=json|yaml] |
One conversation. |
contact find <email> [--format=json|yaml] |
Finds a contact. Exit code 1 when nobody matches. |
event track <who> <type> [--data=<json>] |
Records a customer event. |
import contacts <file>, import organizations <file> |
CSV import with --map, --mode=fill|overwrite, --dry-run. |
triage export [--file=<path>], triage import <file> |
Topics and triage fields as JSON. |
Privacy and data
| Command | What it does |
|---|---|
privacy export <email>, privacy erase <email> [--yes] |
The same exporters and erasers as the WordPress privacy tools. |
retention run |
Applies the retention rules now. |
export |
Builds the full data export (ZIP). With --user=<admin>, emails that admin a link. |
config export [--file=<path>], config import <file> [--dry-run] |
Configuration as versioned JSON, the same as Move configuration in the app. |
data purge --yes [--keep-data], data cancel |
Removes all Cliedesk data now, or cancels a scheduled deletion. purge cannot be undone. |
Settings and Actions
| Command | What it does |
|---|---|
settings get <module>, settings set <module> <key> <json>, settings export |
Read and change settings (validated and versioned). |
action list |
Lists every Action. |
action run <name> [--input=<json>] [--dry-run] [--idempotency-key=<key>] |
Runs any Action. |
Development only
seed adds test data and bench inbox|contacts times the lists. Both refuse on a production site unless you add
--force.
Other plugins add commands on the cliedesk_register_cli action. Help-desk importers, AI commands and
wp cliedesk report (report numbers and datasets as JSON or CSV) come with Cliedesk Pro and do not exist in Free.
wp cliedesk api key create|list|revoke (Public API keys, see Public API) is Pro too, and so is
wp cliedesk ai status|off|on|usage (the AI kill switch and AI usage and cost, see AI gateway).
wp cliedesk kb-import list|preview <tool>|run <tool>|status|resume|rollback|cancel (Pro) imports help
center articles from another help desk with the same Actions as the screen; --now works the run or rollback in
the shell until it ends, rollback asks first (or --yes). Connections and keys are saved in the screen only.
Examples:
wp cliedesk health --format=json
wp cliedesk conversation list --status=open --format=json
wp cliedesk import contacts customers.csv --dry-run
wp cliedesk config import config.json --dry-run