{
  "id": "stern",
  "name": "Stern",
  "homepage": "https://github.com/stern/stern",
  "description": "Multi pod and container log tailing for Kubernetes.",
  "executables": [
    "stern"
  ],
  "dotfiles": {
    "paths": [
      "~/.config/stern/config.yaml"
    ],
    "secret": [],
    "side_effect": false
  },
  "commands": {
    "format": 1,
    "label": "Tail Kubernetes pod logs",
    "description": "Tail logs from every pod and container matching a query, with namespace, selector, time and line filters. Output templates, colors and API throttling options are left out.",
    "quality": "ai-draft",
    "parser": {
      "end_of_options": "--",
      "interleave": "permute",
      "long_equals": true,
      "short_attached": true,
      "short_bundles": false
    },
    "source": [
      {
        "id": "readme",
        "kind": "help",
        "url": "https://github.com/stern/stern#cli-flags",
        "revision": "2026-10-27",
        "evidence": "stern pod-query [flags]\n`--all-namespaces`, `-A`    | `false`                       | If present, tail across all namespaces. A specific namespace is ignored even if specified with --namespace.\n`--container`, `-c`         | `.*`                          | Container name when multiple containers in pod. (regular expression)\n`--context`                 |                               | The name of the kubeconfig context to use\n`--exclude`, `-e`           | `[]`                          | Log lines to exclude. (regular expression)\n`--include`, `-i`           | `[]`                          | Log lines to include. (regular expression)\n`--namespace`, `-n`         |                               | Kubernetes namespace to use. Default to namespace configured in kubernetes context.\n`--no-follow`               | `false`                       | Exit when all logs have been shown.\n`--selector`, `-l`          |                               | Selector (label query) to filter on.\n`--since`, `-s`             | `48h0m0s`                     | Return logs newer than a relative duration like 5s, 2m, or 3h.\n`--tail`                    | `-1`                          | The number of lines from the end of the logs to show.\n`--timestamps`, `-t`        |                               | Print timestamps with the specified format.\n`--only-log-lines`          | `false`                       | Print only log lines\n"
      }
    ],
    "field": [
      {
        "id": "query",
        "label": "Pod query",
        "description": "Regular expression, or resource/name such as deployment/nginx.",
        "type": "string",
        "position": 0,
        "min": 1,
        "sources": [
          "readme"
        ]
      },
      {
        "id": "namespace",
        "label": "Namespace",
        "type": "string",
        "option": [
          "--namespace",
          "-n"
        ],
        "sources": [
          "readme"
        ]
      },
      {
        "id": "all_namespaces",
        "label": "All namespaces",
        "type": "boolean",
        "option": [
          "--all-namespaces",
          "-A"
        ],
        "sources": [
          "readme"
        ]
      },
      {
        "id": "context",
        "label": "Kube context",
        "type": "string",
        "option": [
          "--context"
        ],
        "sources": [
          "readme"
        ]
      },
      {
        "id": "container",
        "label": "Container (regex)",
        "type": "string",
        "option": [
          "--container",
          "-c"
        ],
        "sources": [
          "readme"
        ]
      },
      {
        "id": "selector",
        "label": "Label selector",
        "type": "string",
        "option": [
          "--selector",
          "-l"
        ],
        "sources": [
          "readme"
        ]
      },
      {
        "id": "since",
        "label": "Since",
        "description": "Relative duration such as 5s, 2m or 3h.",
        "type": "string",
        "option": [
          "--since",
          "-s"
        ],
        "suggestions": [
          {
            "value": "5m",
            "label": "5 minutes"
          },
          {
            "value": "1h",
            "label": "1 hour"
          }
        ],
        "sources": [
          "readme"
        ]
      },
      {
        "id": "tail",
        "label": "Lines from the end",
        "type": "integer",
        "option": [
          "--tail"
        ],
        "sources": [
          "readme"
        ]
      },
      {
        "id": "include",
        "label": "Include lines (regex)",
        "type": "string",
        "option": [
          "--include",
          "-i"
        ],
        "multiple": true,
        "sources": [
          "readme"
        ]
      },
      {
        "id": "exclude",
        "label": "Exclude lines (regex)",
        "type": "string",
        "option": [
          "--exclude",
          "-e"
        ],
        "multiple": true,
        "sources": [
          "readme"
        ]
      },
      {
        "id": "timestamps",
        "label": "Show timestamps",
        "type": "boolean",
        "option": [
          "--timestamps",
          "-t"
        ],
        "sources": [
          "readme"
        ]
      },
      {
        "id": "no_follow",
        "label": "Do not follow",
        "type": "boolean",
        "option": [
          "--no-follow"
        ],
        "sources": [
          "readme"
        ]
      }
    ],
    "task": [
      {
        "id": "follow",
        "label": "Follow logs",
        "fields": [
          "query",
          "namespace",
          "since",
          "timestamps"
        ],
        "required": [
          "query"
        ]
      },
      {
        "id": "recent",
        "label": "Recent lines, then exit",
        "fields": [
          "query",
          "namespace",
          "tail",
          "no_follow"
        ],
        "required": [
          "query"
        ],
        "set": {
          "no_follow": [
            true
          ]
        }
      }
    ],
    "group": [
      {
        "id": "basic",
        "label": "Basic",
        "fields": [
          "query",
          "namespace",
          "all_namespaces",
          "since",
          "tail",
          "timestamps"
        ]
      },
      {
        "id": "advanced",
        "label": "Advanced",
        "fields": [
          "context",
          "container",
          "selector",
          "include",
          "exclude",
          "no_follow"
        ]
      }
    ]
  }
}
