Sources: bin/useragent, src/Console/ConsoleApp.php
Run the CLI executable:
./bin/useragent [options]CLI args parsed as --key=value (or --flag => true).
- Browser/device/os values are parsed with enum
tryFrominbuildSpec(). - Invalid bot type fails in
generateBot()and returns non-zero exit code. - Count is clamped to 1..100 in standard generation path.
- Route command path:
help,examples,bot, or standard generation. - Standard path builds optional
GenerationSpecfrom parsed arguments. - Loop for
count; callUserAgentService::generate($spec)each iteration. - If
--uniqueis set, command retries generation up to 50 attempts for per-run uniqueness. - Render output as
text,json, orcsv.
None.
Writes output to stdout; errors to stderr.
- Exit code
0on success. - Exit code
1on exceptions or invalid bot type.
- Service exceptions propagate to top-level catch and return
1. - Unknown bot type returns
1with available bot list. - Invalid enum inputs are ignored rather than rejected; resulting spec may become unconstrained.