Difference between revisions of "WP-CLI"
Jump to navigation
Jump to search
m (moved WP Commandline to WP Command-line) |
|||
Line 3: | Line 3: | ||
Command-line WordPress. | Command-line WordPress. | ||
− | == | + | == wp-cli == |
* [https://github.com/wp-cli/wp-cli wp-cli] - based on drush | * [https://github.com/wp-cli/wp-cli wp-cli] - based on drush | ||
** [https://github.com/wp-cli/wp-cli/tree/master/src/php/wp-cli/commands/internals commands/internals] [https://github.com/wp-cli/wp-cli/wiki/List-of-internal-commands] | ** [https://github.com/wp-cli/wp-cli/tree/master/src/php/wp-cli/commands/internals commands/internals] [https://github.com/wp-cli/wp-cli/wiki/List-of-internal-commands] | ||
Line 12: | Line 12: | ||
* [http://codeseekah.com/2012/02/23/wordpress-command-line-fun/ WordPress Command Line Fun] - Feb 23, 2012 | * [http://codeseekah.com/2012/02/23/wordpress-command-line-fun/ WordPress Command Line Fun] - Feb 23, 2012 | ||
− | == Install == | + | === Install === |
git clone --recursive git://github.com/wp-cli/wp-cli.git ~/git/wp-cli | git clone --recursive git://github.com/wp-cli/wp-cli.git ~/git/wp-cli | ||
cd ~/git/wp-cli | cd ~/git/wp-cli | ||
Line 20: | Line 20: | ||
php=/opt/local/bin/php | php=/opt/local/bin/php | ||
− | == Usage == | + | === Usage === |
Available commands: | Available commands: | ||
wp core [download|config|install|install_network|version|update|update_db] | wp core [download|config|install|install_network|version|update|update_db] | ||
Line 50: | Line 50: | ||
wp core version --extra | wp core version --extra | ||
full version infos | full version infos | ||
− | |||
wp plugin status | wp plugin status | ||
Line 93: | Line 92: | ||
wp db cli | wp db cli | ||
interactive mysql | interactive mysql | ||
+ | |||
+ | == WordPress-CLI-Importer/Exporter == | ||
+ | * [http://wordpress.org/extend/plugins/wordpress-importer/ WordPress-CLI-Importer] | ||
+ | ** https://github.com/tott/WordPress-CLI-Importer | ||
+ | |||
+ | wordpress-importer-cli.php goes in wp-content/plugins/wordpress-importer | ||
+ | Argument --blog: Blog ID of the blog you like to import to | ||
+ | Argument --file: Full Path to WXR import file | ||
+ | Argument --attachments: Import attachments (true/false) | ||
+ | Argument --user: Username/ID the import should run as | ||
+ | Argument --author_mapping: empty or php file with User mapping array $cli_user_map = array( <old_user> => <new_user_name/email/id> ); defined. if the file does not exist it will be created for you | ||
+ | |||
+ | * [https://github.com/tott/WordPress-CLI-Exporter WordPress-CLI-Exporter] - A CLI Wrapper around the WordPress WXR Exporter | ||
+ | |||
+ | php cli-exporter.php --blog=blogname --path=/tmp/ --user=admin [--start_date=2011-01-01] [--end_date=2011-12-31] [--post_type=post] [--author=admin] [-- * category=Uncategorized] [--post_status=publish] [--skip_comments=1] [--file_item_count=1000] | ||
+ | |||
+ | == Other == | ||
+ | * https://github.com/brool/wordpress-shuffle - python, save posts to files | ||
+ | |||
+ | * http://wordshell.net/ - costs? says gpl2, but that is a lie? | ||
+ | ** http://wordshell.net/support/cheat-sheet-get-going-quickly/ | ||
+ | ** http://wordshell.net/support/faqs/competitors/compared-with-wp-cli/ | ||
+ | |||
+ | * https://github.com/jerodsanto/wordpress-console - adds a "Console" page to the admin menu for WordPress environment cli | ||
+ | |||
+ | * https://github.com/webord/wp-migrate - migrate the System from one url to another. | ||
+ | |||
+ | * http://samjlevy.com/2011/12/shell-script-for-cloning-a-wordpress-installation/ | ||
+ | |||
+ | * https://github.com/markjaquith/WordPress-Skeleton - skeleton repo for a WordPress sit. not wp-mu compatible | ||
+ | |||
+ | * https://github.com/vidluther/Autopress - Capistrano install scripts | ||
+ | * https://github.com/shacker/wp-batch-manage - scripts for cPanel based | ||
+ | * https://github.com/dxw/wp-generate - ruby, generate themes and templates | ||
+ | * https://github.com/dxw/cucumber-wordpress - for [http://cukes.info/ cucumber] development, ruby | ||
+ | |||
+ | |||
+ | == Vim == | ||
+ | * http://www.vim.org/scripts/script.php?script_id=3510 - post from vim | ||
+ | |||
+ | * http://www.kloppmagic.ca/blog/2011/05/wordpress-vim-syntax-highlighting/ |
Revision as of 12:00, 22 July 2012
Command-line WordPress.
wp-cli
- wp-cli - based on drush
- tutsplus: Using wp-cli for Fun and Profit - Feb 21st, 2012
- WordPress Command Line Fun - Feb 23, 2012
Install
git clone --recursive git://github.com/wp-cli/wp-cli.git ~/git/wp-cli cd ~/git/wp-cli sudo utils/dev-build
For BOA; both php 5.2 and 5.3 could be installed. 5.3 is required, so change script to;
php=/opt/local/bin/php
Usage
Available commands:
wp core [download|config|install|install_network|version|update|update_db] wp db [create|drop|optimize|repair|connect|cli|query|export|import] wp eval-file wp eval wp export [validate_arguments] wp generate [posts|users] wp home wp option [add|update|delete|get] wp plugin [activate|deactivate|toggle|path|update|uninstall|delete|status|install] wp post-meta [get|delete|add|update] wp post [create|update|delete] wp theme [activate|path|delete|status|install|update] wp transient [get|set|delete|type] wp user-meta [get|delete|add|update] wp user [list|delete|create|update]
wp --blog=myblog.mynetwork.com set scope to multisite blog
wp core download download latest release wp core install --url=url --title=site-title [--admin_name=username] --admin_email=email --admin_password=password db install wp core update upgrade to latest release wp core version --extra full version infos
wp plugin status display installed plugins wp plugin install hello-dolly install hello-dolly wp plugin install google-sitemap-generator --activate install and activate google-sitemap-generator wp plugin install google-sitemap-generator --activate --dev install and activate google-sitemap-generator development branch wp plugin update akismet update akismet wp plugin update --all update all wp plugin toggle [plugin] turn on/off google-sitemap-generator wp plugin uninstall [plugin] remove plugin from the system wp plugin delete [plugin] delete plugin files
wp theme status main site theme status wp theme status --blog=test.example.com multisite theme status wp theme activate my-new-theme --blog=fooblog.example.com multisite theme activate installed theme cd $(wp theme path twentyeleven) change to theme directory
wp generate posts --count=1000 for testing
wp export --path=./ --user=admin export content to a WXR file wp db dump sql dump wp db query "SELECT MAX(post_date) from wp_posts WHERE post_type = 'post' AND post_status = 'publish'" last post published wp db cli interactive mysql
WordPress-CLI-Importer/Exporter
wordpress-importer-cli.php goes in wp-content/plugins/wordpress-importer
Argument --blog: Blog ID of the blog you like to import to Argument --file: Full Path to WXR import file Argument --attachments: Import attachments (true/false) Argument --user: Username/ID the import should run as Argument --author_mapping: empty or php file with User mapping array $cli_user_map = array( <old_user> => <new_user_name/email/id> ); defined. if the file does not exist it will be created for you
- WordPress-CLI-Exporter - A CLI Wrapper around the WordPress WXR Exporter
php cli-exporter.php --blog=blogname --path=/tmp/ --user=admin [--start_date=2011-01-01] [--end_date=2011-12-31] [--post_type=post] [--author=admin] [-- * category=Uncategorized] [--post_status=publish] [--skip_comments=1] [--file_item_count=1000]
Other
- https://github.com/brool/wordpress-shuffle - python, save posts to files
- http://wordshell.net/ - costs? says gpl2, but that is a lie?
- https://github.com/jerodsanto/wordpress-console - adds a "Console" page to the admin menu for WordPress environment cli
- https://github.com/webord/wp-migrate - migrate the System from one url to another.
- https://github.com/markjaquith/WordPress-Skeleton - skeleton repo for a WordPress sit. not wp-mu compatible
- https://github.com/vidluther/Autopress - Capistrano install scripts
- https://github.com/shacker/wp-batch-manage - scripts for cPanel based
- https://github.com/dxw/wp-generate - ruby, generate themes and templates
- https://github.com/dxw/cucumber-wordpress - for cucumber development, ruby
Vim
- http://www.vim.org/scripts/script.php?script_id=3510 - post from vim