apexe 0.6.1

Outside-In CLI-to-Agent Bridge
{
  "schema_version": "1.0",
  "command": "uniq",
  "variant": "gnu",
  "match": {
    "probe": {
      "args": ["--version"],
      "expect": "success",
      "output_contains": "GNU coreutils"
    }
  },
  "mode": "authoritative",
  "confidence": "verified",
  "provenance": {
    "platform": "linux",
    "tool_version": "9.7",
    "package": "coreutils",
    "source": "help",
    "checked_on": "2026-07-27",
    "command": "docker run --rm debian@sha256:328d16499860ae6cb9b345e2e4cebca08c2a36e4f7278482c7bd1f39d71e5bfd uniq --help",
    "environment": "debian@sha256:328d16499860ae6cb9b345e2e4cebca08c2a36e4f7278482c7bd1f39d71e5bfd",
    "notes": "Debian slim images ship no man pages, so the flag list was read from GNU --help, which is complete by GNU convention. '-D' and '--all-repeated[=METHOD]' are two separate --help entries and are kept as two flags, because -D carries no long form and --all-repeated carries no short form. GNU --help states no mutual exclusion at all, so every conflicts_with below was read off the running binary and is quoted here. '-c -D' and '-c --all-repeated=prepend' fail with 'uniq: printing all duplicated lines and repeat counts is meaningless'. '--group' combined with any of -c, -d, -D, -u or --all-repeated fails with 'uniq: --group is mutually exclusive with -c/-d/-D/-u'. '-d -D' is accepted with -D winning in both orders -- an override group, now recorded as a conflict. '-d -u' and '-D -u' are accepted too but are NOT override groups here: '-d -u' yields the empty set and '-D -u' yields the -d output, identically either way round, so neither depends on key order and neither is declared. This differs from BSD uniq, where -d and -D each win outright over -u. '-D --all-repeated=none', '-w 2 -c' and '-z -c' are also accepted. annotations: readonly is false because uniq writes its second operand -- 'uniq INPUT OUTPUT' truncates and rewrites OUTPUT, verified against a pre-existing file. conflicts_with was extended in a later pass, after the field's definition widened to cover override groups as well as diagnosed errors: apexe's input is a JSON object, which carries no ordering, so for a last-one-wins group which flag actually wins is decided by the order the caller happened to write the keys in. Every pair added then was run in BOTH orders against the reference build recorded above, and only pairs whose outcome depends on that order, or where one side is silently discarded, were added. value_optional was added on 2026-08-24, read off the reference build recorded above. GNU --help spells an optional option argument as `--opt[=VAL]` and a required one as `--opt=VAL`; every flag marked here shows the bracketed form and was then run in BOTH spellings, because the notation alone is not evidence. `uniq --group both s.txt` is \"uniq: both: No such file or directory\" (exit 1) while `uniq --group=both s.txt` succeeds; --all-repeated behaves the same."
  },
  "description": "Filter adjacent matching lines from INPUT (or standard input), writing to OUTPUT (or standard output). With no options, matching lines are merged to the first occurrence. A field is a run of blanks (usually spaces and/or TABs), then non-blank characters. Fields are skipped before chars. uniq does not detect repeated lines unless they are adjacent; you may want to sort the input first, or use 'sort -u' without 'uniq'.",
  "flags": [
    { "short": "-c", "long": "--count", "type": "boolean", "conflicts_with": ["-D", "--all-repeated", "--group"], "description": "Prefix lines by the number of occurrences." },
    { "short": "-d", "long": "--repeated", "type": "boolean", "conflicts_with": ["--group", "-D"], "description": "Only print duplicate lines, one for each group." },
    { "short": "-D", "type": "boolean", "conflicts_with": ["-c", "--group", "-d"], "description": "Print all duplicate lines." },
    { "long": "--all-repeated", "type": "enum", "value_name": "METHOD", "value_optional": true, "enum_values": ["none", "prepend", "separate"], "conflicts_with": ["-c", "--group"], "description": "Like -D, but allow separating groups with an empty line. METHOD is none (the default), prepend or separate. The value must be attached, as in --all-repeated=prepend." },
    { "short": "-f", "long": "--skip-fields", "type": "integer", "value_name": "N", "description": "Avoid comparing the first N fields." },
    { "long": "--group", "type": "enum", "value_name": "METHOD", "value_optional": true, "enum_values": ["separate", "prepend", "append", "both"], "conflicts_with": ["-c", "-d", "-D", "--all-repeated", "-u"], "description": "Show all items, separating groups with an empty line. METHOD is separate (the default), prepend, append or both. The value must be attached, as in --group=both." },
    { "short": "-i", "long": "--ignore-case", "type": "boolean", "description": "Ignore differences in case when comparing." },
    { "short": "-s", "long": "--skip-chars", "type": "integer", "value_name": "N", "description": "Avoid comparing the first N characters." },
    { "short": "-u", "long": "--unique", "type": "boolean", "conflicts_with": ["--group"], "description": "Only print unique lines." },
    { "short": "-z", "long": "--zero-terminated", "type": "boolean", "description": "Line delimiter is NUL, not newline." },
    { "short": "-w", "long": "--check-chars", "type": "integer", "value_name": "N", "description": "Compare no more than N characters in lines." },
    { "long": "--help", "type": "boolean", "description": "Display this help and exit." },
    { "long": "--version", "type": "boolean", "description": "Output version information and exit." }
  ],
  "positional_args": [
    { "name": "input", "type": "path", "required": false, "description": "File to read. With no operand the standard input is read." },
    { "name": "output", "type": "path", "required": false, "description": "File to write. It is truncated and rewritten. With no operand the standard output is used." }
  ],
  "annotations": {
    "readonly": false,
    "destructive": true,
    "idempotent": true,
    "requires_approval": true
  }
}