shelf Docs
On this page
shelf diff <name> [options]
ArgumentDescription
<name>Skill name
OptionTypeDefaultDescription
--from <from>stringborrowed | library | project | <revision>
--to <to>stringborrowed | library | project | <revision>

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

Sides

--from and --to each take one of:

SideMeaning
borrowedThe revision this project borrowed. Needs a project that borrows the skill.
libraryThe library's latest revision.
latestSame as library.
projectThis project's copy on disk: the edited copy if there is one, else the first copy present. Needs a project that borrows the skill.
a revisionA full hash or a unique prefix of at least 6 hex characters (see shelf log).

Defaults:

Where--from--to
In a project that borrows the skill, copy editedborrowedproject (the local edits)
In a project that borrows the skill, copy uneditedborrowedlibrary (what updating would change)
Anywhere elsethe latest revision's parentlibrary (the last library change)

Files are compared byte for byte. Binary files show Binary file <path> differs.

Examples

Local edits in a project:

terminal
shelf diff pdf-tools
--- a/SKILL.md
+++ b/SKILL.md
@@ -5,4 +5,6 @@
 
 # pdf-tools
 
 Describe when and how an agent should apply this skill.
+
+- Prefer pdftotext for scanned files

What the library changed since this project borrowed:

terminal
shelf diff pdf-tools --from borrowed --to library
--- a/SKILL.md
+++ b/SKILL.md
@@ -5,6 +5,4 @@
 
 # pdf-tools
 
 Describe when and how an agent should apply this skill.
-
-- Prefer pdftotext for scanned files

Between two revisions, from anywhere: shelf diff pdf-tools --from d4deea --to latest. When there is nothing to show: No differences between borrowed and library.

JSON output

json
{"schemaVersion":1,"ok":true,"data":{"skill":"pdf-tools","from":{"side":"borrowed","revision":"sha256:ddad27dd34082032a0f9564e301c57903aeb482c1f97b56b07844301a222bc36"},"to":{"side":"project","revision":"sha256:d4deea4b55d45984ad84b4ea9db4211166df58840a9a66b02530604b34a4f20c"},"files":[{"path":"SKILL.md","status":"modified","patch":"--- a/SKILL.md\n+++ b/SKILL.md\n@@ -5,4 +5,6 @@\n \n # pdf-tools\n \n Describe when and how an agent should apply this skill.\n+\n+- Prefer pdftotext for scanned files\n"}]}}
FieldMeaning
from, toside as given or defaulted, and the revision hash it resolved to (for project, the hash of the copy on disk).
files[]Changed files only: path, status (added, removed, modified) and patch (a unified diff). Empty when identical.

Errors

CodeWhen
SKILL_NOT_FOUNDNo skill by that name in the library.
NOT_BORROWEDborrowed or project outside a project that borrows the skill.
INVALID_ARGUMENTA revision is too short, ambiguous or unknown.
CONFLICTproject, but every copy is missing (run shelf sync).