listFacets(projectRoot)
Lists all facets declared by the project. Read-only — no network calls, no command execution.
- Scans
.opencode/facets/*/facet.yamlfor local facets - Iterates
facets.yamlremote entries and loads from cache - Picks up any
facets.yamllocal entries not already found
Promise<ListResult>
cacheFacet(url, projectRoot)
Fetches a remote facet manifest and caches it locally. Also downloads all referenced resource files.
| Parameter | Type | Description |
|---|---|---|
url | string | URL to the remote facet.yaml |
projectRoot | string | Project root directory |
Promise<CacheResult>
- Writes files to
~/.cache/facets/<name>/ - Updates
facets.yaml(adds remote entry) - Updates
facets.lock(records version and integrity hash)
updateFacet(name, projectRoot)
Re-fetches a cached remote facet and reports whether it was updated.
Promise<UpdateResult>
updateAllFacets(projectRoot)
Updates all remote facets declared in facets.yaml. Calls updateFacet sequentially for each.
Promise<UpdateResult[]>
clearCache()
Deletes the entire global cache directory (~/.cache/facets/). Does not modify facets.yaml, facets.lock, or installed resources.