-
Notifications
You must be signed in to change notification settings - Fork 20
Error when scaffold package-readme commands are not loaded #271
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
Draft
Copilot
wants to merge
7
commits into
main
Choose a base branch
from
copilot/fix-readme-output-issue
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+23
−15
Conversation
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
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] Fix incomplete output of README.md when custom package not installed
Error when scaffold package-readme commands are not loaded
Jan 14, 2026
This comment was marked as resolved.
This comment was marked as resolved.
When wp scaffold package creates a new package, it now explicitly loads the command file (hello-world-command.php) before calling package-readme. This ensures the command is registered in WP-CLI so it can be properly documented in the generated README. Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
This comment was marked as resolved.
This comment was marked as resolved.
swissspidy
reviewed
Jan 14, 2026
Changed package-readme call to use launch=true instead of launch=false. This spawns a new WP-CLI process that automatically loads the wp-cli.yml file from the package directory, which in turn loads the command file. This is cleaner than hardcoding the command filename. Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
Member
|
Running |
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.
Plan to fix missing command error in scaffold package-readme
Summary
The fix ensures that when
wp scaffold packagecreates a new package and callsscaffold package-readme, the command is properly loaded via the automatically createdwp-cli.ymlfile. Usinglaunch => truespawns a new WP-CLI process that reads the wp-cli.yml configuration from the package directory.Original prompt
This section details on the original issue you should resolve
<issue_title>When running
wp scaffold package-readme, the output ofREADME.mdis incomplete if the custom package is not installed</issue_title><issue_description>## Bug Report
Describe the current, buggy behavior
I created a custom package containing a command named "bzmn." When I am in the directory containing the source, and I run
wp scaffold package-readme ., the output inREADME.mdis substantially truncated. For an example, please refer to README - without bzmn custom command installed.md. Command descriptions, options, and examples are all absent.If I install the
bzmncustom command viawp package install ., then runwp scaffold package-readme ., the output is complete. For an example, please refer to README - with bzmn custom command installed.md.If you diff the files, the issue is glaring.
It seems to be the case that the README information is only correct (comprehensive, as in the second example) if the custom package is installed on the system. If it isn't installed, you get the incomplete "style" of README, as in the first example. Is that behaviour intentional? If so, is that desirable? My expectation is that the
wp scaffold package-readme .command only sees and operates on the files in the current directory. If the developer's custom package needs to be installed for the package-readme subcommand to work, it may be helpful to note that in the documentation.Since a developer running the command to generate the README probably already has the package installed, this issue may have been overlooked. I only encountered the issue when creating a Docker container to automatically generate the README. The container, of course, didn't have my custom package pre-installed, and it took a bit of time to figure out why the command output wasn't the same as on my local computer, when the commands themselves were identical.
Let us know what environment you are running this on
The output of
wp --info:Then, when you run
wp scaffold package-readme .in your package folder, WP-CLI will read that file and load your command. The generated README then has the full contents in it as expected, I just tested it.Tip: if you wanna keep the "There are a few automated processes. [...]" section at the end, check out the note regarding custom sections.</comment_new>
<comment_new>@swissspidy
It loads some information from
composer.json, yes. S...wp scaffold package-readme, the output ofREADME.mdis incomplete if the custom package is not installed #270💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.