RepositoryPHP
wp-cli

wp-cli/restful

Unlocking the potential of the WP REST API at the command line

155sao
13fork
0issue
2lượt xem

🚀 Mở khóa WP REST API ngay trên dòng lệnh với WP-CLI

Gói WP-CLI tự động biến mọi WP REST API endpoint thành lệnh dòng lệnh, giúp quản lý WordPress qua abstraction mô hình dữ liệu thay vì truy vấn trực tiếp bảng.

RESTful WP-CLI (từ kho wp-cli/restful) mang WP REST API lên WP-CLI. Thay vì nhớ wp post list --post_type=edd_product, bạn dùng wp rest product list. Dự án hỗ trợ --path, --ssh, --http để tương tác với bất kỳ site nào chạy WordPress 4.7+.

✨ Điểm nổi bật

  • Tự động khám phá endpoint: quét toàn bộ WP REST API trên bất kỳ site nào, đăng ký lệnh wp rest <resource>.
  • Hỗ trợ nhiều phương thức kết nối: --path=<path> (local), --ssh=<host> (remote), --http=<domain> (qua HTTP).
  • Lệnh CRUD chchuẩn: list, get, create, update, delete cho mỗi resource.
  • Thao tác cao cấp: edit (mở item trong editor), generate (tạo nội dung mẫu), diff (so sánh resource giữa môi trường).
  • Tích hợp context & filter: hỗ trợ --context, --fields, --format, --orderby, --search theo chuẩn WP REST API.
  • Hỗ trợ custom post type: tự động đăng ký cả resource tùy biến như liveblog, podcast, slack-channel.

💡 Vì sao đáng chú ý

RESTful WP-CLI không chỉ đưa REST API lên CLI — nó thay đổi cách nhìn nhận. Thay vì dò bảng wp_* hay nhớ cấu trúc post type nội bộ, bạn làm việc với abstraction mà WordPress tự hiểu: wp rest user list, wp rest post generate --count=50. Đặc biệt mạnh với workflow đa môi trường (@dev-rest, @wpdev) nhờ diff. Phù hợp dev cần tự động hoá, seed dữ liệu, hoặc so sánh staging vs production.


#WPCLI #WordPress #RESTAPI #OpenSource #TiniX

Dự án tương tự

Khám phá các dự án và mô hình AI khác có sự tương đồng.

RepositoryPython
sherlock-project/sherlock

Hunt down social media accounts by username across social networks

120.3k
Dec 2, 2026
RepositoryTypeScript
morluto/rea

Reverse engineer anything with agents, from app behavior down to native binaries.

487.0k
Dec 2, 2026
RepositoryPython
yt-dlp/yt-dlp

A feature-rich command-line audio/video downloader

212.4k
Dec 2, 2026
RepositoryPHP
wp-cli/wp-cli

⚙️ WP-CLI framework

5.2k
Nov 25, 2026
RepositoryPHP
wp-cli/profile-command

Quickly identify what's slow with WordPress

295
Nov 23, 2026
RepositoryPHP
typisttech/image-optimize-command

Easily optimize images using WP CLI

173
Nov 3, 2026
RepositoryPHP
wp-cli/entity-command

Manage WordPress comments, menus, options, posts, sites, terms, and users.

105
Nov 26, 2026
RepositoryPHP
nlemoine/wp-cli-fixtures

Easily generate custom fake data for WordPress using YAML and WP-CLI

102
Aug 29, 2025
RepositoryPHP
igorhrcek/wp-cli-secure-command

Secure package for WP CLI, built to provide an easier way of securing your WordPress installation

95
Feb 1, 2026