{% extends "docs/base.html" %} {% block docs_content %}
Use lease locks from scripts and agents. Omit scope flags for your user scope; pass --team for a team or --repo for a repository.
pearing-cli acquire-lock deploy --request-uuid "$REQUEST_UUID" --lease-seconds 60 --wait-seconds 30 --repo teams/platform/app
pearing-cli get-lock-ticket deploy "$TICKET_UUID" --repo teams/platform/app
pearing-cli heartbeat-lock-ticket deploy "$TICKET_UUID" --lease-seconds 60 --repo teams/platform/app
pearing-cli release-lock-ticket deploy "$TICKET_UUID" --repo teams/platform/app
acquire-lock generates a request UUID when omitted, but retries should preserve an explicit UUID. Poll queued tickets, heartbeat held tickets at one third of their lease, and always release. The JSON response carries status, lease expiry, exact queue position, and fence token.
Persist and compare the fence token atomically in the protected external system. Pearing coordinates work but cannot stop stale external work after a lease expires.
Team locks require active membership; repo locks require maintainer access. Release remains available to a ticket owner after access is revoked.
{% endblock %}