{"id":13490482,"url":"https://github.com/wp-cli/wp-cli","last_synced_at":"2025-05-12T03:47:54.499Z","repository":{"id":38814968,"uuid":"2360755","full_name":"wp-cli/wp-cli","owner":"wp-cli","description":"⚙️ WP-CLI framework","archived":false,"fork":false,"pushed_at":"2025-04-30T19:52:45.000Z","size":14870,"stargazers_count":4916,"open_issues_count":165,"forks_count":994,"subscribers_count":167,"default_branch":"main","last_synced_at":"2025-05-01T10:12:11.102Z","etag":null,"topics":["cli","framework","hacktoberfest","php","wordpress","wp-cli"],"latest_commit_sha":null,"homepage":"https://wp-cli.org/","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":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":".github/SECURITY.md","support":".github/SUPPORT.md","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2011-09-10T12:51:59.000Z","updated_at":"2025-04-30T13:11:37.000Z","dependencies_parsed_at":"2023-12-08T17:26:13.316Z","dependency_job_id":"b20fd0fa-2747-4462-8dfc-ca0abcf454d0","html_url":"https://github.com/wp-cli/wp-cli","commit_stats":{"total_commits":3434,"total_committers":230,"mean_commits":"14.930434782608696","dds":0.7335468841001747,"last_synced_commit":"2b052f9f1cd5a1773b9cdf80120b42fe60a8dcca"},"previous_names":[],"tags_count":69,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wp-cli%2Fwp-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wp-cli%2Fwp-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wp-cli%2Fwp-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wp-cli%2Fwp-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wp-cli","download_url":"https://codeload.github.com/wp-cli/wp-cli/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251857022,"owners_count":21655121,"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":["cli","framework","hacktoberfest","php","wordpress","wp-cli"],"created_at":"2024-07-31T19:00:47.273Z","updated_at":"2025-05-12T03:47:54.484Z","avatar_url":"https://github.com/wp-cli.png","language":"PHP","readme":"WP-CLI\n======\n\n[WP-CLI](https://wp-cli.org/) is the command-line interface for [WordPress](https://wordpress.org/). You can update plugins, configure multisite installations and much more, without using a web browser.\n\nOngoing maintenance is made possible by:\n\n\u003ca href=\"https://automattic.com/\" style=\"height:100px;width:30%;display:inline-block;position:relative;margin:20px;\"\u003e\u003cimg src=\"https://make.wordpress.org/cli/files/2017/04/automattic-1.png\" style=\"max-height:100%;max-width:100%;position:absolute;top:0;bottom:0;left:0;right:0;margin:auto;\" alt=\"\" width=\"320\" height=\"70\" class=\"aligncenter size-full wp-image-347\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://www.bluehost.com/\" style=\"height:100px;width:30%;display:inline-block;position:relative;margin:20px;\"\u003e\u003cimg class=\"aligncenter size-full wp-image-335\" style=\"max-height:100%;max-width:100%;position:absolute;top:0;bottom:0;left:0;right:0;margin:auto;\" src=\"https://make.wordpress.org/cli/files/2017/04/bluehost.png\" alt=\"\" width=\"320\" height=\"52\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://pantheon.io/\" style=\"height:100px;width:30%;display:inline-block;position:relative;margin:20px;\"\u003e\u003cimg class=\"aligncenter size-full wp-image-333\" style=\"max-height:100%;max-width:100%;position:absolute;top:0;bottom:0;left:0;right:0;margin:auto;\" src=\"https://make.wordpress.org/cli/files/2019/06/pantheon.png\" alt=\"\" width=\"320\" height=\"100\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://www.siteground.com/\" style=\"height:100px;width:30%;display:inline-block;position:relative;margin:20px;\"\u003e\u003cimg class=\"aligncenter size-full wp-image-332\" style=\"max-height:100%;max-width:100%;position:absolute;top:0;bottom:0;left:0;right:0;margin:auto;\" src=\"https://make.wordpress.org/cli/files/2019/06/SG_logo.png\" alt=\"\" width=\"320\" height=\"66\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://wpengine.com/\" style=\"height:100px;width:30%;display:inline-block;position:relative;margin:20px;\"\u003e\u003cimg class=\"aligncenter size-full wp-image-333\" style=\"max-height:100%;max-width:100%;position:absolute;top:0;bottom:0;left:0;right:0;margin:auto;\" src=\"https://make.wordpress.org/cli/files/2017/04/wpengine.png\" alt=\"\" width=\"320\" height=\"60\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://www.cloudways.com/\" style=\"height:100px;width:30%;display:inline-block;position:relative;margin:20px;\"\u003e\u003cimg class=\"aligncenter size-full wp-image-3229\" style=\"max-height:100%;max-width:100%;position:absolute;top:0;bottom:0;left:0;right:0;margin:auto;\" src=\"https://make.wordpress.org/cli/files/2021/02/Cloudways-Logo-e1612285267691.png\" alt=\"\" width=\"320\" height=\"62\" /\u003e\u003c/a\u003e\n\nThe current stable release is [version 2.12.0](https://make.wordpress.org/cli/2025/05/07/wp-cli-v2-12-0-release-notes/). For announcements, follow [@wpcli on Twitter](https://twitter.com/wpcli) or [sign up for email updates](https://make.wordpress.org/cli/subscribe/). [Check out the roadmap](https://make.wordpress.org/cli/handbook/roadmap/) for an overview of what's planned for upcoming releases.\n\n[![Testing](https://github.com/wp-cli/wp-cli/actions/workflows/testing.yml/badge.svg)](https://github.com/wp-cli/wp-cli/actions/workflows/testing.yml) [![Average time to resolve an issue](https://isitmaintained.com/badge/resolution/wp-cli/wp-cli.svg)](https://isitmaintained.com/project/wp-cli/wp-cli \"Average time to resolve an issue\") [![Percentage of issues still open](https://isitmaintained.com/badge/open/wp-cli/wp-cli.svg)](https://isitmaintained.com/project/wp-cli/wp-cli \"Percentage of issues still open\")\n\nQuick links: [Using](#using) \u0026#124; [Installing](#installing) \u0026#124; [Support](#support) \u0026#124; [Extending](#extending) \u0026#124; [Contributing](#contributing) \u0026#124; [Credits](#credits)\n\n## Using\n\nWP-CLI provides a command-line interface for many actions you might perform in the WordPress admin. For instance, `wp plugin install --activate` ([doc](https://developer.wordpress.org/cli/commands/plugin/install/)) lets you install and activate a WordPress plugin:\n\n```bash\n$ wp plugin install user-switching --activate\nInstalling User Switching (1.0.9)\nDownloading installation package from https://downloads.wordpress.org/plugin/user-switching.1.0.9.zip...\nUnpacking the package...\nInstalling the plugin...\nPlugin installed successfully.\nActivating 'user-switching'...\nPlugin 'user-switching' activated.\nSuccess: Installed 1 of 1 plugins.\n```\n\nWP-CLI also includes commands for many things you can't do in the WordPress admin. For example, `wp transient delete --all` ([doc](https://developer.wordpress.org/cli/commands/transient/delete/)) lets you delete one or all transients:\n\n```bash\n$ wp transient delete --all\nSuccess: 34 transients deleted from the database.\n```\n\nFor a more complete introduction to using WP-CLI, read the [Quick Start guide](https://make.wordpress.org/cli/handbook/quick-start/). Or, catch up with [shell friends](https://make.wordpress.org/cli/handbook/shell-friends/) to learn about helpful command line utilities.\n\nAlready feel comfortable with the basics? Jump into the [complete list of commands](https://developer.wordpress.org/cli/commands/) for detailed information on managing themes and plugins, importing and exporting data, performing database search-replace operations and more.\n\n## Installing\n\nDownloading the Phar file is our recommended installation method for most users. Should you need, see also our documentation on [alternative installation methods](https://make.wordpress.org/cli/handbook/installing/) ([Composer](https://make.wordpress.org/cli/handbook/installing/#installing-via-composer), [Homebrew](https://make.wordpress.org/cli/handbook/installing/#installing-via-homebrew), [Docker](https://make.wordpress.org/cli/handbook/installing/#installing-via-docker)).\n\nBefore installing WP-CLI, please make sure your environment meets the minimum requirements:\n\n- UNIX-like environment (OS X, Linux, FreeBSD, Cygwin); limited support in Windows environment\n- PHP 5.6 or later\n- WordPress 3.7 or later. Versions older than the latest WordPress release may have degraded functionality\n\nOnce you've verified requirements, download the [wp-cli.phar](https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar) file using `wget` or `curl`:\n\n```bash\ncurl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar\n```\n\nNext, check the Phar file to verify that it's working:\n\n```bash\nphp wp-cli.phar --info\n```\n\nTo use WP-CLI from the command line by typing `wp`, make the file executable and move it to somewhere in your PATH. For example:\n\n```bash\nchmod +x wp-cli.phar\nsudo mv wp-cli.phar /usr/local/bin/wp\n```\n\nIf WP-CLI was installed successfully, you should see something like this when you run `wp --info`:\n\n```bash\n$ wp --info\nOS:     Linux 5.10.60.1-microsoft-standard-WSL2 #1 SMP Wed Aug 25 23:20:18 UTC 2021 x86_64\nShell:  /usr/bin/zsh\nPHP binary:     /usr/bin/php8.1\nPHP version:    8.1.0\nphp.ini used:   /etc/php/8.1/cli/php.ini\nMySQL binary:   /usr/bin/mysql\nMySQL version:  mysql  Ver 8.0.27-0ubuntu0.20.04.1 for Linux on x86_64 ((Ubuntu))\nSQL modes:\nWP-CLI root dir:        /home/wp-cli/\nWP-CLI vendor dir:      /home/wp-cli/vendor\nWP_CLI phar path:\nWP-CLI packages dir:    /home/wp-cli/.wp-cli/packages/\nWP-CLI global config:\nWP-CLI project config:  /home/wp-cli/wp-cli.yml\nWP-CLI version: 2.12.0\n```\n\n### Updating\n\nYou can update WP-CLI with `wp cli update` ([doc](https://developer.wordpress.org/cli/commands/cli/update/)), or by repeating the installation steps.\n\nIf WP-CLI is owned by root or another system user, you'll need to run `sudo wp cli update`.\n\nWant to live life on the edge? Run `wp cli update --nightly` to use the latest nightly build of WP-CLI. The nightly build is more or less stable enough for you to use in your development environment, and always includes the latest and greatest WP-CLI features.\n\n### Tab completions\n\nWP-CLI also comes with a tab completion script for Bash and ZSH. Just download [wp-completion.bash](https://raw.githubusercontent.com/wp-cli/wp-cli/v2.6.0/utils/wp-completion.bash) and source it from `~/.bash_profile`:\n\n```bash\nsource /FULL/PATH/TO/wp-completion.bash\n```\n\nDon't forget to run `source ~/.bash_profile` afterwards.\n\nIf using zsh for your shell, you may need to load and start `bashcompinit` before sourcing. Put the following in your `.zshrc`:\n\n```bash\nautoload bashcompinit\nbashcompinit\nsource /FULL/PATH/TO/wp-completion.bash\n```\n\n## Support\n\nWP-CLI's maintainers and contributors have limited availability to address general support questions. The [current version of WP-CLI](https://make.wordpress.org/cli/handbook/roadmap/) is the only officially supported version.\n\nWhen looking for support, please first search for your question in these venues:\n\n* [Common issues and their fixes](https://make.wordpress.org/cli/handbook/common-issues/)\n* [WP-CLI handbook](https://make.wordpress.org/cli/handbook/)\n* [Open or closed issues in the WP-CLI GitHub organization](https://github.com/issues?utf8=%E2%9C%93\u0026q=sort%3Aupdated-desc+org%3Awp-cli+is%3Aissue)\n* [Threads tagged 'WP-CLI' in the WordPress.org support forum](https://wordpress.org/support/topic-tag/wp-cli/)\n* [Questions tagged 'WP-CLI' in the WordPress StackExchange](https://wordpress.stackexchange.com/questions/tagged/wp-cli)\n\nIf you didn't find an answer in one of the venues above, you can:\n\n* Join the `#cli` channel in the [WordPress.org Slack](https://make.wordpress.org/chat/) to chat with whomever might be available at the time. This option is best for quick questions.\n* [Post a new thread](https://wordpress.org/support/forum/wp-advanced/#new-post) in the WordPress.org support forum and tag it 'WP-CLI' so it's seen by the community.\n\nGitHub issues are meant for tracking enhancements to and bugs of existing commands, not general support. Before submitting a bug report, please [review our best practices](https://make.wordpress.org/cli/handbook/bug-reports/) to help ensure your issue is addressed in a timely manner.\n\nPlease do not ask support questions on Twitter. Twitter isn't an acceptable venue for support because: 1) it's hard to hold conversations in under 280 characters, and 2) Twitter isn't a place where someone with your same question can search for an answer in a prior conversation.\n\nRemember, libre != gratis; the open source license grants you the freedom to use and modify, but not commitments of other people's time. Please be respectful, and set your expectations accordingly.\n\n## Extending\n\nA **command** is the atomic unit of WP-CLI functionality. `wp plugin install` ([doc](https://developer.wordpress.org/cli/commands/plugin/install/)) is one command. `wp plugin activate` ([doc](https://developer.wordpress.org/cli/commands/plugin/activate/)) is another.\n\nWP-CLI supports registering any callable class, function, or closure as a command. It reads usage details from the callback's PHPdoc. `WP_CLI::add_command()` ([doc](https://make.wordpress.org/cli/handbook/internal-api/wp-cli-add-command/)) is used for both internal and third-party command registration.\n\n```php\n/**\n * Delete an option from the database.\n *\n * Returns an error if the option didn't exist.\n *\n * ## OPTIONS\n *\n * \u003ckey\u003e\n * : Key for the option.\n *\n * ## EXAMPLES\n *\n *     $ wp option delete my_option\n *     Success: Deleted 'my_option' option.\n */\n$delete_option_cmd = function( $args ) {\n\tlist( $key ) = $args;\n\n\tif ( ! delete_option( $key ) ) {\n\t\tWP_CLI::error( \"Could not delete '$key' option. Does it exist?\" );\n\t} else {\n\t\tWP_CLI::success( \"Deleted '$key' option.\" );\n\t}\n};\nWP_CLI::add_command( 'option delete', $delete_option_cmd );\n```\n\nWP-CLI comes with dozens of commands. It's easier than it looks to create a custom WP-CLI command. Read the [commands cookbook](https://make.wordpress.org/cli/handbook/commands-cookbook/) to learn more. Browse the [internal API docs](https://make.wordpress.org/cli/handbook/internal-api/) to discover a variety of helpful functions you can use in your custom WP-CLI command.\n\n## Contributing\n\nWe appreciate you taking the initiative to contribute to WP-CLI. It’s because of you, and the community around you, that WP-CLI is such a great project.\n\n**Contributing 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\nRead through our [contributing guidelines in the handbook](https://make.wordpress.org/cli/handbook/contributing/) for a thorough introduction to how you can get involved. Following these guidelines helps to communicate that you respect the time of other contributors on the project. In turn, they’ll do their best to reciprocate that respect when working with you, across timezones and around the world.\n\n## Leadership\n\nWP-CLI has one project maintainer: [schlessera](http://github.com/schlessera).\n\nOn occasion, we [grant write access to contributors](https://make.wordpress.org/cli/handbook/committers-credo/) who have demonstrated, over a period of time, that they are capable and invested in moving the project forward.\n\nRead the [governance document in the handbook](https://make.wordpress.org/cli/handbook/governance/) for more operational details about the project.\n\n## Credits\n\nBesides the libraries defined in [composer.json](composer.json), we have used code or ideas from the following projects:\n\n* [Drush](https://github.com/drush-ops/drush) for... a lot of things\n* [wpshell](https://code.trac.wordpress.org/browser/wpshell) for `wp shell`\n* [Regenerate Thumbnails](https://wordpress.org/plugins/regenerate-thumbnails/) for `wp media regenerate`\n* [Search-Replace-DB](https://github.com/interconnectit/Search-Replace-DB) for `wp search-replace`\n* [WordPress-CLI-Exporter](https://github.com/Automattic/WordPress-CLI-Exporter) for `wp export`\n* [WordPress-CLI-Importer](https://github.com/Automattic/WordPress-CLI-Importer) for `wp import`\n* [wordpress-plugin-tests](https://github.com/benbalter/wordpress-plugin-tests/) for `wp scaffold plugin-tests`\n","funding_links":[],"categories":["PHP","Dev Tools","Tools","前端开发框架及项目","Development","Programming Languages","Official links"],"sub_categories":["其他_文本生成、文本对话","Web Development","PHP"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwp-cli%2Fwp-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwp-cli%2Fwp-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwp-cli%2Fwp-cli/lists"}