apexe 0.6.1

Outside-In CLI-to-Agent Bridge
{
  "schema_version": "1.0",
  "command": "tail",
  "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 tail --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. '-q, --quiet, --silent' is one help entry carrying two long forms; it is split into a -q/--quiet flag and a separate --silent alias because the overlay format carries at most one long form per flag. Enum values for --follow come from its own help entry '--follow[={name|descriptor}]'. conflicts_with is derived from this help text only: -c against -n because 'output the last NUM bytes' and 'output the last NUM lines' select the same quantity in incompatible units, and -q against -v from 'never output headers giving file names' against 'always output headers giving file names'. Neither pair is diagnosed by the reference build: 'tail -n 2 -c 3 FILE' and 'tail -q -v FILE' both exit 0 and resolve last-one-wins. -F is not marked as conflicting with -f because --help defines it as 'same as --follow=name --retry', which is a spelling of -f rather than an alternative to it. --retry, --pid, --sleep-interval and --max-unchanged-stats are documented as qualifying -f, not as excluding anything; running 'tail --retry FILE' without -f exits 0 with the warning '--retry ignored; --retry is useful only when following'. 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. `tail --follow name g.txt` reports \"tail: cannot open 'name' for reading: No such file or directory\" and then follows g.txt by descriptor, which is the opposite of what was asked, while `tail --follow=name g.txt` follows by name. long_running on this flag is unchanged and orthogonal: it describes termination, not argv shape."
  },
  "description": "Print the last 10 lines of each FILE to standard output. With more than one FILE, precede each with a header giving the file name. With no FILE, or when FILE is -, read standard input.",
  "flags": [
    { "short": "-c", "long": "--bytes", "type": "string", "value_name": "NUM", "conflicts_with": ["-n"], "description": "Output the last NUM bytes; or use -c +NUM to output starting with byte NUM of each file. NUM may have a multiplier suffix: b 512, kB 1000, K 1024, MB 1000*1000, M 1024*1024, and so on for G, T, P, E, Z, Y, R, Q; binary prefixes such as KiB=K and MiB=M can be used too." },
    { "short": "-f", "long": "--follow", "type": "enum", "long_running": true, "value_name": "HOW", "value_optional": true, "enum_values": ["name", "descriptor"], "conflicts_with": ["-F"], "description": "Output appended data as the file grows; an absent option argument means 'descriptor'. Following the descriptor keeps tracking a file that is renamed; use --follow=name to track the actual name instead, which accommodates renaming, removal and creation. This option may not terminate on its own." },
    { "short": "-F", "type": "boolean", "long_running": true, "conflicts_with": ["-f"], "description": "Same as --follow=name --retry. This option may not terminate on its own." },
    { "short": "-n", "long": "--lines", "type": "string", "value_name": "NUM", "conflicts_with": ["-c"], "description": "Output the last NUM lines, instead of the last 10; or use -n +NUM to skip NUM-1 lines at the start. NUM accepts the same multiplier suffixes as --bytes." },
    { "long": "--max-unchanged-stats", "type": "integer", "value_name": "N", "description": "With --follow=name, reopen a FILE which has not changed size after N (default 5) iterations to see if it has been unlinked or renamed (this is the usual case of rotated log files); with inotify, this option is rarely useful." },
    { "long": "--pid", "type": "integer", "value_name": "PID", "repeatable": true, "description": "With -f, terminate after process ID, PID dies; can be repeated to watch multiple processes." },
    { "short": "-q", "long": "--quiet", "type": "boolean", "conflicts_with": ["-v"], "description": "Never output headers giving file names." },
    { "long": "--silent", "type": "boolean", "conflicts_with": ["-v"], "description": "Never output headers giving file names; listed by --help as an alias of -q and --quiet." },
    { "long": "--retry", "type": "boolean", "description": "Keep trying to open a file if it is inaccessible. Useful only when following." },
    { "short": "-s", "long": "--sleep-interval", "type": "float", "value_name": "N", "description": "With -f, sleep for approximately N seconds (default 1.0) between iterations; with inotify and --pid=P, check process P at least once every N seconds." },
    { "short": "-v", "long": "--verbose", "type": "boolean", "conflicts_with": ["-q", "--silent"], "description": "Always output headers giving file names." },
    { "short": "-z", "long": "--zero-terminated", "type": "boolean", "description": "Line delimiter is NUL, not newline." },
    { "long": "--help", "type": "boolean", "description": "Display this help and exit." },
    { "long": "--version", "type": "boolean", "description": "Output version information and exit." }
  ],
  "positional_args": [
    { "name": "file", "type": "path", "variadic": true, "required": false, "description": "Files to print the last part of. With no FILE, or when FILE is -, read standard input." }
  ],
  "annotations": {
    "readonly": true,
    "destructive": false,
    "idempotent": true,
    "requires_approval": false
  }
}