List¶
Usage¶
hslist[-h][FIELD [FIELD ...]][-w COND [COND ...]][-t TAG [TAG...]][-g GROUP][--order-by FIELD [--desc]][--count | --limit NUM][-f FORMAT | --json | --csv][-d CHAR][-i][--failed | --succeeded | --completed | --remaining][--retries]
hs list --fields
hs list --tag-keys
hs list --tag-values KEY
Description¶
Search tasks in the database.
A database must be configured. Specifying FIELD names defines what is included in the output (by default all fields are included).
This command maps directly to underlying SQL queries.
Arguments¶
- FIELD
Select specific named fields to include in output. Default is to include all fields.
Options¶
-w,--whereCOND…List of conditional statements to filter results (e.g.,
-w 'duration >= 600').Operators include
==,!=,>=,<=,>,<,~. The~operator applies a regular expression.-t,--with-tagTAG…Filter on one or more tags. (e.g.,
-t specialor-t file:a).Leaving the value unspecified will return any task for which the key exists. Specifying a full key:value pair will match on both.
-g,--groupGROUPFilter results to a single task group.
-s,--order-byFIELD[--desc]Order results by field. Optionally, in descending order.
-F,--failedAlias for
-w 'exit_status != 0'.-S,--succeededAlias for
-w 'exit_status == 0'.-C,--completedAlias for
-w 'exit_status != null'.For backwards compatibility,
--finishedis also valid.-R,--remainingAlias for
-w 'exit_status == null'.--retriesAlias for
-w 'attempt > 1'(tasks that have been retried).-f,--formatFORMATSpecify output format (either
normal,plain,table,csv,json).Default is
normalfor whole-task output. If any FIELD names are given, output is formatted in simpleplaintext; usecsvfor compliant output. The pretty-printedtableformatting is good for presentation on wide screens.See
--csv,--json, and--delimiter.--csvFormat output as CSV. (Shorthand for
--format=csv).--jsonFormat output as JSON. (Shorthand for
--format=json).-d,--delimiterCHARField seperator for plain/csv formats.
-l,--limitNUMLimit the number of results.
-c,--countShow count of results.
--tag-keysShow all distinct tag keys instead of tasks.
--tag-valuesKEYShow all distinct tag values for the given tag KEY.
-i,--ignore-partitionsSuppress auto-union feature (SQLite only).
When using the sqlite provider, all databases matching the numbering pattern applied by
hs initdb --rotatewill automatically be attached as partitions and used within a temporary view, making full task history searchable.