Skip to main content

Module list

Module list 

Source
Expand description

Implementation of the list sub-command.

Enumerates job directories under root, reads meta.json and state.json for each, and emits a JSON array sorted by started_at descending. Directories that cannot be parsed as jobs are silently counted in skipped.

§CWD filtering (filter-list-by-cwd)

By default, list only returns jobs whose meta.json.cwd matches the caller’s current working directory. Two flags override this behaviour:

  • --cwd <PATH>: show only jobs created from <PATH> (overrides auto-detect).
  • --all: disable cwd filtering entirely and show all jobs.

Jobs that were created before this feature (i.e. meta.json.cwd is absent) are treated as having no cwd and will therefore not appear in the default filtered view. Use --all to see them.

§Tag filtering (add-job-tags)

--tag <PATTERN> filters jobs to those whose persisted meta.json.tags satisfy the pattern. Repeated --tag flags apply logical AND. Two pattern forms are supported:

  • Exact: aaa, hoge.fuga.geho
  • Namespace prefix: hoge.*, hoge.fuga.*

Tag filtering composes with cwd and state filtering.

Structs§

ListOpts
Options for the list sub-command.

Functions§

execute
Execute list: enumerate jobs and emit JSON.