{
  "id": "snitch",
  "name": "snitch",
  "homepage": "https://github.com/karol-broda/snitch",
  "description": "Prettier way to inspect network connections",
  "executables": [
    "snitch"
  ],
  "dotfiles": {
    "paths": [
      "[configHome]/snitch/snitch.toml",
      "~/.local/state/snitch/tui.json"
    ],
    "secret": []
  },
  "commands": {
    "format": 1,
    "label": "Snitch",
    "description": "List network connections as a table. The interactive TUI, json, watch and upgrade commands are left out.",
    "quality": "ai-draft",
    "parser": {
      "end_of_options": "--",
      "interleave": "permute",
      "long_equals": true,
      "short_attached": true,
      "short_bundles": false
    },
    "subcommand": [
      {
        "path": [
          "ls"
        ],
        "label": "List connections",
        "description": "One-shot table of sockets and processes, optionally filtered.",
        "source": [
          {
            "id": "snitch-readme",
            "kind": "manual",
            "url": "https://github.com/karol-broda/snitch/blob/master/README.md",
            "revision": "master README",
            "evidence": "snitch ls               # styled table (default)\nsnitch ls -l            # listening only\nsnitch ls -t -l         # tcp listeners\nsnitch ls -e            # established only\nsnitch ls -p            # plain/parsable output\nsnitch ls -o json       # json output\nsnitch ls -o csv        # csv output\nsnitch ls -n            # numeric (no dns resolution)\nsnitch ls --no-headers  # omit headers\n-t, --tcp           tcp only\n-u, --udp           udp only\n-l, --listen        listening sockets\n-e, --established   established connections\n-4, --ipv4          ipv4 only\n-6, --ipv6          ipv6 only\nsnitch ls proto=tcp state=listen\nsnitch ls pid=1234\nsnitch ls proc=nginx\nsnitch ls lport=443\nsnitch ls contains=google"
          }
        ],
        "field": [
          {
            "id": "listen",
            "label": "Listening sockets",
            "type": "boolean",
            "option": [
              "--listen",
              "-l"
            ],
            "sources": [
              "snitch-readme"
            ]
          },
          {
            "id": "established",
            "label": "Established connections",
            "type": "boolean",
            "option": [
              "--established",
              "-e"
            ],
            "sources": [
              "snitch-readme"
            ]
          },
          {
            "id": "tcp",
            "label": "TCP only",
            "type": "boolean",
            "option": [
              "--tcp",
              "-t"
            ],
            "sources": [
              "snitch-readme"
            ]
          },
          {
            "id": "udp",
            "label": "UDP only",
            "type": "boolean",
            "option": [
              "--udp",
              "-u"
            ],
            "sources": [
              "snitch-readme"
            ]
          },
          {
            "id": "ipv4",
            "label": "IPv4 only",
            "type": "boolean",
            "option": [
              "--ipv4",
              "-4"
            ],
            "sources": [
              "snitch-readme"
            ]
          },
          {
            "id": "ipv6",
            "label": "IPv6 only",
            "type": "boolean",
            "option": [
              "--ipv6",
              "-6"
            ],
            "sources": [
              "snitch-readme"
            ]
          },
          {
            "id": "output",
            "label": "Output format",
            "type": "enum",
            "option": [
              "-o"
            ],
            "choices": [
              {
                "value": "json",
                "label": "JSON"
              },
              {
                "value": "csv",
                "label": "CSV"
              }
            ],
            "sources": [
              "snitch-readme"
            ]
          },
          {
            "id": "plain",
            "label": "Plain output",
            "type": "boolean",
            "option": [
              "-p"
            ],
            "sources": [
              "snitch-readme"
            ]
          },
          {
            "id": "numeric",
            "label": "No name resolution",
            "type": "boolean",
            "option": [
              "-n"
            ],
            "sources": [
              "snitch-readme"
            ]
          },
          {
            "id": "no_headers",
            "label": "Omit headers",
            "type": "boolean",
            "option": [
              "--no-headers"
            ],
            "sources": [
              "snitch-readme"
            ]
          },
          {
            "id": "filters",
            "label": "Filters",
            "description": "key=value pairs such as proto=tcp, state=listen, pid=1234, proc=nginx, lport=443, contains=google.",
            "type": "string",
            "position": 0,
            "multiple": true,
            "sources": [
              "snitch-readme"
            ]
          }
        ],
        "task": [
          {
            "id": "listeners",
            "label": "TCP listeners",
            "set": {
              "tcp": [
                true
              ],
              "listen": [
                true
              ]
            },
            "fields": [
              "tcp",
              "listen",
              "numeric"
            ],
            "required": []
          },
          {
            "id": "process",
            "label": "Find a process",
            "fields": [
              "filters",
              "numeric"
            ],
            "required": [
              "filters"
            ]
          },
          {
            "id": "export",
            "label": "Export as JSON",
            "set": {
              "output": [
                "json"
              ]
            },
            "fields": [
              "output",
              "listen",
              "established"
            ],
            "required": []
          }
        ],
        "group": [
          {
            "id": "basic",
            "label": "Basic",
            "fields": [
              "listen",
              "established",
              "tcp",
              "udp",
              "filters",
              "output"
            ]
          },
          {
            "id": "advanced",
            "label": "Advanced",
            "fields": [
              "ipv4",
              "ipv6",
              "plain",
              "numeric",
              "no_headers"
            ]
          }
        ]
      }
    ]
  }
}
