Documentation
¶
Index ¶
- func RuleCapabilities() *clients.RuleCapabilities
- type Client
- func (c *Client) EnsureAssetSupport(_ context.Context, _ *clients.InstallScope) error
- func (c *Client) GetAssetPath(_ context.Context, name string, assetType asset.Type, ...) (string, error)
- func (c *Client) GetBootstrapOptions(_ context.Context) []bootstrap.Option
- func (c *Client) GetBootstrapPath() string
- func (c *Client) GetVersion() string
- func (c *Client) InstallAssets(ctx context.Context, req clients.InstallRequest) (clients.InstallResponse, error)
- func (c *Client) InstallBootstrap(_ context.Context, opts []bootstrap.Option) error
- func (c *Client) IsInstalled() bool
- func (c *Client) ListAssets(ctx context.Context, scope *clients.InstallScope) ([]clients.InstalledSkill, error)
- func (c *Client) ReadSkill(ctx context.Context, name string, scope *clients.InstallScope) (*clients.SkillContent, error)
- func (c *Client) RuleCapabilities() *clients.RuleCapabilities
- func (c *Client) ScanInstalledAssets(_ context.Context, _ *clients.InstallScope) ([]clients.InstalledAsset, error)
- func (c *Client) ShouldInstall(_ context.Context) (bool, error)
- func (c *Client) UninstallAssets(ctx context.Context, req clients.UninstallRequest) (clients.UninstallResponse, error)
- func (c *Client) UninstallBootstrap(_ context.Context, opts []bootstrap.Option) error
- func (c *Client) VerifyAssets(_ context.Context, assets []*lockfile.Asset, scope *clients.InstallScope) []clients.VerifyResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RuleCapabilities ¶
func RuleCapabilities() *clients.RuleCapabilities
RuleCapabilities returns the rule capabilities for OpenCode. OpenCode reads project rules from `AGENTS.md` and any additional files listed in the `instructions` array of opencode.json. (OpenCode also reads `CLAUDE.md` for backwards-compat, but that file is claimed by the Claude Code rule caps to avoid duplicate detection.) sx installs rules into a `<config>/rules/` directory and registers each rule path under `instructions`.
Types ¶
type Client ¶
type Client struct {
clients.BaseClient
}
Client implements clients.Client for OpenCode (https://opencode.ai).
func (*Client) EnsureAssetSupport ¶
EnsureAssetSupport is a no-op for OpenCode (skills are auto-discovered).
func (*Client) GetAssetPath ¶
func (c *Client) GetAssetPath(_ context.Context, name string, assetType asset.Type, scope *clients.InstallScope) (string, error)
GetAssetPath returns the filesystem path of an installed asset.
func (*Client) GetBootstrapOptions ¶
GetBootstrapOptions returns optional bootstrap items. OpenCode has no documented session-start hook today, so we only expose the MCP server registration.
func (*Client) GetBootstrapPath ¶
GetBootstrapPath returns the global opencode.json path for display.
func (*Client) GetVersion ¶
GetVersion returns the opencode CLI version, or empty if unavailable.
func (*Client) InstallAssets ¶
func (c *Client) InstallAssets(ctx context.Context, req clients.InstallRequest) (clients.InstallResponse, error)
InstallAssets installs assets into OpenCode using per-type handlers.
func (*Client) InstallBootstrap ¶
InstallBootstrap installs MCP servers declared in the supplied options.
func (*Client) IsInstalled ¶
IsInstalled checks for ~/.config/opencode/ or the opencode CLI. The config-dir check is preferred because `opencode` is a generic binary name; the config dir is a stronger signal of an actual install.
func (*Client) ListAssets ¶
func (c *Client) ListAssets(ctx context.Context, scope *clients.InstallScope) ([]clients.InstalledSkill, error)
ListAssets returns installed skills for the given scope.
func (*Client) ReadSkill ¶
func (c *Client) ReadSkill(ctx context.Context, name string, scope *clients.InstallScope) (*clients.SkillContent, error)
ReadSkill reads the prompt content of an installed skill.
func (*Client) RuleCapabilities ¶
func (c *Client) RuleCapabilities() *clients.RuleCapabilities
RuleCapabilities exposes OpenCode's rule storage convention so sx can detect, parse, and generate rule files alongside the rest of its per-client rule pipeline.
func (*Client) ScanInstalledAssets ¶
func (c *Client) ScanInstalledAssets(_ context.Context, _ *clients.InstallScope) ([]clients.InstalledAsset, error)
ScanInstalledAssets is not yet implemented for OpenCode.
func (*Client) ShouldInstall ¶
ShouldInstall always returns true (OpenCode has no hook-mode dedup needed yet).
func (*Client) UninstallAssets ¶
func (c *Client) UninstallAssets(ctx context.Context, req clients.UninstallRequest) (clients.UninstallResponse, error)
UninstallAssets removes assets from OpenCode.
func (*Client) UninstallBootstrap ¶
UninstallBootstrap removes any MCP servers installed by InstallBootstrap.
func (*Client) VerifyAssets ¶
func (c *Client) VerifyAssets(_ context.Context, assets []*lockfile.Asset, scope *clients.InstallScope) []clients.VerifyResult
VerifyAssets checks each asset's on-disk presence.