hosting

POST /v1/sites/{siteId}/wordpress/cli

Run one allow-listed WP-CLI command on the site.

ຈຸດສິ້ນສຸດ hosting ທັງໝົດ

ການພິສູດຕົວຕົນ

ສົ່ງລະຫັດ API ເປັນ bearer token. ລະຫັດຕ້ອງມີສິດ sites.view; ລະຫັດທີ່ບໍ່ມີສິດດັ່ງກ່າວຈະຖືກປະຕິເສດດ້ວຍລະຫັດ 403, ບໍ່ແມ່ນ 404.

ຈຸດເຊື່ອມຕໍ່ນີ້ບໍ່ໄດ້ຮັບ ID ອົງກອນ. ລະຫັດຂອງທ່ານໄດ້ລະບຸອົງກອນທີ່ມັນຂຶ້ນກັບແລ້ວ, ແລະ ຄໍາຕອບແມ່ນຖືກຈໍາກັດຂອບເຂດໄວ້ສໍາລັບອົງກອນນັ້ນ.

ລອງໃຊ້ເບິ່ງ

ປ່ຽນແທນທຸກຢ່າງທີ່ຢູ່ໃນວົງເລັບມຸມດ້ວຍຄ່າຂອງທ່ານເອງ, ແລະ ປ່ຽນແທນຕົວແທນບ່ອນວ່າງຄີດ້ວຍຄີຈາກແຜງຄວບຄຸມຂອງທ່ານ.

curl -X POST https://api.zinndigital.com/v1/sites/{siteId}/wordpress/cli \
  -H "Authorization: Bearer zdk_live_…" \
  -H "Content-Type: application/json" \
  -d '{ "command": <string> }'

ເຂົ້າສູ່ລະບົບແລ້ວບໍ? ໂຄງສົນທະນາ API ໃນໜ້າັດສະຫຼອງຂອງທ່ານຈະຕື່ມຂໍ້ມູນລະຫັດອົງກອນຕົວຈິງ ແລະ ລະຫັດລັບສ່ວນຕົວຂອງທ່ານໂດຍອັດຕະໂນມັດ, ແລະ ປະຕິບັດການຮ້ອງຂໍຜ່ານ API ຕົວຈິງ ເພື່ອໃຫ້ທ່ານສາມາດເຫັນຜົນຕອບຮັບທີ່ແທ້ຈິງໄດ້. ເປີດຈຸດສິ້ນສຸດນີ້ໃນຄອນໂສລ API

ລາຍລະອຽດ

An audited WP-CLI console. Every invocation is recorded in the site's WordPress activity log with its argv and exit code — never its output. ⛔ **Allow-listed, never arbitrary.** An unrestricted passthrough is remote code execution as the site user: `wp eval` runs arbitrary PHP, `wp db query` runs arbitrary SQL, and `wp --require=/tmp/x.php` loads code the caller chose before WP-CLI decides what to do. The permitted commands are reads and idempotent cache operations, listed by `listWordPressCliCommands`; anything else answers `422` naming the whole list. ⛔ `config get` and `config list` are **deliberately absent** — they read `wp-config.php`, whose constants include the database password and the authentication salts. ⛔ A **non-zero `exit_code` still answers `200`.** The console's product is what WP-CLI said, and mapping a bad argument onto a 4xx would put our error page over the diagnosis the customer asked for. A `422` means *we* refused the command, which is a different answer. ⛔ The command travels in the **body**, not the path, so it never reaches a proxy or edge access log — `option get` names options a plugin may have stored a credential in. ⛔ **Fleet only** — refused where `wp_cli` is `false`. Requires `sites.view` and `sites.panel_access`.

ພາຣາມິເຕີ

ຊື່ປະເພດຕ້ອງການສິ່ງທີ່ມັນເປັນ
siteId (path)Uuidແມ່ນແລ້ວSite ID (UUIDv7).

ເນື້ອຫາຂອງຄຳຮ້ອງ

ຊື່ປະເພດຕ້ອງການສິ່ງທີ່ມັນເປັນ
commandstringແມ່ນແລ້ວThe WP-CLI command, with or without a leading `wp`.

ຖືກໂຈະ

ຊື່ປະເພດຕ້ອງການສິ່ງທີ່ມັນເປັນ
argvstring[]ແມ່ນແລ້ວWhat actually ran, after the allow-list normalised it — echoed back so `wp plugin list` and `plugin list` are visibly the same command.
exit_codeintegerແມ່ນແລ້ວWP-CLI's exit code. `0` is success.
stdoutstringແມ່ນແລ້ວWhat WP-CLI printed, up to the console's cap.
stderrstringແມ່ນແລ້ວWP-CLI's diagnostics, carried **separately** and never merged into `stdout` — WP-CLI writes PHP notices here on runs that succeed, so folding them together would corrupt the JSO…
truncatedbooleanແມ່ນແລ້ວTrue when `stdout` was cut at the cap. ⛔ Stated rather than hidden: a silently cut-off JSON document is worse than none, because it nearly parses.

ຂໍ້ຜິດພາດທີ່ຈຸດເຊື່ອມຕໍ່ນີ້ສາມາດສົ່ງຄືນໄດ້

401 · 403 · 404 · 422 · 429 · 503