-
Notifications
You must be signed in to change notification settings - Fork 4
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 a WP-CLI alias #221
Comments
It should also be possible to not use an alias, and put the |
I did experiment briefly with this as part of #224 regarding pipe detection. This approach requires WP CLI to be installed on the host machine though, not everyone has that. We could only ensure it by adding it as a dependency of local server and aliasing something like |
I don't think this relates to pipe detection etc, rather this is a bonus for anyone who does have WP-CLI installed locally. The My thinking is that as part of the installation step of an Altis project the alias gets added with the name of the PHP container. |
Fair. I guess it wouldn't be too hard to document that difference. Projects would potentially need to If you want to keep playing in the meantime use |
Does Altis Cloud put a |
By the way WP-CLI supports a hierarchy for these config files so it could be |
No there's no generated |
In that case if we only introduce an alias into Prompting to ignore the file might be a good idea, but there might also be a benefit to committing this file so all developers have access to this alias. It would need setting up once. Maybe this means it would be better off as a Composer command such as |
I might have a play around with this as a learning exercise for myself. Not done anything with Composer plugins yet. |
Awesome, have at it! Agree on your proposed name for the command. I think the output from the command should indicate how you would then use it eg:
Other nice thing it could do is check for WP CLI being installed on the host, and if not provide installation instructions or link to the WP CLi install docs
|
Dug into this, and it's definitely possible; given the docker-compose container names are predictable, you can use them directly in
(These options aren't properly documented; opened wp-cli/handbook#462 for that.) Due to wp-cli/wp-cli#5447 (comment) we can't specify a default alias, although we could support eg |
I misread this ticket (I thought it was about an alias to the |
Running a WP-CLI command on default Altis local server requires the following:
This works fine but is a non-standard way of interfacing with WP-CLI. If your project is already set up you can instead add an alias:
where
xxx
is the name of the PHP container, eg.foo_php_1
.This allows you to subsequently run:
The advantage this has is that tab completion works and it's a more familiar, shorter, and memorable interface to WP-CLI.
Is it possible for Altis local server to provide a default alias that is aware of the PHP container name?
Acceptance Criteria
composer server create-alias
commandFor Altis Team Use
Ready for Work Checklist
Is this ticket ready to be worked on? See
the Play Book Definition of Ready
The text was updated successfully, but these errors were encountered: