Skip to main content
added 4 characters in body
Source Link
jgraup
  • 9.8k
  • 3
  • 32
  • 68

You could take a look at wp-cli-ssh

Seamlessly run WP-CLI commands on a remote server via SSH

I know you don't want to SSH to the guest, but this at least, supposedly, removes the need to do it manually.

FiguredI figured out how to set it up.

Follow these steps

mkdir -p ~/.wp-cli
cd ~/.wp-cli
touch composer.json
php composer.phar init --stability dev --no-interaction
php composer.phar config bin-dir bin
php composer.phar config vendor-dir vendor
php composer.phar config repositories.wp-cli composer 'http://wp-cli.org/package-index/'

Create or edit config.ymlin the same folder and add:

require:
  - vendor/autoload.php

Install the package with: php composer.phar require x-team/wp-cli-ssh=dev-master

Then just running wp should display a list of available subcommands, and you should have ssh added to that list.

Then we configure the plugin in wp-cli.local.yml or wp-cli.yml:

ssh:
  vagrant:
    # The %pseudotty% placeholder gets replaced with -t or -T depending on whether you're piping output
    # The %cmd% placeholder is replaced with the originally-invoked WP-CLI command
    cmd: vagrant ssh-config > /tmp/vagrant_ssh_config && ssh -q %pseudotty% -F /tmp/vagrant_ssh_config default %cmd%
    # Passed to WP-CLI on the remote server via --url
    url: local-www.yourawesomewebsite.com
    # We cd to this path on the remote server before running WP-CLI
    path: /your/vvv/path/

And run it all with wp ssh plugin status --host=vagrant

... It's just to bad that this plugin assumes Varying-Vagrant-Vagrants. Since my vagrant environment hosts a lot of sites the Vagrantfile isn't in the WordPress directory, breaking the whole thing...

You could take a look at wp-cli-ssh

Seamlessly run WP-CLI commands on a remote server via SSH

I know you don't want to SSH to the guest, but this at least, supposedly, removes the need to do it manually.

Figured out how to set it up.

Follow these steps

mkdir -p ~/.wp-cli
cd ~/.wp-cli
touch composer.json
php composer.phar init --stability dev --no-interaction
php composer.phar config bin-dir bin
php composer.phar config vendor-dir vendor
php composer.phar config repositories.wp-cli composer 'http://wp-cli.org/package-index/'

Create or edit config.ymlin the same folder and add:

require:
  - vendor/autoload.php

Install the package with: php composer.phar require x-team/wp-cli-ssh=dev-master

Then just running wp should display a list of available subcommands, and you should have ssh added to that list.

Then we configure the plugin in wp-cli.local.yml or wp-cli.yml:

ssh:
  vagrant:
    # The %pseudotty% placeholder gets replaced with -t or -T depending on whether you're piping output
    # The %cmd% placeholder is replaced with the originally-invoked WP-CLI command
    cmd: vagrant ssh-config > /tmp/vagrant_ssh_config && ssh -q %pseudotty% -F /tmp/vagrant_ssh_config default %cmd%
    # Passed to WP-CLI on the remote server via --url
    url: local-www.yourawesomewebsite.com
    # We cd to this path on the remote server before running WP-CLI
    path: /your/vvv/path/

And run it all with wp ssh plugin status --host=vagrant

.. It's just to bad that this plugin assumes Varying-Vagrant-Vagrants. Since my vagrant environment hosts a lot of sites the Vagrantfile isn't in the WordPress directory, breaking the whole thing..

You could take a look at wp-cli-ssh

Seamlessly run WP-CLI commands on a remote server via SSH

I know you don't want to SSH to the guest, but this at least, supposedly, removes the need to do it manually.

I figured out how to set it up.

Follow these steps

mkdir -p ~/.wp-cli
cd ~/.wp-cli
touch composer.json
php composer.phar init --stability dev --no-interaction
php composer.phar config bin-dir bin
php composer.phar config vendor-dir vendor
php composer.phar config repositories.wp-cli composer 'http://wp-cli.org/package-index/'

Create or edit config.ymlin the same folder and add:

require:
  - vendor/autoload.php

Install the package with: php composer.phar require x-team/wp-cli-ssh=dev-master

Then just running wp should display a list of available subcommands, and you should have ssh added to that list.

Then we configure the plugin in wp-cli.local.yml or wp-cli.yml:

ssh:
  vagrant:
    # The %pseudotty% placeholder gets replaced with -t or -T depending on whether you're piping output
    # The %cmd% placeholder is replaced with the originally-invoked WP-CLI command
    cmd: vagrant ssh-config > /tmp/vagrant_ssh_config && ssh -q %pseudotty% -F /tmp/vagrant_ssh_config default %cmd%
    # Passed to WP-CLI on the remote server via --url
    url: local-www.yourawesomewebsite.com
    # We cd to this path on the remote server before running WP-CLI
    path: /your/vvv/path/

And run it all with wp ssh plugin status --host=vagrant

