shelf Docs
On this page
shelf update [<skill>...] [options]
ArgumentDescription
<skill>... (optional)Skill names. Default: all
OptionTypeDefaultDescription
--forcebooleanDiscard local edits to the project copies

Also takes the global options --json and --actor (CLI overview).

What it does

For each loan:

ContentResult
currentNothing to do (already at).
behind, missingCopies rewritten from the latest revision (updated to).
modified, diverged, namedRefused with LOCAL_CHANGES, unless --force.
modified, diverged, not namedSkipped (skipped (local edits) at), unless --force.

With --force, local edits are discarded and the copies get the latest revision.

To update every project at once from the library side, use shelf propagate. Loans borrowed with --follow are updated by shelf sync.

Examples

terminal
shelf update api-design
api-design: updated to e09cc9a0ed

shelf update
api-design: already at e09cc9a0ed
pdf-tools: updated to ddad27dd34
terminal
shelf update pdf-tools
error: The project copy of "pdf-tools" has local edits
hint: Keep them with `shelf promote pdf-tools`, or discard them with --force

With no loans: Nothing borrowed.

JSON output

json
{"schemaVersion":1,"ok":true,"data":{"skills":[{"skill":"react-best-practices","status":"updated","revision":"sha256:3a1a31ace69218263c958abae2eb5b6e68958d495a00a089b5f9efb743a7b182"},{"skill":"release-notes","status":"current","revision":"sha256:3547e8b373aeda43d2e36619c153c81d423115a179bd59ad1a5a5a1837c34fbd"}]}}

status is updated, current or skipped-local-changes. revision is the revision the loan holds afterwards.

Errors

CodeWhen
NOT_INITIALIZEDNot inside a shelf project.
NOT_BORROWEDA named skill isn't borrowed.
LOCAL_CHANGESA named skill's copy has local edits and --force wasn't given.