Add global --ssh-args argument for SSH/Docker/Vagrant execution#6206
Open
Add global --ssh-args argument for SSH/Docker/Vagrant execution#6206
Conversation
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add global --ssh-args argument for SSH functionality
Add global --ssh-args argument for SSH/Docker/Vagrant execution
Jan 25, 2026
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
WP-CLI's
--sshflag only accepts connection strings, preventing users from passing tool-specific arguments like SSH options (-o ConnectTimeout=5), Docker flags (--env), or Vagrant parameters.Changes
Core Implementation
ssh-argsto global config spec withmultiple: truesupportgenerate_ssh_command()to inject escaped args into all scheme commands (SSH, Docker, Docker Compose, Docker Compose Run, Vagrant)--ssh-argsfrom arguments passed to remote WP-CLI to prevent double-processingSupporting Changes
ssh-argsto alias specification for alias supportGlobalConfigtype definitionUsage
All arguments are shell-escaped via
escapeshellarg()before execution.Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
example.com/usr/bin/php php vendor/bin/phpunit --color=always --bootstrap ./vendor/wp-cli/wp-cli-tests/tests/bootstrap.php '-d short_open_tag=Off' '-d error_reporting=E_ALL' '-n' '-l' './bundle/rmccue/requests/src/Excepgit features/config.feature /usr/bin/grep quests/src/Auth./home/REDACTED/work/wp-cli/wp-cli/vendor/wp-cli/wp-cli-tests/bin/run-phpstan-tests--no-color r.php cal/bin/grep grep -l ssh features/http-logging.feature p/bin/grep php/class-wp-cliphp hp .php grep(dns block)nosuchhost_asdf_asdf_asdf.com/usr/bin/php php vendor/bin/phpunit --color=always --bootstrap ./vendor/wp-cli/wp-cli-tests/tests/bootstrap.php '-d short_open_tag=Off' '-d error_reporting=E_ALL' '-n' '-l' './bundle/rmccue/requests/src/Excepgit features/config.feature /usr/bin/grep quests/src/Auth./home/REDACTED/work/wp-cli/wp-cli/vendor/wp-cli/wp-cli-tests/bin/run-phpstan-tests--no-color r.php cal/bin/grep grep -l ssh features/http-logging.feature p/bin/grep php/class-wp-cliphp hp .php grep(dns block)wordpress/usr/bin/ssh ssh -o ConnectTimeout=5 -T -vvv wordpress wp '--debug' '--ssh-args=-o ConnectTimeout=5' '--version' k/wp-cli/wp-cli/features/validation.feature mposer/vendor/bin/grep tests/SchemaValiwhich 416.php rgo/bin/grep grep -l ssh k/wp-cli/wp-cli/features/cli-info.feature grep ssh 414.php mposer/vendor/bin/grep grep(dns block)/usr/bin/ssh ssh -o ConnectTimeout=5 -o ServerAliveInterval=10 -T -vvv wordpress wp '--debug' '--ssh-args=-o ConnectTimeout=5' '--ssh-args=-o ServerAliveInterval=10' '--version' /home/REDACTED/.composer/vendor/bin/grep tests/UtilsTest.sh 402.php ep grep hpcs�� ssh k/wp-cli/wp-cli/features/formatter.feature tnet/tools/git ssh 429.php /home/REDACTED/.co-a grep(dns block)/usr/bin/ssh ssh -o ConnectTimeout=5 -T -vvv wordpress wp '--debug' '--version' -d short_open_tag=Off(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
--ssh-argsargument ideas#123✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.