... It's just to bad that this plugin assumes Varying-Vagrant-Vagrants. Since my vagrant environment hosts a lot of sites the Vagrantfile isn't in the WordPress directory, breaking the whole thing...

proper linking
Source Link
Pieter Goosen
  • 55.4k
  • 23
  • 115
  • 209

You could take a look at https://github.com/x-team/wp-cli-ssh

Seamlessly run WP-CLI commands on a remote server via SSH

I know you don't want to SSH to the guest, but this at least, supposedly, removes the need to do it manually.

Figured out how to set it up.

Follow these steps: https://github.com/wp-cli/wp-cli/wiki/Community-Packages#setting-up-the-package-indexthese steps

mkdir -p ~/.wp-cli
cd ~/.wp-cli
touch composer.json
php composer.phar init --stability dev --no-interaction
php composer.phar config bin-dir bin
php composer.phar config vendor-dir vendor
php composer.phar config repositories.wp-cli composer 'http://wp-cli.org/package-index/'

Create or edit config.ymlin the same folder and add:

require:
  - vendor/autoload.php

Install the package with: php composer.phar require x-team/wp-cli-ssh=dev-master

Then just running wp should display a list of available subcommands, and you should have ssh added to that list.

Then we configure the plugin in wp-cli.local.yml or wp-cli.yml:

ssh:
  vagrant:
    # The %pseudotty% placeholder gets replaced with -t or -T depending on whether you're piping output
    # The %cmd% placeholder is replaced with the originally-invoked WP-CLI command
    cmd: vagrant ssh-config > /tmp/vagrant_ssh_config && ssh -q %pseudotty% -F /tmp/vagrant_ssh_config default %cmd%
    # Passed to WP-CLI on the remote server via --url
    url: local-www.yourawesomewebsite.com
    # We cd to this path on the remote server before running WP-CLI
    path: /your/vvv/path/

And run it all with wp ssh plugin status --host=vagrant

.. It's just to bad that this plugin assumes Varying-Vagrant-Vagrants. Since my vagrant environment hosts a lot of sites the Vagrantfile isn't in the WordPress directory, breaking the whole thing..

You could take a look at https://github.com/x-team/wp-cli-ssh

Seamlessly run WP-CLI commands on a remote server via SSH

I know you don't want to SSH to the guest, but this at least, supposedly, removes the need to do it manually.

Figured out how to set it up.

Follow these steps: https://github.com/wp-cli/wp-cli/wiki/Community-Packages#setting-up-the-package-index

mkdir -p ~/.wp-cli
cd ~/.wp-cli
touch composer.json
php composer.phar init --stability dev --no-interaction
php composer.phar config bin-dir bin
php composer.phar config vendor-dir vendor
php composer.phar config repositories.wp-cli composer 'http://wp-cli.org/package-index/'

Create or edit config.ymlin the same folder and add:

require:
  - vendor/autoload.php

Install the package with: php composer.phar require x-team/wp-cli-ssh=dev-master

Then just running wp should display a list of available subcommands, and you should have ssh added to that list.

Then we configure the plugin in wp-cli.local.yml or wp-cli.yml:

ssh:
  vagrant:
    # The %pseudotty% placeholder gets replaced with -t or -T depending on whether you're piping output
    # The %cmd% placeholder is replaced with the originally-invoked WP-CLI command
    cmd: vagrant ssh-config > /tmp/vagrant_ssh_config && ssh -q %pseudotty% -F /tmp/vagrant_ssh_config default %cmd%
    # Passed to WP-CLI on the remote server via --url
    url: local-www.yourawesomewebsite.com
    # We cd to this path on the remote server before running WP-CLI
    path: /your/vvv/path/

And run it all with wp ssh plugin status --host=vagrant

.. It's just to bad that this plugin assumes Varying-Vagrant-Vagrants. Since my vagrant environment hosts a lot of sites the Vagrantfile isn't in the WordPress directory, breaking the whole thing..

You could take a look at wp-cli-ssh

Seamlessly run WP-CLI commands on a remote server via SSH

I know you don't want to SSH to the guest, but this at least, supposedly, removes the need to do it manually.

Figured out how to set it up.

Follow these steps

mkdir -p ~/.wp-cli
cd ~/.wp-cli
touch composer.json
php composer.phar init --stability dev --no-interaction
php composer.phar config bin-dir bin
php composer.phar config vendor-dir vendor
php composer.phar config repositories.wp-cli composer 'http://wp-cli.org/package-index/'

Create or edit config.ymlin the same folder and add:

require:
  - vendor/autoload.php

Install the package with: php composer.phar require x-team/wp-cli-ssh=dev-master

Then just running wp should display a list of available subcommands, and you should have ssh added to that list.

Then we configure the plugin in wp-cli.local.yml or wp-cli.yml:

