Documentation
¶
Overview ¶
Package cobracmd exposes optional Cobra wiring for skillsync. It owns command input, target selection, aggregation, and host error mapping; the core package remains command-framework free.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var DefaultHarnesses = []Harness{ {ID: "claude", Aliases: []string{"claude-code"}, ConfigRel: ".claude", ConfigEnv: "CLAUDE_CONFIG_DIR"}, {ID: "cursor", ConfigRel: ".cursor"}, {ID: "codex", ConfigRel: ".codex", ConfigEnv: "CODEX_HOME"}, }
DefaultHarnesses preserves WB's Claude, Cursor, and Codex conventions.
Functions ¶
Types ¶
type AggregateError ¶
type AggregateError struct{ Results []TargetResult }
AggregateError exposes every target error through errors.Is/As.
func (*AggregateError) Error ¶
func (e *AggregateError) Error() string
func (*AggregateError) Unwrap ¶
func (e *AggregateError) Unwrap() []error
type CommandOptions ¶
type CommandOptions struct {
Use, Short string
Harnesses []Harness
Home func() (string, error)
Getenv func(string) string
Errors ErrorMapper
Resolver skillsync.Resolver
Renderer Renderer
// Legacy enables a host's one-time verified marker import for every
// selected target (for example WB's .wb-skills-sync.json marker).
Legacy skillsync.LegacyImport
LockTimeout time.Duration
}
type ConflictError ¶
ConflictError is returned even with no ErrorMapper, so conflicts do not accidentally become a successful command.
func (*ConflictError) Error ¶
func (e *ConflictError) Error() string
type ErrorMapper ¶
ErrorMapper lets a host retain its own exit-code and error convention.
type Renderer ¶
type Renderer func(io.Writer, []TargetResult, string) error
Renderer receives all completed target outcomes after attempts finish.
type TargetResult ¶
TargetResult retains both an attempted target's complete core report and its error. A host renderer can preserve a legacy JSON contract without reimplementing selection or synchronization.
type UsageError ¶
type UsageError struct{ Err error }
UsageError identifies invalid Cobra input before source preparation or any target write. It preserves its cause for hosts using errors.Is/As.
func (*UsageError) Error ¶
func (e *UsageError) Error() string
func (*UsageError) Unwrap ¶
func (e *UsageError) Unwrap() error