Skip to content

docs: add Git Bash on Windows section to installing guide#635

Merged
swissspidy merged 7 commits intomainfrom
copilot/add-to-documentation-wp-cli
Apr 14, 2026
Merged

docs: add Git Bash on Windows section to installing guide#635
swissspidy merged 7 commits intomainfrom
copilot/add-to-documentation-wp-cli

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 14, 2026

WP-CLI's wp.bat wrapper doesn't work in Git Bash on Windows, leaving users without a clear path forward. This adds a dedicated subsection under "Installing on Windows" explaining how to create a POSIX-compatible wp wrapper file (no extension) that works in Git Bash, including Cygwin path translation logic.

Changes

  • guides/installing.md — added #### Using WP-CLI with Git Bash on Windows subsection after the existing Windows CLI instructions, with the following wrapper script to place at c:\wp-cli\wp:
#!/usr/bin/env sh

dir=$(d=${0%[/\\]*}; cd "$d"; pwd)

# See if we are running in Cygwin by checking for cygpath program
if command -v 'cygpath' >/dev/null 2>&1; then
    if [[ $(which php) == /cygdrive/* ]]; then
        dir=$(cygpath -m $dir);
    fi
fi

dir=$(echo $dir | sed 's/ /\ /g')
"${dir}/wp-cli.phar" "$@"

Copilot AI changed the title [WIP] Add usage details for wp-cli on Windows using Git Bash docs: add Git Bash on Windows section to installing guide Apr 14, 2026
Copilot AI requested a review from swissspidy April 14, 2026 15:49
@swissspidy
Copy link
Copy Markdown
Member

/gemini review

@swissspidy swissspidy requested a review from Copilot April 14, 2026 18:38
@swissspidy swissspidy marked this pull request as ready for review April 14, 2026 18:39
@swissspidy swissspidy requested a review from a team as a code owner April 14, 2026 18:39
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request adds a guide and a shell script wrapper for running WP-CLI within Git Bash on Windows. The review feedback identifies several technical improvements for the script, including switching the shebang to bash to support specific syntax, enhancing path detection for MSYS2 environments, and fixing a logic error in how directory paths with spaces are handled.

Comment thread guides/installing.md Outdated
Comment thread guides/installing.md Outdated
Comment thread guides/installing.md Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds Git Bash-specific guidance to the Windows installation docs so users can run WP-CLI from Git Bash by creating a POSIX-style wp wrapper script alongside wp-cli.phar.

Changes:

  • Added a new “Using WP-CLI with Git Bash on Windows” subsection under “Installing on Windows”.
  • Documented a wp (no-extension) shell wrapper script intended to run wp-cli.phar from Git Bash, including optional Cygwin path translation logic.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread guides/installing.md
Comment thread guides/installing.md Outdated
Comment thread guides/installing.md Outdated
Comment thread guides/installing.md Outdated
Comment thread guides/installing.md
swissspidy and others added 4 commits April 14, 2026 21:05
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Agent-Logs-Url: https://github.com/wp-cli/handbook/sessions/95978eb1-7a0d-4e19-8163-cddb00121451

Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
@swissspidy swissspidy merged commit 097b463 into main Apr 14, 2026
6 checks passed
@swissspidy swissspidy deleted the copilot/add-to-documentation-wp-cli branch April 14, 2026 19:24
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.

Add to Documentation - wp-cli for windows using gitbash

3 participants