id = "hl"
name = "hl"
homepage = "https://github.com/pamburus/hl"
description = "A fast and powerful log viewer and processor that converts JSON logs or logfmt logs into a clear human-readable format."
executables = ["hl"]
[dotfiles]
paths = [
"[configHome]/hl/config.yaml",
"[configHome]/hl/config.toml",
"[configHome]/hl/config.json",
"[configHome]/hl/themes/",
]
secret = []
[commands]
format = 1
label = "View logs"
description = "Format JSON or logfmt log files for reading, with level, time and field filters. Follow mode, themes, and tuning options are mostly left out."
quality = "ai-draft"
parser = { end_of_options = "--", interleave = "permute", long_equals = true, short_attached = true, short_bundles = false }
[[commands.source]]
id = "help"
kind = "help"
url = "https://github.com/pamburus/hl/blob/master/README.md"
evidence = """
-s, --sort Sort entries chronologically
-F, --follow Follow input streams and sort entries chronologically within time frame set by --sync-interval-ms option
-l, --level <LEVEL> Display entries with level >= <LEVEL> [env: HL_LEVEL=]
--since <TIME> Display entries with timestamp >= <TIME>
--until <TIME> Display entries with timestamp <= <TIME>
-f, --filter <FILTER> Filter entries by matching field values [k=v, k~=v, k~~=v, 'k!=v', 'k?!=v', etc]
-q, --query <QUERY> Filter entries using a query expression ['status>=400 or duration>=15', etc]
-r, --raw Output raw source entries instead of formatted entries
-h, --hide <KEY> Hide or reveal fields with the specified keys, prefix with ! to reveal, provide '!*' to reveal all
-L, --local Use local time zone, overrides --time-zone option
-e, --hide-empty-fields Hide empty fields, applies for null, string, object and array fields only [env: HL_HIDE_EMPTY_FIELDS=]
--paging <WHEN> Control pager usage (HL_PAGER or PAGER) [env: HL_PAGING=] [default: auto] [possible values: auto, always, never]
-o, --output <FILE> Output file
"""
[[commands.field]]
id = "files"
label = "Log files"
description = "Leave empty to read standard input."
type = "path"
position = 0
multiple = true
path = { kind = "file", role = "input" }
sources = ["help"]
[[commands.field]]
id = "level"
label = "Minimum level"
type = "string"
option = ["--level", "-l"]
suggestions = [{ value = "error", label = "error" }, { value = "warning", label = "warning" }, { value = "info", label = "info" }, { value = "debug", label = "debug" }]
sources = ["help"]
[[commands.field]]
id = "since"
label = "Since"
type = "string"
option = ["--since"]
sources = ["help"]
[[commands.field]]
id = "until"
label = "Until"
type = "string"
option = ["--until"]
sources = ["help"]
[[commands.field]]
id = "filter"
label = "Field filter"
description = "For example level=error or k~=v."
type = "string"
option = ["--filter", "-f"]
multiple = true
sources = ["help"]
[[commands.field]]
id = "query"
label = "Query"
description = "For example 'status>=400 or duration>=15'."
type = "string"
option = ["--query", "-q"]
sources = ["help"]
[[commands.field]]
id = "hide"
label = "Hide field"
type = "string"
option = ["--hide", "-h"]
multiple = true
sources = ["help"]
[[commands.field]]
id = "local"
label = "Use local time zone"
type = "boolean"
option = ["--local", "-L"]
sources = ["help"]
[[commands.field]]
id = "sort"
label = "Sort chronologically"
type = "boolean"
option = ["--sort", "-s"]
sources = ["help"]
[[commands.field]]
id = "follow"
label = "Follow"
type = "boolean"
option = ["--follow", "-F"]
sources = ["help"]
[[commands.field]]
id = "paging"
label = "Pager"
type = "enum"
option = ["--paging"]
choices = [{ value = "auto", label = "Auto" }, { value = "always", label = "Always" }, { value = "never", label = "Never" }]
sources = ["help"]
[[commands.field]]
id = "raw"
label = "Raw entries"
type = "boolean"
option = ["--raw", "-r"]
sources = ["help"]
[[commands.task]]
id = "errors"
label = "Show errors only"
fields = ["files", "level", "local"]
required = ["files"]
set = { level = ["error"] }
[[commands.task]]
id = "follow"
label = "Follow a log"
fields = ["files", "follow", "level", "local"]
required = ["files"]
set = { follow = [true] }
[[commands.group]]
id = "basic"
label = "Basic"
fields = ["files", "level", "since", "until", "filter", "query", "local"]
[[commands.group]]
id = "advanced"
label = "Advanced"
fields = ["hide", "sort", "follow", "paging", "raw"]