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 }
[[commands.source]]
id = "readme"
kind = "help"
url = "https://github.com/stern/stern#cli-flags"
revision = "2026-10-27"
evidence = """
stern pod-query [flags]
`--all-namespaces`, `-A` | `false` | If present, tail across all namespaces. A specific namespace is ignored even if specified with --namespace.
`--container`, `-c` | `.*` | Container name when multiple containers in pod. (regular expression)
`--context` | | The name of the kubeconfig context to use
`--exclude`, `-e` | `[]` | Log lines to exclude. (regular expression)
`--include`, `-i` | `[]` | Log lines to include. (regular expression)
`--namespace`, `-n` | | Kubernetes namespace to use. Default to namespace configured in kubernetes context.
`--no-follow` | `false` | Exit when all logs have been shown.
`--selector`, `-l` | | Selector (label query) to filter on.
`--since`, `-s` | `48h0m0s` | Return logs newer than a relative duration like 5s, 2m, or 3h.
`--tail` | `-1` | The number of lines from the end of the logs to show.
`--timestamps`, `-t` | | Print timestamps with the specified format.
`--only-log-lines` | `false` | Print only log lines
"""
[[commands.field]]
id = "query"
label = "Pod query"
description = "Regular expression, or resource/name such as deployment/nginx."
type = "string"
position = 0
min = 1
sources = ["readme"]
[[commands.field]]
id = "namespace"
label = "Namespace"
type = "string"
option = ["--namespace", "-n"]
sources = ["readme"]
[[commands.field]]
id = "all_namespaces"
label = "All namespaces"
type = "boolean"
option = ["--all-namespaces", "-A"]
sources = ["readme"]
[[commands.field]]
id = "context"
label = "Kube context"
type = "string"
option = ["--context"]
sources = ["readme"]
[[commands.field]]
id = "container"
label = "Container (regex)"
type = "string"
option = ["--container", "-c"]
sources = ["readme"]
[[commands.field]]
id = "selector"
label = "Label selector"
type = "string"
option = ["--selector", "-l"]
sources = ["readme"]
[[commands.field]]
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"]
[[commands.field]]
id = "tail"
label = "Lines from the end"
type = "integer"
option = ["--tail"]
sources = ["readme"]
[[commands.field]]
id = "include"
label = "Include lines (regex)"
type = "string"
option = ["--include", "-i"]
multiple = true
sources = ["readme"]
[[commands.field]]
id = "exclude"
label = "Exclude lines (regex)"
type = "string"
option = ["--exclude", "-e"]
multiple = true
sources = ["readme"]
[[commands.field]]
id = "timestamps"
label = "Show timestamps"
type = "boolean"
option = ["--timestamps", "-t"]
sources = ["readme"]
[[commands.field]]
id = "no_follow"
label = "Do not follow"
type = "boolean"
option = ["--no-follow"]
sources = ["readme"]
[[commands.task]]
id = "follow"
label = "Follow logs"
fields = ["query", "namespace", "since", "timestamps"]
required = ["query"]
[[commands.task]]
id = "recent"
label = "Recent lines, then exit"
fields = ["query", "namespace", "tail", "no_follow"]
required = ["query"]
set = { no_follow = [true] }
[[commands.group]]
id = "basic"
label = "Basic"
fields = ["query", "namespace", "all_namespaces", "since", "tail", "timestamps"]
[[commands.group]]
id = "advanced"
label = "Advanced"
fields = ["context", "container", "selector", "include", "exclude", "no_follow"]