cli

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 30, 2026 License: MIT Imports: 36 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ExitSuccess    = 0
	ExitNotable    = 1
	ExitUsageError = 2
	ExitOpError    = 3
	ExitPartial    = 4
	ExitNoPending  = 5
)

Exit code conventions (see docs/CLI_REFERENCE.md).

Variables

View Source
var Version = "0.1.0"

Version is overridden at release build time via -ldflags "-X github.com/Flow-Forge-Lab-Team/skills-manager/internal/cli.Version=<tag>".

Functions

func Run

func Run(args []string, stdout io.Writer, stderr io.Writer) int

Types

type GitHubFetcher

type GitHubFetcher interface {
	FetchFile(owner, repo, ref, path string) ([]byte, error)
	FetchTree(owner, repo, ref, subPath string) ([]TreeEntry, error)
}

GitHubFetcher is an interface for fetching files and trees from GitHub. It can be overridden in tests.

type GitHubPoller

type GitHubPoller interface {
	// Poll fetches the current commit SHA and ETag for the given GitHub repo and ref.
	// If etag is non-empty, sends If-None-Match header and returns notModified=true on 304.
	// On success (200), returns (commit, etag, false, nil).
	// On 304 (Not Modified), returns (cachedCommit, cachedETag, true, nil).
	// If gh CLI is not found or auth fails, returns ("", "", false, error).
	Poll(owner, repo, ref, etag string) (commit, newETag string, notModified bool, err error)
}

GitHubPoller defines the interface for polling GitHub for commit info. This allows tests to substitute a fake implementation.

type ScheduleBackend

type ScheduleBackend string

ScheduleBackend identifies which OS scheduler was installed.

const (
	BackendManual  ScheduleBackend = "manual"
	BackendLaunchd ScheduleBackend = "launchd"
	BackendCron    ScheduleBackend = "cron"
)

type ScheduleConfig

type ScheduleConfig struct {
	Provider   ScheduleProvider
	Interval   string // "daily" for v0.2
	BinaryPath string // absolute path to the skills-manager binary
	LogDir     string // ~/.skills-manager/logs
}

ScheduleConfig holds the resolved configuration for a scheduled check.

type ScheduleProvider

type ScheduleProvider string

ScheduleProvider identifies the scheduling mechanism.

const (
	ProviderLocal ScheduleProvider = "local"
)

type ScheduleState

type ScheduleState struct {
	Version          int
	Provider         ScheduleProvider
	Backend          ScheduleBackend
	Interval         string
	InstalledAt      string
	BinaryPath       string
	IncludeSummarize bool
}

ScheduleState is persisted under the manager home after setup-schedule.

type TreeEntry

type TreeEntry struct {
	Path string // Path relative to repo root
	SHA  string // Git blob/tree SHA
	Type string // "blob" or "tree"
}

TreeEntry represents a single entry in a GitHub tree.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL