Skip to content

restore ​

Install every skill recorded in ./skills-lock.json, at the locked version or ref. Use it after cloning a repo, or in CI, the way you'd use dotnet restore or npm ci.

Synopsis ​

agentskills-cli restore [-a agent...] [-y] [--copy] [--force] [--frozen]
                        [--nuget-source <URL>] [--npm-registry <URL>]

Flags ​

FlagMeaning
-a, --agent <NAME>Install for these agents. Default: the agents detected on this machine (prompted when interactive, all of them with -y). Falls back to universal when none are detected.
-y, --yesDon't prompt.
--copyCopy files into each agent directory instead of symlinking.
--forceReinstall skills that are already present. By default they're left alone.
--frozenFail instead of installing when a source's content no longer matches the computedHash in the lock. Use this in CI.
--nuget-source <URL>Restore NuGet packages from this feed only.
--npm-registry <URL>Restore npm packages from this registry.

What it installs ​

Lock sourceTypeRestored from
nuget, npmThe exact locked version (Package@1.2.0) from your configured feeds and registries, trying the recorded feed first.
github, gitlabThe recorded repo at the recorded ref. GitLab entries use the recorded clone URL, so self-hosted GitLab works; entries written before 1.1.0 have none and resolve against gitlab.com.
git, well-knownThe recorded URL (and ref).
localThe recorded path, so it only works when that path exists on this machine.

Packages added from a local .nupkg or .tgz file are restored from that file when it still exists at the recorded path, otherwise from your feeds by id and version. For restores on other machines, publish them to a feed; a folder feed inside the repo works (agentskills-cli feed add ./feed --name local).

Skills installed under another name (add --as) are restored under that name.

Content drift ​

restore compares each fetched skill with the computedHash in the lock:

  • Default: installs it anyway, prints a warning, and updates the hash in the lock.
  • --frozen: refuses to install it and exits 1.

Pinned packages never drift. Git sources drift when the recorded ref is a branch that moved; pin a tag or commit if you need byte-for-byte restores.

Examples ​

bash
# Fresh clone
git clone https://github.com/contoso/app && cd app
agentskills-cli restore -y

# CI: exact restore for Claude Code, fail on drift
agentskills-cli restore -a claude-code -y --frozen

# Rebuild everything from scratch
agentskills-cli restore --force -y

Exit code is 1 when any skill failed to restore, otherwise 0.

Released under the MIT License.