ssh:
  vagrant:
    # The %pseudotty% placeholder gets replaced with -t or -T depending on whether you're piping output
    # The %cmd% placeholder is replaced with the originally-invoked WP-CLI command
    cmd: vagrant ssh-config > /tmp/vagrant_ssh_config && ssh -q %pseudotty% -F /tmp/vagrant_ssh_config default %cmd%
    # Passed to WP-CLI on the remote server via --url
    url: local-www.yourawesomewebsite.com
    # We cd to this path on the remote server before running WP-CLI
    path: /your/vvv/path/

And run it all with wp ssh plugin status --host=vagrant

.. It's just to bad that this plugin assumes Varying-Vagrant-Vagrants. Since my vagrant environment hosts a lot of sites the Vagrantfile isn't in the WordPress directory, breaking the whole thing..

Added solution to setup for wp-cli-ssh
Source Link
Oskar
  • 21
  • 3

You could take a look at https://github.com/x-team/wp-cli-ssh

Seamlessly run WP-CLI commands on a remote server via SSH

I know you don't want to SSH to the guest, but this at least, supposedly, removes the need to do it manually.

Some instructions hereFigured out how to set it up.

Follow these steps: http://x-team.com/2013/12/optimize-your-vagrant-workflow-with-wp-cli-ssh/https://github.com/wp-cli/wp-cli/wiki/Community-Packages#setting-up-the-package-index

mkdir -p ~/.wp-cli
cd ~/.wp-cli
touch composer.json
php composer.phar init --stability dev --no-interaction
php composer.phar config bin-dir bin
php composer.phar config vendor-dir vendor
php composer.phar config repositories.wp-cli composer 'http://wp-cli.org/package-index/'

Although I couldn't get itCreate or edit config.ymlin the same folder and add:

require:
  - vendor/autoload.php

Install the package with: php composer.phar require x-team/wp-cli-ssh=dev-master

Then just running wp should display a list of available subcommands, and you should have ssh added to work since I can't figure out what version constraintthat list.

Then we configure the plugin in wp-cli.local.yml or wp-cli.yml:

ssh:
  vagrant:
    # The %pseudotty% placeholder gets replaced with -t or -T depending on whether you're piping output
    # The %cmd% placeholder is replaced with the originally-invoked WP-CLI command
    cmd: vagrant ssh-config > /tmp/vagrant_ssh_config && ssh -q %pseudotty% -F /tmp/vagrant_ssh_config default %cmd%
    # Passed to WP-CLI on the remote server via --url
    url: local-www.yourawesomewebsite.com
    # We cd to this path on the remote server before running WP-CLI
    path: /your/vvv/path/

And run it is asking forall with wp ssh plugin status --host=vagrant

.. It's just to bad that this plugin assumes Varying-Vagrant-Vagrants. Since my vagrant environment hosts a lot of sites the Vagrantfile isn't in the WordPress directory, breaking the whole thing..

You could take a look at https://github.com/x-team/wp-cli-ssh

Seamlessly run WP-CLI commands on a remote server via SSH

I know you don't want to SSH to the guest, but this at least, supposedly, removes the need to do it manually.

Some instructions here: http://x-team.com/2013/12/optimize-your-vagrant-workflow-with-wp-cli-ssh/

Although I couldn't get it to work since I can't figure out what version constraint it is asking for..

You could take a look at https://github.com/x-team/wp-cli-ssh

Seamlessly run WP-CLI commands on a remote server via SSH

I know you don't want to SSH to the guest, but this at least, supposedly, removes the need to do it manually.

Figured out how to set it up.

Follow these steps: https://github.com/wp-cli/wp-cli/wiki/Community-Packages#setting-up-the-package-index

mkdir -p ~/.wp-cli
cd ~/.wp-cli
touch composer.json
php composer.phar init --stability dev --no-interaction
php composer.phar config bin-dir bin
php composer.phar config vendor-dir vendor
php composer.phar config repositories.wp-cli composer 'http://wp-cli.org/package-index/'

Create or edit config.ymlin the same folder and add:

require:
  - vendor/autoload.php

Install the package with: php composer.phar require x-team/wp-cli-ssh=dev-master

Then just running wp should display a list of available subcommands, and you should have ssh added to that list.

Then we configure the plugin in wp-cli.local.yml or wp-cli.yml:

ssh:
  vagrant:
    # The %pseudotty% placeholder gets replaced with -t or -T depending on whether you're piping output
    # The %cmd% placeholder is replaced with the originally-invoked WP-CLI command
    cmd: vagrant ssh-config > /tmp/vagrant_ssh_config && ssh -q %pseudotty% -F /tmp/vagrant_ssh_config default %cmd%
    # Passed to WP-CLI on the remote server via --url
    url: local-www.yourawesomewebsite.com
    # We cd to this path on the remote server before running WP-CLI
    path: /your/vvv/path/

And run it all with wp ssh plugin status --host=vagrant

.. It's just to bad that this plugin assumes Varying-Vagrant-Vagrants. Since my vagrant environment hosts a lot of sites the Vagrantfile isn't in the WordPress directory, breaking the whole thing..

Source Link
Oskar
  • 21
  • 3
Loading