Documentation
¶
Index ¶
- func CheckCLIVersion(m *ExtensionManifest) error
- func ValidateManifest(m *ExtensionManifest, repoName string) error
- type AvailableExtension
- type ExtType
- type ExtensionAuth
- type ExtensionManifest
- type ExtensionMeta
- type InstalledExtension
- type Manager
- func (m *Manager) BinaryPath(name string) string
- func (m *Manager) Browse(_ string) ([]AvailableExtension, error)
- func (m *Manager) EnsureDir() error
- func (m *Manager) Exec(name string, args []string, env map[string]string) error
- func (m *Manager) ExtensionDir() string
- func (m *Manager) Get(name string) (*InstalledExtension, error)
- func (m *Manager) Install(repo string) (*InstalledExtension, error)
- func (m *Manager) InstallLocal(path string) (*InstalledExtension, error)
- func (m *Manager) List() ([]InstalledExtension, error)
- func (m *Manager) Remove(name string) error
- func (m *Manager) Upgrade(name string) error
- func (m *Manager) UpgradeAll() ([]UpgradeResult, error)
- type UpgradeResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckCLIVersion ¶
func CheckCLIVersion(m *ExtensionManifest) error
CheckCLIVersion checks if the current CLI version meets the extension's minimum version requirement.
func ValidateManifest ¶
func ValidateManifest(m *ExtensionManifest, repoName string) error
ValidateManifest checks that a manifest has required fields and the name matches the repo suffix.
Types ¶
type AvailableExtension ¶
type AvailableExtension struct {
Name string `json:"name"`
Description string `json:"description"`
Repo string `json:"repo"`
LatestTag string `json:"latest_tag"`
Installed bool `json:"installed"`
}
AvailableExtension represents an extension available for installation from GitHub.
type ExtType ¶
type ExtType string
ExtType represents the type of an extension.
const ( ExtTypeBinary ExtType = "binary" // precompiled platform binaries via GitHub Releases ExtTypeScript ExtType = "script" // executable script at repo root (bash, etc.) ExtTypePython ExtType = "python" // python project managed by uv )
Extension types determine how an extension is installed and executed.
type ExtensionAuth ¶
type ExtensionAuth struct {
RequiresToken bool `toml:"requires_token"`
RequiresOrg bool `toml:"requires_org"`
}
ExtensionAuth holds the auth requirements from [extension.auth] in nuon-ext.toml.
type ExtensionManifest ¶
type ExtensionManifest struct {
Extension ExtensionMeta `toml:"extension"`
}
ExtensionManifest represents the parsed nuon-ext.toml file from an extension repo.
func FetchManifest ¶
func FetchManifest(repo, ref string) (*ExtensionManifest, error)
FetchManifest fetches and parses nuon-ext.toml from a GitHub repo at a given ref. It uses the GitHub contents API to get the file content.
func ParseManifest ¶
func ParseManifest(data []byte) (*ExtensionManifest, error)
ParseManifest parses a nuon-ext.toml file from raw bytes.
type ExtensionMeta ¶
type ExtensionMeta struct {
Name string `toml:"name"`
Description string `toml:"description"`
MinCLIVersion string `toml:"min_cli_version"`
Auth ExtensionAuth `toml:"auth"`
}
ExtensionMeta holds the metadata from the [extension] section of nuon-ext.toml.
type InstalledExtension ¶
type InstalledExtension struct {
Name string `json:"name"`
Description string `json:"description"`
Repo string `json:"repo"`
Version string `json:"version"`
Tag string `json:"tag"`
Ref string `json:"ref,omitempty"`
InstalledAt string `json:"installed_at"`
UpdatedAt string `json:"updated_at"`
Binary string `json:"binary"`
Type ExtType `json:"type"`
Entrypoint string `json:"entrypoint,omitempty"`
Platform string `json:"platform"`
MinCLIVersion string `json:"min_cli_version"`
RequiresToken bool `json:"requires_token"`
RequiresOrg bool `json:"requires_org"`
}
InstalledExtension represents a locally installed extension. This is the schema for manifest.json stored in each extension's directory.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager handles extension lifecycle operations.
func (*Manager) BinaryPath ¶
BinaryPath returns the full path to an extension's binary.
func (*Manager) Browse ¶
func (m *Manager) Browse(_ string) ([]AvailableExtension, error)
Browse lists official extensions from the nuonco GitHub org. Only repositories with the "nuon-cli-extension" topic are shown.
func (*Manager) Exec ¶
Exec runs an installed extension with the given arguments and environment variables.
func (*Manager) ExtensionDir ¶
ExtensionDir returns the base extensions directory.
func (*Manager) Get ¶
func (m *Manager) Get(name string) (*InstalledExtension, error)
Get returns a specific installed extension by name.
func (*Manager) Install ¶
func (m *Manager) Install(repo string) (*InstalledExtension, error)
Install installs an extension from a GitHub repository or a local directory.
func (*Manager) InstallLocal ¶
func (m *Manager) InstallLocal(path string) (*InstalledExtension, error)
InstallLocal installs an extension from a local directory. The directory must contain a nuon-ext.toml and a pre-built binary named nuon-ext-<name>. The binary is symlinked (not copied) so rebuilds take effect immediately.
func (*Manager) List ¶
func (m *Manager) List() ([]InstalledExtension, error)
List returns all installed extensions by reading manifest.json from each subdirectory.
func (*Manager) Remove ¶
Remove uninstalls an extension by removing its directory. If the extension directory is a symlink (local install), only the symlink is removed.
func (*Manager) UpgradeAll ¶
func (m *Manager) UpgradeAll() ([]UpgradeResult, error)
UpgradeAll upgrades all installed extensions and returns results.