Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new section about how to run commands remotely. #89

Merged
merged 6 commits into from
Jul 14, 2017

Conversation

schlessera
Copy link
Member

No description provided.

@schlessera schlessera requested a review from a team July 12, 2017 07:00
@schlessera schlessera added this to the 1.3.0 milestone Jul 12, 2017

WP-CLI accepts an `--ssh=<host>` global parameter for running a command against a remote WordPress install.

Under the hood, WP-CLI proxies commands to the ssh executable, which then passes them to WP-CLI installed on the remote machine. Your syntax for `--ssh=<host>` can be any of the following:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Giving the format spec [<user>@]<host>[:<port>][<path>] would be good. Mentioning it's similar to scp and git. Mentioning port in list. And "to the WP-CLI installed" perhaps.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added these changes. I rewrote the examples, as the "list all combinations" did not make any sense with the added port.


You don't need to SSH into machines, change directories, and generally spend a full minute to get to a given WordPress install, you can just let WP-CLI know what machine to work with and it knows how to make the actual connection.

Additionally, alias groups let you register groups of aliases. If I want to run a command against both configured example sites, I can use a group like `@both`:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe stick with "you" rather than using "I" here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed.


## Making WP-CLI accessible on a remote server

Running a command remotely through SSH requires having `wp` accessible on the `$PATH` on the remote server. Because SSH connections don’t load `~/.bashrc` or `~/.zshrc`, you may need to specify a custom `$PATH` when using `wp --ssh=<host>`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mention ~/.ssh/environment as an option.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a mention and a link to relevant docs.

@danielbachhuber
Copy link
Member

What do you think about putting this in a subdirectory? Our sidebar is getting quite long:

image

@schlessera
Copy link
Member Author

@danielbachhuber Yes, agree regarding the long sidebar. This should be discussed in #87

Copy link
Contributor

@gitlost gitlost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very educational example!

@schlessera
Copy link
Member Author

schlessera commented Jul 14, 2017

@danielbachhuber Ok to merge this, provided we discuss the layout of the entire content structure in #87 ?

@danielbachhuber
Copy link
Member

Ok to merge this, provided we discuss the layout of the entire content structure in #87

Yep, works for me.

@danielbachhuber danielbachhuber merged commit 8b6931e into master Jul 14, 2017
@danielbachhuber danielbachhuber deleted the add-remote-section branch July 14, 2017 14:30
schlessera pushed a commit that referenced this pull request Jan 25, 2022
Add new section about how to run commands remotely.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants