{"id":28619602,"url":"https://github.com/wp-cli/restful","last_synced_at":"2025-06-12T04:40:36.099Z","repository":{"id":35484395,"uuid":"39753519","full_name":"wp-cli/restful","owner":"wp-cli","description":"Unlocking the potential of the WP REST API at the command line","archived":false,"fork":false,"pushed_at":"2024-11-01T08:16:18.000Z","size":194,"stargazers_count":152,"open_issues_count":3,"forks_count":13,"subscribers_count":18,"default_branch":"main","last_synced_at":"2025-06-08T23:51:37.864Z","etag":null,"topics":["api","cli","hacktoberfest","rest","rest-api","wordpress","wp-cli","wp-cli-package"],"latest_commit_sha":null,"homepage":"https://wp-cli.org/restful/","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wp-cli.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-07-27T03:37:41.000Z","updated_at":"2025-04-21T23:32:02.000Z","dependencies_parsed_at":"2024-04-15T19:02:46.694Z","dependency_job_id":null,"html_url":"https://github.com/wp-cli/restful","commit_stats":{"total_commits":170,"total_committers":14,"mean_commits":"12.142857142857142","dds":0.3411764705882353,"last_synced_commit":"52e8ef6d2d9eb112e3da9557b935110bc6bc2de8"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/wp-cli/restful","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wp-cli%2Frestful","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wp-cli%2Frestful/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wp-cli%2Frestful/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wp-cli%2Frestful/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wp-cli","download_url":"https://codeload.github.com/wp-cli/restful/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wp-cli%2Frestful/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259400359,"owners_count":22851796,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","cli","hacktoberfest","rest","rest-api","wordpress","wp-cli","wp-cli-package"],"created_at":"2025-06-12T04:40:35.340Z","updated_at":"2025-06-12T04:40:36.046Z","avatar_url":"https://github.com/wp-cli.png","language":"PHP","readme":"wp-cli/restful\n==============\n\nUnlock the potential of the WP REST API at the command line.\n\n**Warning:** This project is at a very early stage. Treat it as an experiment, and understand that breaking changes will be made without warning. The sky may also fall on your head. Using RESTful WP-CLI requires the latest nightly build of [WP-CLI](http://wp-cli.org/), which you can install with `wp cli update --nightly`.\n\nInitial development was [backed by a Kickstarter project](https://wp-cli.org/restful/). This project will evolve alongside the WP REST API's evolution in WordPress core.\n\n[![Build Status](https://travis-ci.org/wp-cli/restful.svg?branch=master)](https://travis-ci.org/wp-cli/restful)\n\nQuick links: [Using](#using) | [Installing](#installing) | [Contributing](#contributing) | [Support](#support)\n\n## Using\n\nRESTful WP-CLI makes [WP REST API](https://developer.wordpress.org/rest-api/reference/) endpoints available as [WP-CLI](http://wp-cli.org/) commands.\n\nAs WordPress becomes more of an application framework embedded into the web, RESTful WP-CLI enables WP-CLI users to interact with a given WordPress install through the higher-level, self-expressed abstraction of how WordPress understands itself. For instance, on an eCommerce website, instead of having to know data is stored as `wp post list --post_type=edd_product`, RESTful WP-CLI exposes the properly-modeled data at `wp rest product list`.\n\nHere's an overview of how RESTful WP-CLI works, in two parts.\n\n### 1. Auto-discovers WP REST API endpoints from any WordPress site running WordPress 4.7 or higher\n\nTarget a specific WordPress install with `--path=\u003cpath\u003e`, `--ssh=\u003chost\u003e`, or `--http=\u003cdomain\u003e`:\n\n```\n# The `--path=\u003cpath\u003e` global parameter tells WP-CLI to interact with a WordPress install at a given path.\n# Because this is a stock WordPress install, you see the posts, pages, and other resources you'd expect to see.\n$ wp --path=/srv/www/wordpress-develop.dev/src rest\nusage: wp rest attachment \u003ccommand\u003e\n   or: wp rest category \u003ccommand\u003e\n   or: wp rest comment \u003ccommand\u003e\n   or: wp rest page \u003ccommand\u003e\n   or: wp rest page-revision \u003ccommand\u003e\n   or: wp rest post \u003ccommand\u003e\n   or: wp rest post-revision \u003ccommand\u003e\n   or: wp rest status \u003ccommand\u003e\n   or: wp rest tag \u003ccommand\u003e\n   or: wp rest taxonomy \u003ccommand\u003e\n   or: wp rest type \u003ccommand\u003e\n   or: wp rest user \u003ccommand\u003e\n\n# The `--http=\u003cdomain\u003e` global parameter tells WP-CLI to auto-discover endpoints over HTTP.\n# Because Wired has some custom post types, they're automatically registered as WP-CLI commands.\n$ wp --http=www.wired.com rest\nusage: wp rest attachment \u003ccommand\u003e\n   or: wp rest category \u003ccommand\u003e\n   or: wp rest comment \u003ccommand\u003e\n   or: wp rest liveblog \u003ccommand\u003e\n   or: wp rest liveblog-revision \u003ccommand\u003e\n   or: wp rest page \u003ccommand\u003e\n   or: wp rest page-revision \u003ccommand\u003e\n   or: wp rest podcast \u003ccommand\u003e\n   or: wp rest post \u003ccommand\u003e\n   or: wp rest post-revision \u003ccommand\u003e\n   or: wp rest series \u003ccommand\u003e\n   or: wp rest slack-channel \u003ccommand\u003e\n   or: wp rest status \u003ccommand\u003e\n   or: wp rest tag \u003ccommand\u003e\n   or: wp rest taxonomy \u003ccommand\u003e\n   or: wp rest type \u003ccommand\u003e\n   or: wp rest user \u003ccommand\u003e\n   or: wp rest video \u003ccommand\u003e\n\n# The `--ssh=\u003chost\u003e` global parameter proxies command execution to a remote WordPress install.\n# Because runcommand has a completely custom data model, you can only interact with commands, excerpts, and sparks.\n$ wp --ssh=runcommand.io rest\nusage: wp rest command \u003ccommand\u003e\n   or: wp rest excerpt \u003ccommand\u003e\n   or: wp rest spark \u003ccommand\u003e\n```\n\n### 2. Registers WP-CLI commands for the resource endpoints it understands, in the `wp rest` namespace.\n\nIn addition to the standard list, get, create, update and delete commands, RESTful WP-CLI also registers commands for higher-level operations like `edit`, `generate` and `diff`.\n\n```\n# In this example, `@wpdev` is a WP-CLI alias to `--path=/srv/www/wordpress-develop.dev/src`.\n$ wp @wpdev rest user\nusage: wp rest user create --username=\u003cusername\u003e [--name=\u003cname\u003e] [--first_name=\u003cfirst_name\u003e] [--last_name=\u003clast_name\u003e] --email=\u003cemail\u003e [--url=\u003curl\u003e] [--description=\u003cdescription\u003e] [--nickname=\u003cnickname\u003e] [--slug=\u003cslug\u003e] [--roles=\u003croles\u003e] --password=\u003cpassword\u003e [--capabilities=\u003ccapabilities\u003e] [--porcelain]\n   or: wp rest user delete \u003cid\u003e [--force=\u003cforce\u003e] [--reassign=\u003creassign\u003e] [--porcelain]\n   or: wp rest user diff \u003calias\u003e [\u003cresource\u003e] [--fields=\u003cfields\u003e]\n   or: wp rest user edit \u003cid\u003e\n   or: wp rest user generate [--count=\u003ccount\u003e] [--format=\u003cformat\u003e] --username=\u003cusername\u003e [--name=\u003cname\u003e] [--first_name=\u003cfirst_name\u003e] [--last_name=\u003clast_name\u003e] --email=\u003cemail\u003e [--url=\u003curl\u003e] [--description=\u003cdescription\u003e] [--nickname=\u003cnickname\u003e] [--slug=\u003cslug\u003e] [--roles=\u003croles\u003e] --password=\u003cpassword\u003e [--capabilities=\u003ccapabilities\u003e] [--porcelain]\n   or: wp rest user get \u003cid\u003e [--context=\u003ccontext\u003e] [--fields=\u003cfields\u003e] [--field=\u003cfield\u003e] [--format=\u003cformat\u003e]\n   or: wp rest user list [--context=\u003ccontext\u003e] [--page=\u003cpage\u003e] [--per_page=\u003cper_page\u003e] [--search=\u003csearch\u003e] [--exclude=\u003cexclude\u003e] [--include=\u003cinclude\u003e] [--offset=\u003coffset\u003e] [--order=\u003corder\u003e] [--orderby=\u003corderby\u003e] [--slug=\u003cslug\u003e] [--roles=\u003croles\u003e] [--fields=\u003cfields\u003e] [--field=\u003cfield\u003e] [--format=\u003cformat\u003e]\n   or: wp rest user update \u003cid\u003e [--username=\u003cusername\u003e] [--name=\u003cname\u003e] [--first_name=\u003cfirst_name\u003e] [--last_name=\u003clast_name\u003e] [--email=\u003cemail\u003e] [--url=\u003curl\u003e] [--description=\u003cdescription\u003e] [--nickname=\u003cnickname\u003e] [--slug=\u003cslug\u003e] [--roles=\u003croles\u003e] [--password=\u003cpassword\u003e] [--capabilities=\u003ccapabilities\u003e] [--porcelain]\n\n# Use `wp rest * edit` to open an existing item in the editor.\n$ wp rest category edit 1 --user=daniel\n---\ndescription:\nname: Uncategorized\nslug: uncategorized\nparent: 0\n\n# Use `wp rest * generate` to generate dummy content.\n$ wp @wpdev rest post generate --count=50 --title=\"Test Post\" --user=daniel\nGenerating items  100% [==============================================] 0:01 / 0:02\n\n# Use `wp rest * diff` to diff a resource or collection of resources between environments.\n$ wp @dev-rest rest command diff @prod-rest find-unused-themes --fields=title\n(-) http://runcommand.dev/api/ (+) https://runcommand.io/api/\n  command:\n  + title: find-unused-themes\n```\n\nIf WP-CLI is operating directly against a WordPress install, you can use the `--debug` flag to track the number of queries and total execution time. This can be useful for measuring and profiling API requests.\n\n```\n$ wp rest category list --debug\nDebug (rest): REST command executed 3 queries in 0.000311 seconds. Use --debug=rest to see all queries. (1.118s)\n+---------------+\n| name          |\n+---------------+\n| Test Category |\n| Uncategorized |\n+---------------+\n```\n\nThere are many things RESTful WP-CLI can't yet do. Please [review the issue backlog](https://github.com/wp-cli/restful/issues), and open a new issue if you can't find an exising issue for your topic.\n\n## Installing\n\nInstalling this package requires WP-CLI 1.3.0-alpha or greater. Update to the latest nightly release with `wp cli update --nightly`.\n\nOnce you've done so, you can install this package with `wp package install wp-cli/restful`.\n\n## Contributing\n\nWe appreciate you taking the initiative to contribute to this project.\n\nContributing isn’t limited to just code. We encourage you to contribute in the way that best fits your abilities, by writing tutorials, giving a demo at your local meetup, helping other users with their support questions, or revising our documentation.\n\nFor a more thorough introduction, [check out WP-CLI's guide to contributing](https://make.wordpress.org/cli/handbook/contributing/). This package follows those policy and guidelines.\n\n### Reporting a bug\n\nThink you’ve found a bug? We’d love for you to help us get it fixed.\n\nBefore you create a new issue, you should [search existing issues](https://github.com/wp-cli/restful/issues?q=label%3Abug%20) to see if there’s an existing resolution to it, or if it’s already been fixed in a newer version.\n\nOnce you’ve done a bit of searching and discovered there isn’t an open or fixed issue for your bug, please [create a new issue](https://github.com/wp-cli/restful/issues/new). Include as much detail as you can, and clear steps to reproduce if possible. For more guidance, [review our bug report documentation](https://make.wordpress.org/cli/handbook/bug-reports/).\n\n### Creating a pull request\n\nWant to contribute a new feature? Please first [open a new issue](https://github.com/wp-cli/restful/issues/new) to discuss whether the feature is a good fit for the project.\n\nOnce you've decided to commit the time to seeing your pull request through, [please follow our guidelines for creating a pull request](https://make.wordpress.org/cli/handbook/pull-requests/) to make sure it's a pleasant experience. See \"[Setting up](https://make.wordpress.org/cli/handbook/pull-requests/#setting-up)\" for details specific to working on this package locally.\n\n## Support\n\nGitHub issues aren't for general support questions, but there are other venues you can try: https://wp-cli.org/#support\n\n\n*This README.md is generated dynamically from the project's codebase using `wp scaffold package-readme` ([doc](https://github.com/wp-cli/scaffold-package-command#wp-scaffold-package-readme)). To suggest changes, please submit a pull request against the corresponding part of the codebase.*\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwp-cli%2Frestful","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwp-cli%2Frestful","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwp-cli%2Frestful/lists"}