Documentation
¶
Overview ¶
Package localagentcmd holds the local agent client commands extracted from cmdcore (ARCH-1): `jentic setup` (register + skill install + MCP entry) and `jentic skill` (the agent-runtime skill engine shared with jenticctl's wizard/update/uninstall).
localagentcmd depends on cmdcore (the allowed arrow: a command-tree package uses the shared base); cmdcore never depends on it.
Index ¶
- func NewSetupAliasCmd(app *cmdcore.App) *cobra.Command
- func NewSetupCmd(app *cmdcore.App) *cobra.Command
- func NewSkillCmd(app *cmdcore.App) *cobra.Command
- type Cmd
- func (a *Cmd) InstalledSkills() ([]skillgen.InstalledSkill, error)
- func (a *Cmd) RemoveSkillCleanupTargets(targets []SkillCleanupTarget, dryRun bool) ([]SkillCleanupOutcome, error)
- func (a *Cmd) SetupForWizard(ctx context.Context, installURL string, timeout time.Duration, ...) error
- func (a *Cmd) SkillCleanupTargets() ([]SkillCleanupTarget, error)
- func (a *Cmd) SkillUpdate(cmd *cobra.Command, opts *skillOptions) error
- func (a *Cmd) SkillUpdateDefault(cmd *cobra.Command) error
- type SkillCleanupOutcome
- type SkillCleanupTarget
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewSetupAliasCmd ¶
NewSetupAliasCmd builds a hidden `bootstrap` command that is a pure compatibility alias for `setup` (the command's pre-rename name). It is a full second instance rather than a cobra alias so no help output, docs, or generated reference ever mentions the old name — it only works when typed.
func NewSetupCmd ¶
NewSetupCmd builds the `setup` command that runs first-time agent setup (register + skill install) in one step. Shared by both trees via cmdcore.
Types ¶
type Cmd ¶
Cmd is the local-agent command receiver. It embeds *cmdcore.App so every method below keeps calling the shared helpers (Out/Err/Paths, WantsInteractive, …). The two binary trees construct it from the shared *cmdcore.App (NewSetupCmd/NewSkillCmd take *cmdcore.App and wrap it).
This mirrors the ctl tree's `type app struct { *cmdcore.App }`.
func New ¶
New wraps a shared *cmdcore.App in the local-agent command receiver. External trees (e.g. jenticctl's wizard/update) that need to call an exported local-agent method — SetupForWizard, SkillUpdateDefault — construct a Cmd through this rather than reaching for an internal field.
func (*Cmd) InstalledSkills ¶ added in v0.44.0
func (a *Cmd) InstalledSkills() ([]skillgen.InstalledSkill, error)
InstalledSkills reports every installed skill across all supported operators and scopes (deduplicated by artifact), with its recorded and bundled versions. It is a read-only probe for status surfaces such as `jentic doctor`; it never writes.
func (*Cmd) RemoveSkillCleanupTargets ¶ added in v0.44.0
func (a *Cmd) RemoveSkillCleanupTargets(targets []SkillCleanupTarget, dryRun bool) ([]SkillCleanupOutcome, error)
RemoveSkillCleanupTargets removes each removable target once through skillgen.Remove — the engine `jentic skill remove` uses — with the user-edit guard on. Edited and unattributed targets are kept, never forced. The returned error joins every per-target failure, so a partial removal is visible to the caller; outcomes are returned either way.
func (*Cmd) SetupForWizard ¶
func (a *Cmd) SetupForWizard(ctx context.Context, installURL string, timeout time.Duration, operators []string, yes bool) error
SetupForWizard runs the shared setup flow (register + approval wait + skill) from the ctl `wizard` command. It keeps setupOptions private to cmdcore while letting the ctl tree drive it with just the values the wizard owns: the install URL the wizard just brought up, plus the operator picks. operators empty + yes=false runs setup's interactive operator picker; a named operator (yes=true) drives it non-interactively; empty operators + yes=true auto-detects. interactive stays false so setup does not re-prompt for the URL the wizard already collected.
func (*Cmd) SkillCleanupTargets ¶ added in v0.44.0
func (a *Cmd) SkillCleanupTargets() ([]SkillCleanupTarget, error)
SkillCleanupTargets probes every supported operator, bundled skill, and scope once and returns the installed artifacts, deduplicated by path. It is read-only. Project scope resolves against the current working directory.
func (*Cmd) SkillUpdate ¶
SkillUpdate re-renders every installed (skill, operator, scope) with the currently resolved base URL and rewrites it when the recorded content hash differs. It only touches installs that already exist — it never creates a new one — so it is a refresh, not an install (#407).
type SkillCleanupOutcome ¶ added in v0.44.0
type SkillCleanupOutcome struct {
Target SkillCleanupTarget
Removed bool // the artifact was stripped (or would be, on a dry run)
Kept bool // left in place: edited, unattributed, or edited since the probe
Err error // the removal failed; the artifact is still on disk
}
SkillCleanupOutcome is the result of removing one target.
type SkillCleanupTarget ¶ added in v0.44.0
type SkillCleanupTarget struct {
Operators []string // every operator that loads this artifact, registry order
Skill string
Scope skillgen.Scope
Path string
Display string // Path shortened to ~-relative form against the probed home
// UserEdits reports a Jentic write whose content no longer matches its
// recorded hash; it is kept unless removed with --force.
UserEdits bool
// Unattributed reports a SKILL.md at a Jentic skill path with no
// provenance (no sidecar, no managed block): Jentic cannot prove it wrote
// it, so it is never offered for removal.
Unattributed bool
}
SkillCleanupTarget is one installed skill artifact found on disk, as `jenticctl uninstall` lists and removes it. Operators sharing a target (codex and generic both splice into the project AGENTS.md) yield one target naming all of them.
func (SkillCleanupTarget) Label ¶ added in v0.44.0
func (t SkillCleanupTarget) Label() string
Label is the operator/skill tag for output, e.g. "codex+generic/jentic".
func (SkillCleanupTarget) Removable ¶ added in v0.44.0
func (t SkillCleanupTarget) Removable() bool
Removable reports whether uninstall may remove the target without --force.