Skip to content

Commit ac4249e

Browse files
committed
Removes the --agentic-run option
1 parent 3521965 commit ac4249e

18 files changed

Lines changed: 77 additions & 70 deletions

CHANGELOG.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,16 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
77

88
## [Unreleased]
99

10-
## [v5.10.0] - 2026-05-18
10+
## [v6.0.0] - 2026-06-XX
1111

1212
### Added
1313
- Expanded the `validation` to also validate __negated__ export-ignore directives. Closes [#70](https://github.com/raphaelstolt/lean-package-validator/issues/70).
1414
- New `--flavour` option for the `create` command which influences the `.gitattributes` file generation. Closes [#71](https://github.com/raphaelstolt/lean-package-validator/issues/71).
1515
- Expanded the `reformatting` to also reformat __negated__ export-ignore directives. Closes [#72](https://github.com/raphaelstolt/lean-package-validator/issues/72).
1616

17+
### Removed
18+
- Removed the explicit `--agentic-run` option as agent detection is now done automatically per default.
19+
1720
## [v5.9.1] - 2026-05-17
1821

1922
### Changed
@@ -573,8 +576,9 @@ Closes [#63](https://github.com/raphaelstolt/lean-package-validator/issues/63).
573576

574577
- Initial release.
575578

576-
[Unreleased]: https://github.com/raphaelstolt/lean-package-validator/compare/v5.9.1...HEAD
579+
[Unreleased]: https://github.com/raphaelstolt/lean-package-validator/compare/v6.0.0...HEAD
577580

581+
[v6.0.0]: https://github.com/raphaelstolt/lean-package-validator/compare/v5.9.1...v6.0.0
578582
[v5.9.1]: https://github.com/raphaelstolt/lean-package-validator/compare/v5.9.0...v5.9.1
579583
[v5.9.0]: https://github.com/raphaelstolt/lean-package-validator/compare/v5.8.6...v5.9.0
580584
[v5.8.6]: https://github.com/raphaelstolt/lean-package-validator/compare/v5.8.5...v5.8.6

README.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -349,14 +349,12 @@ This project [includes](./resources/boost/skills) three AI skills focused on man
349349

350350
### Agentic-friendly output
351351

352-
All commands support the `--agentic-run` option, which switches the output from human-readable text to a structured JSON object.
352+
All commands auto-detect agentic runs, which switches the output from human-readable text to a structured JSON object.
353353
This is useful when integrating the tool into AI workflows or automation pipelines where machine-readable output is preferred.
354354

355-
> [!NOTE]
356-
> As of release `v5.6.1` agentic runs are auto-detected and enabled by default.
357-
358355
``` bash
359-
lean-package-validator validate --agentic-run [<directory>]
356+
export COPILOT_MODEL=1
357+
lean-package-validator validate [<directory>]
360358
```
361359

362360
``` json

src/Commands/Concerns/OutputOptions.php

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,6 @@
1111

1212
trait OutputOptions
1313
{
14-
protected function addAgenticOutputOption(callable $addOption): void
15-
{
16-
$addOption('agentic-run', null, InputOption::VALUE_NONE, 'Enable agentic-friendly output formatting');
17-
}
18-
1914
protected function addDryRunOutputOption(callable $addOption, string $message): void
2015
{
2116
$addOption('dry-run', null, InputOption::VALUE_NONE, $message);
@@ -26,9 +21,9 @@ protected function isDryRun(InputInterface $input): bool
2621
return (bool) $input->getOption('dry-run');
2722
}
2823

29-
protected function isAgenticRun(InputInterface $input): bool
24+
protected function isAgenticRun(): bool
3025
{
31-
return AgentDetector::detect()->isAgent || $input->getOption('agentic-run') === true;
26+
return AgentDetector::detect()->isAgent === true;
3227
}
3328

3429
/**

src/Commands/CreateCommand.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,6 @@ protected function configure(): void
4949
$this->addDryRunOutputOption(function (...$args) {
5050
$this->getDefinition()->addOption(new InputOption(...$args));
5151
}, 'Do not write any files. Output the expected .gitattributes content');
52-
$this->addAgenticOutputOption(function (...$args) {
53-
$this->getDefinition()->addOption(new InputOption(...$args));
54-
});
5552

5653
$flavourDescription = 'Generate the .gitattributes file with the given flavour';
5754

@@ -70,7 +67,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
7067

7168
$this->analyser->getActualExportIgnoreAnalyser()->setDirectory($directory);
7269

73-
$isAgenticRun = $this->isAgenticRun($input);
70+
$isAgenticRun = $this->isAgenticRun();
7471

7572
$generationFlavour = $input->getOption('flavour') ?: ClassicExportIgnoreAnalyser::EXPORT_IGNORE_CLASSIC;
7673

src/Commands/InitCommand.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,6 @@ protected function configure(): void
8383
$this->addDryRunOutputOption(function (...$args) {
8484
$this->getDefinition()->addOption(new InputOption(...$args));
8585
}, 'Do not write any files. Output the content that would be written');
86-
$this->addAgenticOutputOption(function (...$args) {
87-
$this->getDefinition()->addOption(new InputOption(...$args));
88-
});
8986
}
9087

9188
/**
@@ -103,7 +100,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
103100
$overwriteDefaultLpvFile = $input->getOption('overwrite');
104101
$chosenPreset = (string) $input->getOption('preset');
105102
$globPatternFromPreset = false;
106-
$isAgenticRun = $this->isAgenticRun($input);
103+
$isAgenticRun = $this->isAgenticRun();
107104

108105
if ($directory !== WORKING_DIRECTORY) {
109106
try {

src/Commands/ReformatCommand.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,6 @@ protected function configure(): void
8383
$this->addDryRunOutputOption(function (...$args) {
8484
$this->getDefinition()->addOption(new InputOption(...$args));
8585
}, 'Do not write any files. Output the content that would be written');
86-
$this->addAgenticOutputOption(function (...$args) {
87-
$this->getDefinition()->addOption(new InputOption(...$args));
88-
});
8986
}
9087

9188
/**
@@ -112,7 +109,7 @@ private function reformatPresentExportIgnores(
112109
): int {
113110
$gitattributesPath = $this->exportIgnoreAnalyser->getGitattributesFilePath();
114111

115-
$isAgenticRun = $this->isAgenticRun($input);
112+
$isAgenticRun = $this->isAgenticRun();
116113

117114
if (!\file_exists($gitattributesPath) && $this->isDryRun($input) !== true) {
118115
if ($isAgenticRun) {

src/Commands/RefreshCommand.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,6 @@ protected function configure(): void
8585
$this->addDryRunOutputOption(function (...$args) {
8686
$this->getDefinition()->addOption(new InputOption(...$args));
8787
}, 'Do not write any files. Output the content that would be written');
88-
$this->addAgenticOutputOption(function (...$args) {
89-
$this->getDefinition()->addOption(new InputOption(...$args));
90-
});
9188
}
9289

9390
/**
@@ -103,7 +100,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
103100
{
104101
$directory = (string) $input->getArgument('directory');
105102
$chosenPreset = (string) $input->getOption('preset');
106-
$isAgenticRun = $this->isAgenticRun($input);
103+
$isAgenticRun = $this->isAgenticRun();
107104

108105
if ($directory !== '' && $directory !== WORKING_DIRECTORY) {
109106
try {

src/Commands/TreeCommand.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,12 @@ protected function configure(): void
5757

5858
$this->addOption('src', null, InputOption::VALUE_NONE, $srcDescription);
5959
$this->addOption('dist-package', null, InputOption::VALUE_NONE, $distPackageDescription);
60-
$this->addAgenticOutputOption(function (...$args) {
61-
$this->getDefinition()->addOption(new InputOption(...$args));
62-
});
6360
}
6461

6562
protected function execute(InputInterface $input, OutputInterface $output): int
6663
{
6764
$this->directoryToOperateOn = (string) $input->getArgument('directory');
68-
$isAgenticRun = $this->isAgenticRun($input);
65+
$isAgenticRun = $this->isAgenticRun();
6966

7067
if (!\is_dir($this->directoryToOperateOn)) {
7168
$warning = "Warning: The provided directory "

src/Commands/UpdateCommand.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,16 +69,13 @@ protected function configure(): void
6969
$this->addDryRunOutputOption(function (...$args) {
7070
$this->getDefinition()->addOption(new InputOption(...$args));
7171
}, 'Do not write any files. Output the expected .gitattributes content');
72-
$this->addAgenticOutputOption(function (...$args) {
73-
$this->getDefinition()->addOption(new InputOption(...$args));
74-
});
7572
}
7673

7774
protected function execute(InputInterface $input, OutputInterface $output): int
7875
{
7976
$directory = (string) $input->getArgument('directory') ?: \getcwd();
8077
$this->exportIgnoreAnalyser->setDirectory($directory);
81-
$isAgenticRun = $this->isAgenticRun($input);
78+
$isAgenticRun = $this->isAgenticRun();
8279

8380
if ((bool) $input->getOption('group')) {
8481
$this->exportIgnoreAnalyser->setGroupNonExportIgnores(true);

src/Commands/ValidateCommand.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -202,9 +202,6 @@ protected function configure(): void
202202
InputOption::VALUE_NONE,
203203
$reportStaleExportIgnoresDescription
204204
);
205-
$this->addAgenticOutputOption(function (...$args) {
206-
$this->getDefinition()->addOption(new InputOption(...$args));
207-
});
208205
}
209206

210207
/**
@@ -222,7 +219,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
222219
{
223220
$directory = (string) $input->getArgument('directory');
224221
$chosenPreset = (string) $input->getOption('preset');
225-
$isAgenticRun = $this->isAgenticRun($input);
222+
$isAgenticRun = $this->isAgenticRun();
226223

227224
if ($directory !== \getcwd()) {
228225
try {

0 commit comments

Comments
 (0)