Closed quickshiftin closed 10 years ago
+1 on this. Have you made any further progress with this @quickshiftin?
I've been working on a similar plugin which executes remote WP-CLI commands over the Wordpress API. What I've done there is to accept additional arguments over a --args
option.
The command and sub-command can be specified with positional parameters, but anything past that has to be passed as a string inside the --args
option.
wp yapi production option get --args='siteurl'
Seems like supporting the intended syntax in wp-cli-ssh would require wp-cli mods. That said, it would be nice to see the intended syntax to work.
I'm getting the same issue, wp ssh plugin status --host=production
gives me:
Error: Too many positional arguments: status
A bump on this issue, the command taken straight from the README gives an error.
Can anyone shed any light on this?
Hey! What is the version of wp-cli you are currently using? Can you also please paste the config you have in your wp-cli.yml file?
Happens with both 0.15.0 and 0.15.1 for me.
On 30.05.2014, at 19:46, Jonathan Bardo notifications@github.com wrote:
Hey! What is the version of wp-cli you are currently using?
— Reply to this email directly or view it on GitHub.
Perfect I will look at it. Can everyone paste the wp-cli.local.yml config file or the wp-cli.yml file as well.
So I can indeed reproduce the issue. I will take some time to see if we can resolve this with the guys who are maintaining wp-cli. @danielbachhuber I haven't really followed wp-cli that closely recently. Anything you know on top of your head that can cause that? Thanks!
Can any of you test PR #17 and tell me if it fixes the problem. I've tested with VVV from my local machine and it seems to work properly.
PR #17 works OK for me on 0.15.1
Thanks @Caramboo! @davemac Any luck so far? Sorry I haven't catch up on that thread earlier!
No go, unfortunately with PR #17. I'm not using Vagrant, so just trying to connect to a standard host.
$ wp ssh plugin status --host=production
Warning: The `wp ssh` command has an invalid synopsis part: [<subcommand>]...
Error: Too many positional arguments: status
However a gibberish command gives me:
$ wp ssh whatever --host=production
Warning: The `wp ssh` command has an invalid synopsis part: [<subcommand>]...
Connecting via ssh to host: production
bash: /tmp/wp-cli.phar: Permission denied
Connection to {I removed host URL} closed.
Hope that helps.
@davemac You are right. I did this blindly. I've look into the code and fixed the synopsis to allow for an infinite amount of positional argument and it works with vagrant and other host. Please test again and let me know!
Haven't looked at the patch or tested yet, but that sounds like the correct solution. Will be interested to look at the patch. Planning to test tomorrow on my end.
On Thu, Jun 5, 2014 at 10:43 AM, Jonathan Bardo notifications@github.com wrote:
@davemac https://github.com/davemac You are right. I did this blindly. I've look into the code and fixed the synopsis to allow for an infinite amount of positional argument and it works with vagrant and other host. Please test again and let me know!
— Reply to this email directly or view it on GitHub https://github.com/x-team/wp-cli-ssh/issues/13#issuecomment-45243991.
OK getting better:
$ wp ssh plugin status --host=production
Connecting via ssh to host: production
bash: /tmp/wp-cli.phar: Permission denied
Connection to {I removed host URL} closed.
So the too many positional arguments
error is gone, which is great.
But it's trying to create /tmp/wp-cli.phar
when it should be ~/tmp/wp-cli.phar
- is there a way I can change this via settings?
@davemac This seems like a totally separate issue. We could eventually allow for a separate configuration to provide the directory where we should install wp-cli. However, you should really install it yourself on the remote server before using this extension. By doing so, you would completely remove that error forever.
What do you think @westonruter ?
Sure, I understand it's a separate issue. The original issue here has been resolved in my testing.
The documentation says:
Note that you do not necessarily need WP-CLI installed
on your server to use this. If the wp command is not
recognized on the server, the script will download
the wp-cli.phar file and use that at runtime.
So I do see this as an issue on my VPS, with several sites on it, when I am SSHing into one of those sites. Shall I open another ticket?
By the way, thank you for the helpful responses.
Yes it seems like something one might one to control.You can open a separate issue to discuss this particular point.
:+1:
PR #17 merged
wp ssh plugin status --host=production
from the README results in an error.