Skip to content

label

FunctionLists, adds, or removes page labels on one or more pages. Pipe paths from find to label many pages at once.
Options-y, --yes — required for add / rm. -n, --dry-run — preview without writing. Listing needs no flag.
LimitationsPages only: spaces are skipped and folders are refused. At most 100 paths and 10 label names per run. Writes always use the global label prefix (team: / my: are not supported). Uses the existing app permissions (no new scopes).
  • label [ls] [PATH...] — list labels on the current page or on each PATH.
  • label add NAME... PATH... — add one or more labels.
  • label rm NAME... PATH... — remove one or more labels.
  • find ... | label add NAME... -y — label every page path piped from find (no PATH on the command line when piping).

Label names come first, then paths. A word without / is read as a label name, so write page paths with a slash (./Page, /Space/Page). Flags may appear anywhere.

find -label NAME lists pages that have that global label (CQL search). Repeat -label to require several labels (AND). Combine it with -mtime, -prune, -ls, or --format csv. The search index may lag by seconds to minutes right after label add / label rm.

$ label ls ./Runbook
$ label add -n needs-review ./Runbook
$ label add needs-review ./Runbook -y
$ label rm needs-review ./Runbook -y
$ find ./MySpace -mtime +365 -prune | label add needs-review -n
$ find ./MySpace -mtime +365 -prune | label add needs-review -y
$ find -label needs-review
$ find ./MySpace -label needs-review --format csv

Recipe: Label stale pages for review.