Pular para o conteúdo
EN · PT

anchors touch

Bump updated_at in the @anchors header of the files that changed.

Writes the day's date into the `updated_at` of the @anchors header of every
file that changed — the date the `updated-at-current` gate charges.
anchors touch files changed in the worktree vs HEAD (new files too)
anchors touch a.ts docs/ only those, among the changed files
anchors touch --staged files in the index vs HEAD, re-staged after (for a pre-commit)
anchors touch --dry-run says what it would bump
anchors touch --exclude 'docs/**' --date 2026-09-25
It does not lie: a file whose only difference from HEAD is its own updated_at, or that
did not change, is not bumped. Only files with an @anchors header carrying updated_at are
touched, in any comment dialect. The project's `touch.exclude` globs (anchors.yaml) add to
--exclude. With --staged, a file that also has changes outside the index is skipped:
re-staging it would put those changes in the commit.
The installed pre-commit already runs it on the staged files before the gates
(`touch.pre_commit` in anchors.yaml, on by default; `false` turns it off).
After a `stamp --refresh`, order does not matter: a `@contract` stamp never covers the header.
Terminal window
anchors touch [files or folders...] [flags]
Flag Padrão O que faz
--changed true the files changed in the worktree vs HEAD (the default)
--date the date to write (YYYY-MM-DD; default: today)
--dry-run say what would be bumped, without writing
--exclude glob of files never to bump (repeatable; adds to touch.exclude)
--root . project root
--staged the files in the index (vs HEAD), re-staged after rewriting

Comandos da mesma família — o que distingue cada um:

Comando O que faz
anchors init Configure the project (anchors.yaml) through questions and answers
anchors new Emit the skeleton of an artifact (spec, feature, test, plan…) per the ruler
anchors code Generate a unique identity code for a new unit
anchors guide Print the Anchors guides for AI agents
anchors docs Compile the documentation from the templates in doct/
anchors install-hooks Install the git pre-commit that runs the gates over staged files
anchors migrate Bring the Anchors files up to the current format
anchors settings This agent’s LOCAL configuration — what is its own, not the project’s
anchors touch Bump updated_at in the @anchors header of the files that changed