Repository navigation
feat: allow modern commands to opt out of the spark header - #10597
Open
paulbalandan wants to merge 1 commit into
Open
paulbalandan wants to merge 1 commit into
paulbalandan wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The compatibility-sensitive STDERR migration lacks the required 4.8 upgrading-guide entry.
Review effort: Balanced
Findings: 1
Open (1)
What changed in this PR
Adds an opt-in headerless flag for modern Spark commands targeting CodeIgniter 4.8.
Changes:
- Adds
headerlesscommand metadata and lookup APIs. - Suppresses headers for marked commands and aliases while preserving help headers.
- Routes duplicate-command warnings to STDERR and adds tests/documentation.
The STDERR behavior change still needs migration guidance in upgrade_480.rst.
| File | Description |
|---|---|
system/CLI/Console.php |
Applies command-level header suppression. |
system/CLI/Commands.php |
Registers/query headerless metadata; moves warnings to STDERR. |
system/CLI/AbstractCommand.php |
Exposes isHeaderless(). |
system/CLI/Attributes/Command.php |
Adds the headerless attribute argument. |
tests/system/CLI/ConsoleTest.php |
Tests suppression and help behavior. |
tests/system/CLI/CommandsTest.php |
Tests registry metadata and shadowing. |
tests/system/CLI/AbstractCommandTest.php |
Tests command-level accessor. |
tests/system/CLI/Attributes/CommandTest.php |
Tests attribute defaults and values. |
tests/_support/Commands/Modern/HeaderlessCommand.php |
Adds a headerless fixture. |
tests/_support/Duplicates/HeaderlessDuplicateModern.php |
Adds a shadowing fixture. |
user_guide_src/source/cli/spark_commands.rst |
Links headerless-command guidance. |
user_guide_src/source/cli/cli_modern_commands.rst |
Documents the feature and API. |
user_guide_src/source/cli/cli_modern_commands/017.php |
Adds a JSON-output example. |
user_guide_src/source/changelogs/v4.8.0.rst |
Records the enhancement. |
Validation: no local tests were run; CI remains authoritative.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
michalsn
approved these changes
Oct 5, 2026
This branch has not been deployed
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.

Description
Adds
#[Command(headerless: true)], which suppresses the spark header for that command, with the same effect as always passing--no-header. A command whose output is read by another program, such as JSON piped tojqor CSV redirected to a file, otherwise relies on every caller passing the flag, and one caller without it breaks the output from the first line.help <command>and<command> --helpstill print the header.Deciding this requires the command registry before the header is printed, and building the registry runs discovery. The duplicate legacy/modern name warning printed during discovery now goes to STDERR, so it neither precedes the header on STDOUT nor ends up in a headerless command's output.
Checklist: