Installing WP-CLI in Windows (ok)

https://make.wordpress.org/cli/handbook/guides/installing/

Sử dụng: https://wp-cli.org/

C:\wp-cli\wp.bat

@ECHO OFF
php "C:/wp-cli/wp-cli.phar" %*
C:\wp-cli
C:\xampp\php
wp --info

Ví dụ:

https://developer.wordpress.org/cli/commands/plugin/install/

wp plugin install bbpress --activate

Cài đặt trên git

chmod +x wp-cli.phar
mv wp-cli.phar /usr/local/bin/wp
wp --info

https://developer.wordpress.org/cli/commands/post/create/

Config

C:\xampp\htdocs\example\wp-cli.yml

# Global parameter defaults
path: C:/xampp/htdocs/example
url: http://localhost/example
user: admin
color: false
disabled_commands:
  - db drop
  - plugin install
require:
  - path-to/command.php

# Subcommand defaults (e.g. `wp config create`)
config create:
    dbuser: root
    dbpass: 
    extra-php: |
        define( 'WP_DEBUG', true );
        define( 'WP_POST_REVISIONS', 50 );

# Aliases to other WordPress installs (e.g. `wp @staging rewrite flush`)
# An alias can include 'user', 'url', 'path', 'ssh', or 'http'
@staging:
    ssh: wpcli@staging.wp-cli.org
    user: wpcli
    path: /srv/www/staging.wp-cli.org
@production:
    ssh: wpcli@wp-cli.org:2222
    user: wpcli
    path: /srv/www/wp-cli.org

# Aliases can reference other aliases to create alias groups
# Alias groups can be nested
@both:
 - @staging
 - @production

# '_' is a special value denoting configuration options for this wp-cli.yml
_:
    # Merge subcommand defaults from the upstream config.yml, instead of overriding
    merge: true
    # Inherit configuration from an arbitrary YAML file
    inherit: prod.yml
 wp post create --post_type=post --post_author='wordpress' --post_title='A future post' --post_status=future --post_date='2020-12-01 07:00:00'

Quick Start

https://make.wordpress.org/cli/handbook/guides/quick-start/

wp core download --path=wpclidemo.dev

Last updated