blog

VCCWではじめるWordpress シリーズVCCWでWP-CLI(A command line interface for WordPress)を試す

    • Ryuichi Nonaka
    この記事は書かれてから1年以上経過しており、内容が古い場合があります。

    はじめに

    せっかくなのでVCCWにインストールされているWP-CLIを試してみることにしました。

    VCCWについて

    VCCWの環境構築についてはこちらの記事Vagrant + Chef ベースのWordpress Theme / Plugin 開発環境「VCCW」を参考にしてください。

    WP-CLIについて

    WP-CLIはコマンドラインからWordpressの各種操作を行えるツールです。今回はVCCWにインストールされているもので試しますが、単体でも利用できます。インストール方法はwp-cli.orgをチェックしてください。

    仮想環境にSSH接続する

    すでにVagrant環境及びVCCWをインストールし$ vagrant upが実行可能という前提で進めます。まずは仮想環境にSSH接続しましょう。

    $ vagrant up
    $ vagrant ssh
    [vagrant@wordpress ~]$
    

    ここからはすべて仮想環境でコマンドを実行します。

    コマンドの種類

    wp-cli.orgのCommandsにコマンドの一覧があります。とりあえず参照系のコマンドだけ試してみる(わかりやすいコマンドを抜粋して実行してみます)。

    cli (Get information about WP-CLI itself.)

    WP-CLIに関する情報を表示します。

    WP-CLIの更新確認

    http://wp-cli.org/commands/cli/check-update/

    $ wp cli check-update
    Success: WP-CLI is at the latest version.
    

    WP-CLIの情報

    http://wp-cli.org/commands/cli/info/

    $ wp cli info
    PHP binary: /usr/bin/php
    PHP version:  5.4.34
    php.ini used: /etc/php.ini
    WP-CLI root dir:  phar://wp-cli.phar
    WP-CLI global config: /home/vagrant/.wp-cli/config.yml
    WP-CLI project config:
    WP-CLI version: 0.17.1
    

    WP-CLIのバージョン確認

    http://wp-cli.org/commands/cli/version/

    $ wp cli version
    WP-CLI 0.17.1
    

    core (Download, install, update and otherwise manage WordPress proper.)

    Wordpressに関する操作です。

    Wordpressの更新確認

    http://wp-cli.org/commands/core/check-update/

    $ wp core check-update
    Success: WordPress is at the latest version.
    

    言語ファイルの一覧

    http://wp-cli.org/commands/core/language/list/

    $ wp core language list
    +----------+-----------------------+---------------------+-------------+---------------------+
    | language | english_name          | native_name         | status      | updated             |
    +----------+-----------------------+---------------------+-------------+---------------------+
    | ar       | Arabic                | العربية             | uninstalled | 2014-09-04 15:44:04 |
    | az       | Azerbaijani           | Azərbaycan dili     | uninstalled | 2014-10-01 13:29:39 |
    | bg_BG    | Bulgarian             | Български           | uninstalled | 2014-10-08 11:17:50 |
    | bs_BA    | Bosnian               | Bosanski            | uninstalled | 2014-09-04 15:47:16 |
    | ca       | Catalan               | Català              | uninstalled | 2014-10-19 13:59:46 |
    | cy       | Welsh                 | Cymraeg             | uninstalled | 2014-09-04 16:43:49 |
    | da_DK    | Danish                | Dansk               | uninstalled | 2014-10-22 11:59:16 |
    | de_DE    | German                | Deutsch             | uninstalled | 2014-10-26 13:41:46 |
    | en_CA    | English (Canada)      | English (Canada)    | uninstalled | 2014-09-05 00:31:07 |
    | en_GB    | English (UK)          | English (UK)        | uninstalled | 2014-09-04 08:52:52 |
    | en_AU    | English (Australia)   | English (Australia) | uninstalled | 2014-09-06 00:56:37 |
    | es_ES    | Spanish (Spain)       | Español             | uninstalled | 2014-09-04 17:40:25 |
    | es_PE    | Spanish (Peru)        | Español de Perú     | uninstalled | 2014-09-04 07:49:30 |
    | es_CL    | Spanish (Chile)       | Español de Chile    | uninstalled | 2014-09-04 19:47:01 |
    | eu       | Basque                | Euskara             | uninstalled | 2014-09-05 06:55:23 |
    | fa_IR    | Persian               | فارسی               | uninstalled | 2014-09-05 15:58:20 |
    | fi       | Finnish               | Suomi               | uninstalled | 2014-10-06 08:32:55 |
    | fr_FR    | French (France)       | Français            | uninstalled | 2014-10-04 17:49:48 |
    | gd       | Scottish Gaelic       | Gàidhlig            | uninstalled | 2014-09-05 17:37:43 |
    | gl_ES    | Galician              | Galego              | uninstalled | 2014-09-04 01:18:12 |
    | he_IL    | Hebrew                | עִבְרִית               | uninstalled | 2014-09-04 22:57:38 |
    | hr       | Croatian              | Hrvatski            | uninstalled | 2014-09-20 14:09:34 |
    | hu_HU    | Hungarian             | Magyar              | uninstalled | 2014-09-04 19:12:04 |
    | id_ID    | Indonesian            | Bahasa Indonesia    | uninstalled | 2014-09-04 11:26:19 |
    | it_IT    | Italian               | Italiano            | uninstalled | 2014-10-02 08:24:03 |
    | ja       | Japanese              | 日本語              | active      | 2014-10-21 06:30:27 |
    | ko_KR    | Korean                | 한국어              | uninstalled | 2014-09-04 07:54:33 |
    | my_MM    | Burmese               | ဗမာစာ               | uninstalled | 2014-09-06 08:41:35 |
    | nb_NO    | Norwegian (Bokmål)    | Norsk bokmål        | uninstalled | 2014-09-04 20:51:26 |
    | nl_NL    | Dutch                 | Nederlands          | uninstalled | 2014-09-17 06:23:19 |
    | pl_PL    | Polish                | Polski              | uninstalled | 2014-10-03 17:44:34 |
    | pt_PT    | Portuguese (Portugal) | Português           | uninstalled | 2014-09-29 15:27:01 |
    | pt_BR    | Portuguese (Brazil)   | Português do Brasil | uninstalled | 2014-10-30 13:29:44 |
    | ru_RU    | Russian               | Русский             | uninstalled | 2014-10-21 12:32:07 |
    | sk_SK    | Slovak                | Slovenčina          | uninstalled | 2014-09-20 13:05:09 |
    | sr_RS    | Serbian               | Српски језик        | uninstalled | 2014-09-04 15:37:38 |
    | sv_SE    | Swedish               | Svenska             | uninstalled | 2014-10-11 20:39:56 |
    | th       | Thai                  | ไทย                 | uninstalled | 2014-10-09 03:43:17 |
    | tr_TR    | Turkish               | Türkçe              | uninstalled | 2014-09-05 17:57:59 |
    | zh_CN    | Chinese (China)       | 简体中文            | uninstalled | 2014-09-05 00:41:46 |
    | zh_TW    | Chinese (Taiwan)      | 繁體中文            | uninstalled | 2014-09-05 06:58:31 |
    +----------+-----------------------+---------------------+-------------+---------------------+
    

    Wordpressのバージョン表示

    http://wp-cli.org/commands/core/version/

    $ wp core version
    4.0.1
    

    cron (Manage WP-Cron events and schedules.)

    Wordpressのcron設定に関する操作です。

    cronイベントの一覧を表示

    http://wp-cli.org/commands/cron/event/list/

    $ wp cron event list
    +----------------------+---------------------+-------------------+------------+
    | hook                 | next_run_gmt        | next_run_relative | recurrence |
    +----------------------+---------------------+-------------------+------------+
    | wp_version_check     | 2014-11-28 13:55:51 | 2時間 37 minutes  | 12時間     |
    | wp_update_plugins    | 2014-11-28 13:55:51 | 2時間 37 minutes  | 12時間     |
    | wp_update_themes     | 2014-11-28 13:55:51 | 2時間 37 minutes  | 12時間     |
    | wp_maybe_auto_update | 2014-11-28 19:18:00 | 7時間 59 minutes  | 12時間     |
    | wp_scheduled_delete  | 2014-11-29 01:58:33 | 14時間 39 minutes | 1日        |
    +----------------------+---------------------+-------------------+------------+
    

    comment (Manage comments.)

    コメントに関する操作です。

    コメント数の表示

    http://wp-cli.org/commands/comment/count/

    $ wp comment count
    approved:        1
    moderated:       0
    spam:            0
    trash:           0
    post-trashed:    0
    total_comments:  1
    

    コメントの一覧表示

    http://wp-cli.org/commands/comment/list/

    $ wp comment list
    +------------+-----------------+---------------------+------------------+----------------+----------------------+
    | comment_ID | comment_post_ID | comment_date        | comment_approved | comment_author | comment_author_email |
    +------------+-----------------+---------------------+------------------+----------------+----------------------+
    | 1          | 1               | 2014-11-27 01:55:51 | 1                | Mr WordPress   |                      |
    +------------+-----------------+---------------------+------------------+----------------+----------------------+
    

    コメントの取得

    http://wp-cli.org/commands/comment/get/

    $ wp comment get 1
    +----------------------+----------------------------------------------------------------------------+
    | Field                | Value                                                                      |
    +----------------------+----------------------------------------------------------------------------+
    | comment_ID           | 1                                                                          |
    | comment_post_ID      | 1                                                                          |
    | comment_author       | Mr WordPress                                                               |
    | comment_author_email |                                                                            |
    | comment_author_url   | https://wordpress.org/                                                     |
    | comment_author_IP    |                                                                            |
    | comment_date         | 2014-11-27 01:55:51                                                        |
    | comment_date_gmt     | 2014-11-27 01:55:51                                                        |
    | comment_content      | これはコメントです。
    コメントを削除するには、ログインして投稿編集画面でコメントを表示してください。編集または削除するオプションが用意されています。 |
    | comment_karma        | 0                                                                          |
    | comment_approved     | 1                                                                          |
    | comment_agent        |                                                                            |
    | comment_type         |                                                                            |
    | comment_parent       | 0                                                                          |
    | user_id              | 0                                                                          |
    +----------------------+----------------------------------------------------------------------------+
    

    コメントのメタ情報

    http://wp-cli.org/commands/comment/meta/

    $ wp comment meta list 1
    +------------+----------+------------+
    | comment_id | meta_key | meta_value |
    +------------+----------+------------+
    +------------+----------+------------+
    

    db (Perform basic database operations.)

    DBに関する操作です。 http://wp-cli.org/commands/db/

    dbのtable一覧を表示する

    http://wp-cli.org/commands/db/tables/

    $ wp db tables
    wp_users
    wp_usermeta
    wp_posts
    wp_comments
    wp_links
    wp_options
    wp_postmeta
    wp_terms
    wp_term_taxonomy
    wp_term_relationships
    wp_commentmeta
    

    menu

    メニューに関する操作です。

    http://wp-cli.org/commands/menu/

    メニュー一覧の表示

    http://wp-cli.org/commands/menu/list/

    $ wp menu list
    +---------+------+------+-----------+-------+
    | term_id | name | slug | locations | count |
    +---------+------+------+-----------+-------+
    +---------+------+------+-----------+-------+
    

    option (Manage options.)

    オプションに関する操作です。

    http://wp-cli.org/commands/option/

    オプションを取得する

    http://wp-cli.org/commands/option/get/

    $ wp option get siteurl
    http://marke.io.local
    

    plugin (Manage plugins.)

    プラグインに関する操作です。

    http://wp-cli.org/commands/plugin/

    プラグイン一覧の表示

    http://wp-cli.org/commands/plugin/list/

    $ wp plugin list
    +--------------------+----------+-----------+------------+
    | name               | status   | update    | version    |
    +--------------------+----------+-----------+------------+
    | akismet            | inactive | available | 3.0.2      |
    | dynamic-hostname   | active   | none      | 0.4.0      |
    | hello              | inactive | none      | 1.6        |
    | plugin-check       | active   | none      | 0.1        |
    | theme-check        | active   | none      | 20140929.1 |
    | wp-basic-auth      | active   | none      | 1.1.1      |
    | wp-multibyte-patch | active   | none      | 2.1.1      |
    +--------------------+----------+-----------+------------+
    

    プラグインの検索

    http://wp-cli.org/commands/plugin/search/

    $ wp plugin search contact-form
    Success: Showing 10 of 1480 plugins.
    +-----------------------------------------+------------------------------------------------+--------+
    | name                                    | slug                                           | rating |
    +-----------------------------------------+------------------------------------------------+--------+
    | Contact Coldform                        | contact-coldform                               | 72.4   |
    | WP Contact Bank - Contact Forms Builder | contact-bank                                   | 85.6   |
    | Contact Form Builder                    | contact-form-builder                           | 89     |
    | FormGet Contact Form                    | formget-contact-form                           | 70     |
    | Contact Form Maker                      | contact-form-maker                             | 86.4   |
    | Custom Contact Forms                    | custom-contact-forms                           | 76.4   |
    | Contact Form Plugin by vCita            | contact-form-with-a-meeting-scheduler-by-vcita | 73.4   |
    | Contact Form 7 Integrations             | contact-form-7-integrations                    | 88.6   |
    | Contact Form by ContactUs               | contactuscom                                   | 77.4   |
    | Contact Form to Email                   | contact-form-to-email                          | 71.6   |
    +-----------------------------------------+------------------------------------------------+--------+
    

    post (Manage posts.)

    投稿に関する操作です。

    http://wp-cli.org/commands/post/

    投稿一覧の表示

    http://wp-cli.org/commands/post/list/

    $ wp post list
    +----+--------------+-------------+---------------------+-------------+
    | ID | post_title   | post_name   | post_date           | post_status |
    +----+--------------+-------------+---------------------+-------------+
    | 1  | Hello world! | hello-world | 2014-11-27 01:55:51 | publish     |
    +----+--------------+-------------+---------------------+-------------+
    

    カスタムフィールドの表示

    http://wp-cli.org/commands/post/meta/list/

    $ wp post meta list 1
    +---------+----------+------------+
    | post_id | meta_key | meta_value |
    +---------+----------+------------+
    +---------+----------+------------+
    

    投稿URLの表示

    http://wp-cli.org/commands/post/url/

    $ wp post url 1
    http://test.io.local/archives/1
    

    rewrite (Manage rewrite rules.)

    リライトルールに関する操作です。

    http://wp-cli.org/commands/rewrite/

    ルール一覧の表示

    http://wp-cli.org/commands/rewrite/list/

    $ wp rewrite list
    +-----------------------------------------------------------------------+------------------------------------------------------------------------+-------------+
    | match                                                                 | query                                                                  | source      |
    +-----------------------------------------------------------------------+------------------------------------------------------------------------+-------------+
    | archives/category/(.+?)/feed/(feed|rdf|rss|rss2|atom)/?$              | index.php?category_name=$matches[1]&feed=$matches[2]                   | category    |
    | archives/category/(.+?)/(feed|rdf|rss|rss2|atom)/?$                   | index.php?category_name=$matches[1]&feed=$matches[2]                   | category    |
    | archives/category/(.+?)/page/?([0-9]{1,})/?$                          | index.php?category_name=$matches[1]&paged=$matches[2]                  | category    |
    | archives/category/(.+?)/?$                                            | index.php?category_name=$matches[1]                                    | category    |
    | archives/tag/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$                 | index.php?tag=$matches[1]&feed=$matches[2]                             | post_tag    |
    | archives/tag/([^/]+)/(feed|rdf|rss|rss2|atom)/?$                      | index.php?tag=$matches[1]&feed=$matches[2]                             | post_tag    |
    | archives/tag/([^/]+)/page/?([0-9]{1,})/?$                             | index.php?tag=$matches[1]&paged=$matches[2]                            | post_tag    |
    | archives/tag/([^/]+)/?$                                               | index.php?tag=$matches[1]                                              | post_tag    |
    | archives/type/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$                | index.php?post_format=$matches[1]&feed=$matches[2]                     | post_format |
    | archives/type/([^/]+)/(feed|rdf|rss|rss2|atom)/?$                     | index.php?post_format=$matches[1]&feed=$matches[2]                     | post_format |
    | archives/type/([^/]+)/page/?([0-9]{1,})/?$                            | index.php?post_format=$matches[1]&paged=$matches[2]                    | post_format |
    | archives/type/([^/]+)/?$                                              | index.php?post_format=$matches[1]                                      | post_format |
    | robots\.txt$                                                          | index.php?robots=1                                                     | other       |
    | .*wp-(atom|rdf|rss|rss2|feed|commentsrss2)\.php$                      | index.php?feed=old                                                     | other       |
    | .*wp-app\.php(/.*)?$                                                  | index.php?error=403                                                    | other       |
    | .*wp-register.php$                                                    | index.php?register=true                                                | other       |
    | feed/(feed|rdf|rss|rss2|atom)/?$                                      | index.php?&feed=$matches[1]                                            | root        |
    | (feed|rdf|rss|rss2|atom)/?$                                           | index.php?&feed=$matches[1]                                            | root        |
    | page/?([0-9]{1,})/?$                                                  | index.php?&paged=$matches[1]                                           | root        |
    | comments/feed/(feed|rdf|rss|rss2|atom)/?$                             | index.php?&feed=$matches[1]&withcomments=1                             | comments    |
    | comments/(feed|rdf|rss|rss2|atom)/?$                                  | index.php?&feed=$matches[1]&withcomments=1                             | comments    |
    | search/(.+)/feed/(feed|rdf|rss|rss2|atom)/?$                          | index.php?s=$matches[1]&feed=$matches[2]                               | search      |
    | search/(.+)/(feed|rdf|rss|rss2|atom)/?$                               | index.php?s=$matches[1]&feed=$matches[2]                               | search      |
    | search/(.+)/page/?([0-9]{1,})/?$                                      | index.php?s=$matches[1]&paged=$matches[2]                              | search      |
    | search/(.+)/?$                                                        | index.php?s=$matches[1]                                                | search      |
    | archives/author/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$              | index.php?author_name=$matches[1]&feed=$matches[2]                     | author      |
    | archives/author/([^/]+)/(feed|rdf|rss|rss2|atom)/?$                   | index.php?author_name=$matches[1]&feed=$matches[2]                     | author      |
    | archives/author/([^/]+)/page/?([0-9]{1,})/?$                          | index.php?author_name=$matches[1]&paged=$matches[2]                    | author      |
    | archives/author/([^/]+)/?$                                            | index.php?author_name=$matches[1]                                      | author      |
    | archives/date/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/feed/(feed|rdf|rss | index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&feed=$ | date        |
    | |rss2|atom)/?$                                                        | matches[4]                                                             |             |
    | archives/date/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/(feed|rdf|rss|rss2 | index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&feed=$ | date        |
    | |atom)/?$                                                             | matches[4]                                                             |             |
    | archives/date/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/page/?([0-9]{1,})/ | index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&paged= | date        |
    | ?$                                                                    | $matches[4]                                                            |             |
    | archives/date/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/?$                 | index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]        | date        |
    | archives/date/([0-9]{4})/([0-9]{1,2})/feed/(feed|rdf|rss|rss2|atom)/? | index.php?year=$matches[1]&monthnum=$matches[2]&feed=$matches[3]       | date        |
    | $                                                                     |                                                                        |             |
    | archives/date/([0-9]{4})/([0-9]{1,2})/(feed|rdf|rss|rss2|atom)/?$     | index.php?year=$matches[1]&monthnum=$matches[2]&feed=$matches[3]       | date        |
    | archives/date/([0-9]{4})/([0-9]{1,2})/page/?([0-9]{1,})/?$            | index.php?year=$matches[1]&monthnum=$matches[2]&paged=$matches[3]      | date        |
    | archives/date/([0-9]{4})/([0-9]{1,2})/?$                              | index.php?year=$matches[1]&monthnum=$matches[2]                        | date        |
    | archives/date/([0-9]{4})/feed/(feed|rdf|rss|rss2|atom)/?$             | index.php?year=$matches[1]&feed=$matches[2]                            | date        |
    | archives/date/([0-9]{4})/(feed|rdf|rss|rss2|atom)/?$                  | index.php?year=$matches[1]&feed=$matches[2]                            | date        |
    | archives/date/([0-9]{4})/page/?([0-9]{1,})/?$                         | index.php?year=$matches[1]&paged=$matches[2]                           | date        |
    | archives/date/([0-9]{4})/?$                                           | index.php?year=$matches[1]                                             | date        |
    | archives/[0-9]+/attachment/([^/]+)/?$                                 | index.php?attachment=$matches[1]                                       | post        |
    | archives/[0-9]+/attachment/([^/]+)/trackback/?$                       | index.php?attachment=$matches[1]&tb=1                                  | post        |
    | archives/[0-9]+/attachment/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$   | index.php?attachment=$matches[1]&feed=$matches[2]                      | post        |
    | archives/[0-9]+/attachment/([^/]+)/(feed|rdf|rss|rss2|atom)/?$        | index.php?attachment=$matches[1]&feed=$matches[2]                      | post        |
    | archives/[0-9]+/attachment/([^/]+)/comment-page-([0-9]{1,})/?$        | index.php?attachment=$matches[1]&cpage=$matches[2]                     | post        |
    | archives/([0-9]+)/trackback/?$                                        | index.php?p=$matches[1]&tb=1                                           | post        |
    | archives/([0-9]+)/feed/(feed|rdf|rss|rss2|atom)/?$                    | index.php?p=$matches[1]&feed=$matches[2]                               | post        |
    | archives/([0-9]+)/(feed|rdf|rss|rss2|atom)/?$                         | index.php?p=$matches[1]&feed=$matches[2]                               | post        |
    | archives/([0-9]+)/page/?([0-9]{1,})/?$                                | index.php?p=$matches[1]&paged=$matches[2]                              | post        |
    | archives/([0-9]+)/comment-page-([0-9]{1,})/?$                         | index.php?p=$matches[1]&cpage=$matches[2]                              | post        |
    | archives/([0-9]+)(/[0-9]+)?/?$                                        | index.php?p=$matches[1]&page=$matches[2]                               | post        |
    | archives/[0-9]+/([^/]+)/?$                                            | index.php?attachment=$matches[1]                                       | post        |
    | archives/[0-9]+/([^/]+)/trackback/?$                                  | index.php?attachment=$matches[1]&tb=1                                  | post        |
    | archives/[0-9]+/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$              | index.php?attachment=$matches[1]&feed=$matches[2]                      | post        |
    | archives/[0-9]+/([^/]+)/(feed|rdf|rss|rss2|atom)/?$                   | index.php?attachment=$matches[1]&feed=$matches[2]                      | post        |
    | archives/[0-9]+/([^/]+)/comment-page-([0-9]{1,})/?$                   | index.php?attachment=$matches[1]&cpage=$matches[2]                     | post        |
    | .?.+?/attachment/([^/]+)/?$                                           | index.php?attachment=$matches[1]                                       | page        |
    | .?.+?/attachment/([^/]+)/trackback/?$                                 | index.php?attachment=$matches[1]&tb=1                                  | page        |
    | .?.+?/attachment/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$             | index.php?attachment=$matches[1]&feed=$matches[2]                      | page        |
    | .?.+?/attachment/([^/]+)/(feed|rdf|rss|rss2|atom)/?$                  | index.php?attachment=$matches[1]&feed=$matches[2]                      | page        |
    | .?.+?/attachment/([^/]+)/comment-page-([0-9]{1,})/?$                  | index.php?attachment=$matches[1]&cpage=$matches[2]                     | page        |
    | (.?.+?)/trackback/?$                                                  | index.php?pagename=$matches[1]&tb=1                                    | page        |
    | (.?.+?)/feed/(feed|rdf|rss|rss2|atom)/?$                              | index.php?pagename=$matches[1]&feed=$matches[2]                        | page        |
    | (.?.+?)/(feed|rdf|rss|rss2|atom)/?$                                   | index.php?pagename=$matches[1]&feed=$matches[2]                        | page        |
    | (.?.+?)/page/?([0-9]{1,})/?$                                          | index.php?pagename=$matches[1]&paged=$matches[2]                       | page        |
    | (.?.+?)/comment-page-([0-9]{1,})/?$                                   | index.php?pagename=$matches[1]&cpage=$matches[2]                       | page        |
    | (.?.+?)(/[0-9]+)?/?$                                                  | index.php?pagename=$matches[1]&page=$matches[2]                        | page        |
    +-----------------------------------------------------------------------+------------------------------------------------------------------------+-------------
    

    role (Manage user roles.)

    ロールに関する操作です。

    http://wp-cli.org/commands/role/

    ロール一覧の表示

    http://wp-cli.org/commands/role/list/

    $ wp role list
    +---------------+---------------+
    | name          | role          |
    +---------------+---------------+
    | Administrator | administrator |
    | Editor        | editor        |
    | Author        | author        |
    | Contributor   | contributor   |
    | Subscriber    | subscriber    |
    +---------------+---------------+
    

    sidebar (Manage sidebars.)

    サイドバーに関する操作です。

    http://wp-cli.org/commands/sidebar/

    サイドバーの一覧表示

    http://wp-cli.org/commands/sidebar/list/

    $ wp sidebar list
    +--------------+---------------------+---------------------------------------------+
    | name         | id                  | description                                 |
    +--------------+---------------------+---------------------------------------------+
    | サイドバー   | sidebar-1           |                                             |
    | 使用停止中のウィジェット | wp_inactive_widgets | ウィジェットをここにドラッグすると、設定を維持したままウェブサイトから取り除かれます。 |
    +--------------+---------------------+---------------------------------------------+
    

    theme (Manage themes.)

    テーマに関する操作です。

    http://wp-cli.org/commands/theme/

    テーマ一覧の表示

    http://wp-cli.org/commands/theme/list/

    $ wp theme list
    +----------------+----------+--------+---------+
    | name           | status   | update | version |
    +----------------+----------+--------+---------+
    | test           | active   | none   | 0.1.0   |
    | twentyfourteen | inactive | none   | 1.2     |
    | twentythirteen | inactive | none   | 1.3     |
    | twentytwelve   | inactive | none   | 1.5     |
    +----------------+----------+--------+---------+
    

    user (Manage users.)

    ユーザーに関する操作です。

    http://wp-cli.org/commands/user/

    ユーザー一覧表示

    http://wp-cli.org/commands/user/list/

    $ wp user list
    +----+------------+--------------+---------------------+---------------------+---------------+
    | ID | user_login | display_name | user_email          | user_registered     | roles         |
    +----+------------+--------------+---------------------+---------------------+---------------+
    | 1  | admin      | admin        | vagrant@example.com | 2014-11-27 01:55:51 | administrator |
    +----+------------+--------------+---------------------+---------------------+---------------+
    

    まとめ

    今回は参照系のコマンドだけでしたが、一覧を見る限りほぼすべての機能が網羅されておりAWSでインスタンスを立ち上げる際に便利なんだろうなと感じた。Chefとか勉強した時にでも使っていきたい。

    シリーズ

    1. VCCWでiemotoを使ったWordpressテーマ作成
    2. VCCWでWP-CLI(A command line interface for WordPress)を試す
    3. WP-CLIでWordpressプラグインをインストールし有効化する
    4. VCCWでファイルがアップロードできなくてはまった話

    コメント・フィードバック