installFacet(name, projectRoot, options?)
Installs a facet by resolving it (local first, then cache), running prerequisite checks, and copying resources to .opencode/.
| Parameter | Type | Description |
|---|---|---|
name | string | Facet name |
projectRoot | string | Project root directory |
options | InstallOptions | Optional configuration |
InstallOptions
| Option | Type | Default | Description |
|---|---|---|---|
skipPrereqApproval | boolean | false | Skip interactive prereq approval |
forcePrereqCheck | boolean | false | Re-run prereq checks even if previously confirmed |
onPrereqApproval | (commands: string[]) => Promise<boolean> | — | Callback to ask user for approval. Must return true to proceed. |
Return type
ReturnsPromise<InstallResult>, a discriminated union:
Resource processing
| Resource | Processing |
|---|---|
| Skills | Copied verbatim from source to .opencode/skills/<name>/SKILL.md |
| Agents | Prompt body + assembled YAML frontmatter (description, tools) written to .opencode/agents/<name>.md |
| Commands | Prompt body + assembled YAML frontmatter (description) written to .opencode/commands/<name>.md |
| Tools | Copied verbatim from source to .opencode/tools/<name>.ts |
uninstallFacet(name, projectRoot)
Removes all installed resources for a facet and cleans up facets.yaml.
Promise<UninstallResult>
- Deletes resource files from
.opencode/ - Removes skill directories recursively
- Removes the facet entry from
facets.yaml(bothremoteandlocal) - Does not delete the cached copy from
~/.cache/facets/