live-clean-prefix

command
v0.4.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 19, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Command live-clean-prefix deletes objects in the pinned sacrificial Clockify workspace whose name — or, for objects with no name, a matching field — starts with CLOCKIFY_LIVE_PREFIX.

It is a best-effort sweep: every list and delete is independent, and a failure on one object is logged and does not stop the rest. It NEVER touches objects without the prefix and refuses to run unless the confirm variable matches the workspace.

Sweep order is children before parents: scheduling assignments and time-off requests first, projects and clients last. Scheduling assignments carry no name of their own, so they are matched by their linked prefixed project — by projectId (learned from a pre-pass over prefixed projects) or by the embedded projectName/clientName. Time-off requests are listed with a POST search body because the Clockify list endpoint is POST-only.

Paginated reads detect an endpoint that ignores pagination: a full page that repeats with no new object IDs marks the collection failed instead of spinning to the hard page cap.

After the sweep it performs a paginated post-delete rescan of every prefixed-object collection and reports that leftover count. User invites are outside this prefixed-delete sweep. A machine-readable JSON summary is printed as the final stdout line.

Set CLOCKIFY_LIVE_CLEAN_DRY_RUN=1 to list what would be deleted without mutating the workspace; a dry run still exits non-zero when any collection list fails, so the preview is never silently incomplete.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL