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

Specifying an alias doesn't work for http: domain #115

Open
dossy opened this issue Jan 5, 2019 · 1 comment
Open

Specifying an alias doesn't work for http: domain #115

dossy opened this issue Jan 5, 2019 · 1 comment

Comments

@dossy
Copy link

dossy commented Jan 5, 2019

I'm trying to use wp-cli/restful with aliases where I can specify the domain using http: domain in my ~/.wp-cli/config.yml and it doesn't appear to work, like wp-cli is ignoring the http key in the configuration if it's in an alias.

Create ~/wp-cli.config.yml with just the following:

--

@test-http:
  http: wordpress.com

@test-ssh:
  ssh: nonexistent.google.com

Then, try the following:

$ wp --http=wordpress.com rest status list
Error: Couldn't auto-discover WP REST API endpoint from wordpress.com.

$ wp @test-http rest status list
Warning: No WordPress install found. If the command 'rest status list' is in a plugin or theme, pass --path=`path/to/wordpress`.
Error: 'rest' is not a registered wp command. See 'wp help' for available commands.
Did you mean 'post'?

$ wp @test-ssh rest status list
Error: Cannot connect over SSH using provided configuration.

I would have expected the wp @test-http rest status list to return the same output as wp --http=wordpress.com rest status list, but instead it behaves as though http isn't set.

@eyeinsky
Copy link

Running wp --http=wordpress.com rest status list fails because it probably has REST API disabled. On other default installs the command (with the domain replaced) works.

This package doesn't seem to support the http parameter in the YAML file, and always requires a --http=domain.com somewhere on the command line.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants