localagentcmd

package
v0.32.1 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2026 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Overview

Package localagentcmd holds the local-agent runtime feature extracted from cmdcore (ARCH-1): everything that stands up and drives a coding agent as an isolated Unix user — `jentic setup`, `jentic run`, agent-account creation/seeding, workspace grants, and exporting the active context's credentials into the agent's home.

It is the ONLY package that performs privileged host mutation (useradd, ACL grants, sudo-launched processes), so isolating it keeps that blast radius in one reviewable place and leaves cmdcore as the shared command-infrastructure base both binaries embed. localagentcmd depends on cmdcore (the allowed arrow: a command-tree package uses the shared base); cmdcore never depends on it.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRunCmd

func NewRunCmd(app *cmdcore.App) *cobra.Command

NewRunCmd builds the `run` command that launches a coding agent inside the per-session sandbox. Shared by both trees via cmdcore.

func NewSetupAliasCmd

func NewSetupAliasCmd(app *cmdcore.App) *cobra.Command

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

func NewSetupCmd(app *cmdcore.App) *cobra.Command

NewSetupCmd builds the `setup` command that runs first-time agent setup (register + skill install) in one step. Shared by both trees via cmdcore.

func NewSkillCmd

func NewSkillCmd(app *cmdcore.App) *cobra.Command

NewSkillCmd builds the `skill` command group (install/update/remove the agent-facing skill files). Shared by both trees via cmdcore.

Types

type Cmd

type Cmd struct {
	*cmdcore.App
}

Cmd is the local-agent command receiver. It embeds *cmdcore.App so every method below keeps calling the shared helpers (Out/Err/Paths, WantsInteractive, …) exactly as it did when these files lived in cmdcore — the move is pure relocation, not a behavior change. The two binary trees construct it from the shared *cmdcore.App (NewSetupCmd/NewRunCmd take *cmdcore.App and wrap it).

This mirrors the ctl tree's `type app struct { *cmdcore.App }`.

func New

func New(app *cmdcore.App) *Cmd

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) PrintRevokeHint

func (a *Cmd) PrintRevokeHint()

PrintRevokeHint prints a small footer, under any directory-access tree, telling the operator how to take a grant away again. It mirrors the "Granted (…)" line the grant flow prints, so revocation is always one command away from wherever access is shown. Grants are account-scoped (one set for every agent binary), so the hint is generic over which `<agent>` binary the operator names.

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) SkillUpdate

func (a *Cmd) SkillUpdate(_ *cobra.Command, opts *skillOptions) error

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).

func (*Cmd) SkillUpdateDefault

func (a *Cmd) SkillUpdateDefault(cmd *cobra.Command) error

SkillUpdateDefault runs SkillUpdate with the default (empty) options. The ctl tree calls it to refresh installed skills after a CLI upgrade without needing to construct the unexported skillOptions.

Jump to

Keyboard shortcuts

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