Documentation
¶
Overview ¶
hook_guard.go protects against cross-agent hook forwarding. Cursor IDE invokes any hook configured under .claude/settings.json or .cursor/hooks.json for the active session — when only one of those files is installed, the other agent's hook command receives the event. shouldSkipForwardedHook detects this by inspecting the transcript path: if it lives inside another registered agent's session directory, the firing agent is forwarded and must no-op so the session isn't claimed for the wrong agent (#1262).
hook_registry.go provides hook command registration for agents. The lifecycle dispatcher (DispatchLifecycleEvent) handles all lifecycle events. PostTodo is the only hook that's handled directly (not via lifecycle dispatcher).
hooks_claudecode_posttodo.go contains the PostTodo hook handler for Claude Code. This is a Claude-specific hook that creates incremental checkpoints during subagent execution. It's not part of the generic lifecycle dispatcher because it requires special handling: - Only fires for TodoWrite tool invocations - Creates incremental checkpoints (not full checkpoints) - Only activates when in subagent context (pre-task file exists)
lifecycle.go implements the generic lifecycle event dispatcher. It routes normalized events from any agent to the appropriate framework actions.
The dispatcher inverts the current flow from "agent handler calls framework functions" to "framework dispatcher calls agent methods." Agents are passive data providers; the dispatcher handles all orchestration: state transitions, strategy calls, file change detection, metadata generation.
Index ¶
- Constants
- func BranchExistsLocally(ctx context.Context, branchName string) (bool, error)
- func BranchExistsOnRemote(ctx context.Context, branchName string) (bool, error)
- func CapturePrePromptState(ctx context.Context, ag agent.Agent, sessionID, sessionRef string) error
- func CapturePreTaskState(ctx context.Context, toolUseID string) error
- func CheckoutBranch(ctx context.Context, ref string) error
- func CleanupPrePromptState(ctx context.Context, sessionID string) error
- func CleanupPreTaskState(ctx context.Context, toolUseID string) error
- func CountTodosFromToolInput(toolInput json.RawMessage) int
- func DependentsOf(name string) ([]string, error)
- func DispatchLifecycleEvent(ctx context.Context, ag agent.Agent, event *agent.Event) error
- func EnsurePluginBinDir() (string, error)
- func EnsurePluginPkgDir(name string) (string, error)
- func ExtractLastCompletedTodoFromToolInput(toolInput json.RawMessage) string
- func FetchAndCheckoutRemoteBranch(ctx context.Context, branchName string) error
- func FetchBlobsByHash(ctx context.Context, hashes []plumbing.Hash) error
- func FetchCheckpointRef(ctx context.Context, ref plumbing.ReferenceName) error
- func FetchMetadataBranch(ctx context.Context) error
- func FetchMetadataFromCheckpointRemote(ctx context.Context) error
- func FetchMetadataTreeOnly(ctx context.Context) error
- func FilterAndNormalizePaths(files []string, cwd string) []string
- func FindActivePreTaskFile(ctx context.Context) (taskToolUseID string, found bool)
- func GetAgentsWithHooksInstalled(ctx context.Context) []types.AgentName
- func GetCurrentBranch(ctx context.Context) (string, error)
- func GetCurrentHookAgent() (agent.Agent, error)
- func GetNextCheckpointSequence(ctx context.Context, sessionID, taskToolUseID string) int
- func GetStrategy(_ context.Context) *strategy.ManualCommitStrategy
- func HasUncommittedChanges(ctx context.Context) (bool, error)
- func InstalledAgentDisplayNames(ctx context.Context) []string
- func IsAccessibleMode() bool
- func IsEnabled(ctx context.Context) (bool, error)
- func IsOfficialPlugin(name string) bool
- func IsOnDefaultBranch(ctx context.Context) (bool, string, error)
- func JoinAgentNames(names []types.AgentName) string
- func ListCheckpointRefsOnRemote(ctx context.Context) ([]plumbing.ReferenceName, error)
- func LoadEntireSettings(ctx context.Context) (*settings.EntireSettings, error)
- func MaybeRunPlugin(ctx context.Context, rootCmd *cobra.Command, args []string) (handled bool, exitCode int, killedBy os.Signal)
- func NewAccessibleForm(groups ...*huh.Group) *huh.Form
- func NewAuthenticatedAPIClient(ctx context.Context, insecureHTTP bool) (*api.Client, error)
- func NewAuthenticatedEntireAPICellClient(ctx context.Context, insecureHTTP bool, fullName string) (*api.Client, error)
- func NewHelpCmd(rootCmd *cobra.Command) *cobra.Command
- func NewRootCmd() *cobra.Command
- func OutdatedHookAgentDisplayNames(ctx context.Context) []string
- func OutdatedHookAgents(ctx context.Context) []types.AgentName
- func ParseSubagentTypeAndDescription(toolInput json.RawMessage) (agentType, description string)
- func PluginBinDir() (string, error)
- func PluginDataDir(name string) (string, error)
- func PluginPkgDir(name string) (string, error)
- func PrependPluginBinDirToPATH(ctx context.Context) func()
- func RemoveInstalledPlugin(name string) error
- func RemoveManagedPlugin(name string) error
- func RemovePluginPkg(name string) error
- func RenderUserFacingError(err error) error
- func ResolveAgentTranscriptPath(transcriptDir, sessionID, agentID string) string
- func SaveEntireSettings(ctx context.Context, s *settings.EntireSettings) error
- func SaveEntireSettingsLocal(ctx context.Context, s *settings.EntireSettings) error
- func SavePluginManifest(m *PluginManifest) error
- func ShouldSkipOnDefaultBranch(ctx context.Context) (bool, string)
- func ValidateBranchName(ctx context.Context, branchName string) error
- type BootstrapOptions
- type DepAction
- type DepPlan
- type EnableOptions
- type EntireSettings
- type FileChanges
- type GitAuthor
- type InstallPluginOptions
- type InstalledPlugin
- type PluginDoctorIssue
- type PluginIndex
- type PluginIndexEntry
- type PluginManifest
- type PluginMetadata
- type PluginRequirement
- type PrePromptState
- type PreTaskState
- type RemoteInstallOptions
- type RemoteInstallResult
- type SilentError
- type SubagentCheckpointHookInput
- type TempFileDeleteError
- type UpgradeOutcome
Constants ¶
const ( EntireSettingsFile = settings.EntireSettingsFile EntireSettingsLocalFile = settings.EntireSettingsLocalFile )
Package-level aliases to avoid shadowing the settings package with local variables named "settings".
const ( EntireDir = paths.EntireDir EntireTmpDir = paths.EntireTmpDir EntireMetadataDir = paths.EntireMetadataDir )
Directory paths - re-exported from paths package for convenience
const DisabledMessage = "Entire is disabled. Run `entire enable` to re-enable."
DisabledMessage is the message shown when Entire is disabled
const ExitPluginSignalled = -1
ExitPluginSignalled reports that a plugin was terminated by a signal, or that a signal interrupted an on-demand install before the plugin ran. It is deliberately not a valid exit status — os.Exit(-1) truncates to 255 — so main.go re-raises the signal instead of exiting with it. -1 is already what exec.ExitError.ExitCode() reports for a signalled child.
MaybeRunPlugin's killedBy return says WHICH signal, when it is knowable. The two are separate because they have different sources: the exit code comes from the child's wait status, while the signal may have reached only the child (`kill -TERM` at the plugin, SIGPIPE from a closed pipe) or only this process (a Ctrl-C during the on-demand install, where there is no child yet).
Variables ¶
This section is empty.
Functions ¶
func BranchExistsLocally ¶
BranchExistsLocally checks if a local branch exists.
func BranchExistsOnRemote ¶
BranchExistsOnRemote checks if a branch exists on the origin remote. First checks local remote-tracking refs, then queries the actual remote via git ls-remote in case local refs are stale (e.g., after a fresh clone that didn't fetch all branches).
func CapturePrePromptState ¶
CapturePrePromptState captures current untracked files and transcript position before a prompt and saves them to a state file.
The agent parameter is used to determine the transcript position via TranscriptAnalyzer. If the agent does not implement TranscriptAnalyzer, the transcript offset will be 0. The sessionRef parameter is optional — if empty, transcript position won't be captured.
Works correctly from any subdirectory within the repository.
func CapturePreTaskState ¶
CapturePreTaskState captures current untracked files before a Task execution and saves them to a state file. Works correctly from any subdirectory within the repository.
func CheckoutBranch ¶
CheckoutBranch switches to the specified local branch. Uses git CLI instead of go-git to work around go-git v5 bug where Checkout deletes untracked files (see https://github.com/go-git/go-git/issues/970). Should be switched back to go-git once we upgrade to go-git v6 Returns an error if the ref doesn't exist or checkout fails.
Two guards, because neither covers the other.
ValidateBranchName replaces a leading-dash check that was the narrowest part of the problem: the ref arrives from `entire resume <branch>` and from a trail's branch field, and `git checkout` also reads `@{-1}` and a name carrying a newline. It still admits an object id, since `check-ref-format --branch` accepts a hex string, so the "or commit" half of the old contract survives even though no caller uses it.
The trailing `--` covers what validation cannot, and validation cannot cover it in principle: `git checkout <name>` falls back to treating <name> as a PATHSPEC when no such ref exists, and a filename is very often a perfectly legal branch name. `check-ref-format --branch README.md` exits 0, and `git checkout README.md` in a repo with no such branch then restores that file from the index, discarding the user's edits, and exits 0 -- a silent data loss reported as success. With the `--`, the same call is `fatal: invalid reference: README.md` and exits 128. A branch and a raw commit id both still resolve, so nothing legitimate is lost.
func CleanupPrePromptState ¶
CleanupPrePromptState removes the state file after use
func CleanupPreTaskState ¶
CleanupPreTaskState removes the task state file after use
func CountTodosFromToolInput ¶
func CountTodosFromToolInput(toolInput json.RawMessage) int
CountTodosFromToolInput returns the number of todo items in the TodoWrite tool_input. Returns 0 if the JSON is invalid or empty.
This function unwraps the outer tool_input object to extract the todos array, then delegates to strategy.CountTodos for the actual count.
func DependentsOf ¶ added in v0.10.0
DependentsOf returns the names of managed plugins whose manifests list name as a requirement — the remove guard. Computed by scanning pkg/*/manifest.yml; no extra state to maintain.
func DispatchLifecycleEvent ¶ added in v0.4.6
DispatchLifecycleEvent routes a normalized lifecycle event to the appropriate handler. Returns nil if the event was handled successfully.
func EnsurePluginBinDir ¶ added in v0.6.1
EnsurePluginBinDir creates the managed install dir if it doesn't exist.
func EnsurePluginPkgDir ¶ added in v0.10.0
EnsurePluginPkgDir creates the package directory for name.
func ExtractLastCompletedTodoFromToolInput ¶
func ExtractLastCompletedTodoFromToolInput(toolInput json.RawMessage) string
ExtractLastCompletedTodoFromToolInput extracts the content of the last completed todo item. In PostToolUse[TodoWrite], the tool_input contains the NEW todo list where the just-finished work is marked as "completed". The last completed item represents the work that was just done.
Returns empty string if no completed items exist or JSON is invalid.
func FetchAndCheckoutRemoteBranch ¶
FetchAndCheckoutRemoteBranch fetches a branch from origin and creates a local tracking branch. Uses git CLI instead of go-git for fetch because go-git doesn't use credential helpers, which breaks HTTPS URLs that require authentication.
func FetchBlobsByHash ¶ added in v0.5.1
FetchBlobsByHash fetches specific blob objects from the remote by their SHA-1 hashes. Uses "git fetch <target> <hash>" which goes through normal credential helpers, unlike fetch-pack which bypasses them. Requires the server to support uploadpack.allowReachableSHA1InWant (GitHub, GitLab, Bitbucket all do).
The fetch targets come from checkpointBlobFetchTargets: the single dedicated checkpoint_remote URL when one is configured, otherwise one target per checkpoint read candidate, tried in order (first success wins; blob fetches land in the object store, never in local refs, so both tiers are legal).
If fetching by hash fails on every target, falls back to a full metadata branch fetch.
func FetchCheckpointRef ¶ added in v0.8.0
func FetchCheckpointRef(ctx context.Context, ref plumbing.ReferenceName) error
FetchCheckpointRef fetches a single per-checkpoint ref from the checkpoint read-candidate remotes (elected sync remote first, then the legacy origin tier). It is the single cli-side RefFetchFunc wiring point — every checkpoint.OpenOptions.RefFetcher and direct call in this package routes through here, so all read paths consult the candidate chain via remote.FetchCheckpointRefFrom while keeping the public (ctx, ref) RefFetchFunc shape. See that function for the candidate semantics and the absence-vs-failure contract (no candidate has the ref wraps plumbing.ErrReferenceNotFound; transport failures surface as-is). Write-side hook probes deliberately stay on the single-target remote.HookCheckpointRefFetcher instead.
func FetchMetadataBranch ¶
FetchMetadataBranch fetches the entire/checkpoints/v1 branch from the checkpoint read-candidate remotes with full blob content. Used as a fallback by resume/explain when the tree-only probe is insufficient (e.g. the metadata.json blob is missing).
func FetchMetadataFromCheckpointRemote ¶ added in v0.5.3
FetchMetadataFromCheckpointRemote fetches the entire/checkpoints/v1 branch from the configured checkpoint_remote URL and updates the local branch. Returns an error if the fetch fails or no checkpoint_remote is configured.
func FetchMetadataTreeOnly ¶ added in v0.5.1
FetchMetadataTreeOnly fetches the entire/checkpoints/v1 commit+tree graph from the checkpoint read-candidate remotes to resolve the latest checkpoint, relying on --filter=blob:none (when filtered fetches are enabled) to skip blob content rather than on a shallow --depth=1 fetch.
It deliberately does NOT use --depth=1. A depth-1 fetch adds the fetched tip to .git/shallow, and any ref pointing at a shallow commit (the durable refs/remotes/origin/<branch> that git updates opportunistically, or the local primary) can no longer be walked past that boundary. A later `git merge-base` against it then falsely reports "no common ancestor", which makes push and `entire doctor` treat an ordinary diverged-but-behind branch as disconnected (see strategy.IsMetadataDisconnected). Fetching at full depth keeps the remote-tracking ref connected; git fetches incrementally, so after the first fetch only new commits/trees travel.
It also heals a repo that an older CLI already shallowed: the ref-scoped deep fetch removes the boundary left by a prior --depth=1 fetch rather than letting it linger forever, without deepening an independently-shallow source tree.
func FilterAndNormalizePaths ¶
FilterAndNormalizePaths converts absolute paths to relative and filters out infrastructure paths and paths outside the repo.
func FindActivePreTaskFile ¶
FindActivePreTaskFile finds an active pre-task file in .entire/tmp/ and returns the parent Task's tool_use_id. Returns ("", false) if no pre-task file exists. When multiple pre-task files exist (nested subagents), returns the most recently modified one. Works correctly from any subdirectory within the repository.
func GetAgentsWithHooksInstalled ¶
GetAgentsWithHooksInstalled returns names of agents that have hooks installed. An agent that could not be asked is absent; callers that must act on that difference use getAgentHookState.
func GetCurrentBranch ¶
GetCurrentBranch returns the name of the current branch. Returns an error if in detached HEAD state or if not in a git repository.
func GetCurrentHookAgent ¶
GetCurrentHookAgent returns the agent for the currently executing hook. Returns the agent based on the hook command structure (e.g., "entire hooks claude-code ...") rather than guessing from directory presence. Falls back to GetAgent() if not in a hook context.
func GetNextCheckpointSequence ¶
GetNextCheckpointSequence returns the next sequence number for incremental checkpoints. It counts existing checkpoint files in the task metadata checkpoints directory. Returns 1 if no checkpoints exist yet.
func GetStrategy ¶
func GetStrategy(_ context.Context) *strategy.ManualCommitStrategy
GetStrategy returns the manual-commit strategy instance with blob fetching enabled so that checkpoint reads work after treeless fetches.
func HasUncommittedChanges ¶
HasUncommittedChanges checks if there are any uncommitted changes in the repository. This includes staged changes, unstaged changes, and untracked files. Uses git CLI instead of go-git because go-git doesn't respect global gitignore (core.excludesfile) which can cause false positives for globally ignored files.
func InstalledAgentDisplayNames ¶ added in v0.5.4
InstalledAgentDisplayNames returns user-facing display names for agents with hooks installed.
func IsAccessibleMode ¶
func IsAccessibleMode() bool
IsAccessibleMode returns true if accessibility mode is enabled via the ACCESSIBLE environment variable.
func IsEnabled ¶
IsEnabled returns whether Entire is currently enabled. Returns true by default if settings cannot be loaded.
func IsOfficialPlugin ¶ added in v0.6.1
func IsOnDefaultBranch ¶
IsOnDefaultBranch checks if the repository is currently on the default branch. It determines the default branch by: 1. Checking the remote origin's HEAD reference 2. Falling back to common names (main, master) if remote HEAD is unavailable Returns (isDefault, branchName, error)
func JoinAgentNames ¶
JoinAgentNames joins agent names into a comma-separated string.
func ListCheckpointRefsOnRemote ¶ added in v0.9.0
func ListCheckpointRefsOnRemote(ctx context.Context) ([]plumbing.ReferenceName, error)
ListCheckpointRefsOnRemote enumerates the per-checkpoint refs (refs/entire/checkpoints/<shard>/<id>) present on the checkpoint remote(s), names only, via `git ls-remote refs/entire/checkpoints/*` — no object transfer. The git-refs store's List uses it to discover checkpoints written on another machine that have no local ref yet, then hydrates each lazily on read through FetchCheckpointRef.
Scope:
- checkpoint_remote configured → queries the resolved dedicated URL via remote.FetchURL (which can still fall through to origin in edge cases such as settings-load failure or an underivable checkpoint URL) — unchanged single-target behavior;
- otherwise → queries EVERY checkpoint read candidate (elected sync remote, then the legacy origin tier) and MERGES the listings — a union deduped by ref name. Merging rather than first-non-empty because pre-single-remote-sync, per-checkpoint refs landed on whichever remote the pre-push hook fired for, so disjoint legacy refs on origin coexisting with new refs on the elected remote are realistic and first-non-empty would shadow one side. Discovery is best-effort: a candidate failing logs at debug and doesn't block the others. When every candidate fails, the first error is returned so the store warns before showing local-only results. No candidates (remoteless repo) → (nil, nil).
Each candidate gets its own checkpointRefListTimeout budget so a hung elected remote cannot starve the legacy origin tier. Resolution and ls-remote are pinned to the worktree root (not process cwd) so repo-local git config (url.*.insteadOf, credential helpers, remotes) applies.
func LoadEntireSettings ¶
func LoadEntireSettings(ctx context.Context) (*settings.EntireSettings, error)
LoadEntireSettings loads the Entire settings from .entire/settings.json, then applies any overrides from .entire/settings.local.json if it exists. Returns default settings if neither file exists. Works correctly from any subdirectory within the repository.
Fails when `.entire` is not a real directory. The root pre-run already made that check for anything that reaches a command's RunE, so for those callers this is a second Lstat — but the pre-run does not cover everything. External plugins are dispatched from main.go before cobra runs at all, and commands exempt from the pre-run still reach settings through the post-run telemetry path. Settings are read FROM the directory in question, which makes this the one operation those callers have in common and so the place to guarantee the check happens at least once.
Outside a repository there is nothing to validate and the check is skipped, so settings still resolve to defaults there.
func MaybeRunPlugin ¶ added in v0.6.1
func MaybeRunPlugin(ctx context.Context, rootCmd *cobra.Command, args []string) (handled bool, exitCode int, killedBy os.Signal)
MaybeRunPlugin returns (true, exitCode) when an external command was resolved and run. On launch failure (e.g. missing executable bit) returns (true, 1) after printing to stderr. On no-match returns (false, 0) so the caller can fall through to Cobra. exitCode is ExitPluginSignalled when the plugin was killed by a signal, or when a signal interrupted an on-demand install before it ran; the caller turns that into a re-raised signal rather than an exit status.
killedBy is the signal the plugin was killed by, when the platform reports one. It is nil for an ordinary exit, on Windows, and for an install interrupted before any child existed — in that last case the signal is the one this process received, which the caller already has.
Telemetry and the version-check notice mirror Cobra's PersistentPostRun behavior for built-ins: both fire only on a successful (exit-0) run.
func NewAccessibleForm ¶
NewAccessibleForm creates a new huh form with Entire's standard theme, switching to accessibility mode when ACCESSIBLE is set.
func NewAuthenticatedAPIClient ¶ added in v0.5.2
NewAuthenticatedAPIClient creates a data API client for the selected login (see auth.ResolveDataAPI).
Pass insecureHTTP=true to allow plain HTTP base URLs for local development. Only the data origin is checked here — the bearer travels there on resource requests; the refresh leg is guarded by the per-context token manager (https required outside loopback/opt-in).
func NewAuthenticatedEntireAPICellClient ¶ added in v0.8.0
func NewAuthenticatedEntireAPICellClient(ctx context.Context, insecureHTTP bool, fullName string) (*api.Client, error)
NewAuthenticatedEntireAPICellClient creates an API client for repo-scoped entire-api routes (e.g. trails). It exchanges the login JWT for a jurisdictional identity token and dials the entire-api cell directly, because the BFF does not proxy these routes for bearer callers.
fullName (owner/repo) identifies the repo whose cell to reach. The repo's PROCESSING cell + jurisdiction are resolved from the control plane (mirroring the BFF's per-repo cell selection) so the call lands in the region that actually holds the repo's data. This is NOT best-effort: a resolution failure fails the command instead of falling back to the caller's home cell, because for repo-scoped data a silent wrong-region "success" is worse than an error — that fallback is exactly what used to make `entire trail` read the wrong region for a multi-homed repo like entirehq/entire.io.
func NewHelpCmd ¶
NewHelpCmd creates a custom help command that supports a hidden -t flag to display the entire command tree.
func NewRootCmd ¶
func OutdatedHookAgentDisplayNames ¶ added in v0.10.0
OutdatedHookAgentDisplayNames returns user-facing display names for agents whose hook config is out of date.
func OutdatedHookAgents ¶ added in v0.10.0
OutdatedHookAgents returns agents whose Entire hook config has drifted from what the CLI would write today, for `entire status` and `entire doctor` to surface. Agents that don't implement agent.HookFreshness are skipped: absence of a drift check reads as "nothing to report", never as a warning.
Every freshness implementation is asked directly so it can report a stale artifact that no longer qualifies as an active installation. For generated- file agents (Pi, OpenCode), the committed file *is* the installation, so a repo that ships one gets drift warnings even where nobody ran `entire agent add`.
func ParseSubagentTypeAndDescription ¶
func ParseSubagentTypeAndDescription(toolInput json.RawMessage) (agentType, description string)
ParseSubagentTypeAndDescription extracts subagent_type and description from Task tool_input. Returns empty strings if parsing fails or fields are not present.
func PluginBinDir ¶ added in v0.6.1
PluginBinDir returns the managed install directory. Binaries (or symlinks) placed here are auto-discovered by the kubectl-style dispatcher because main.go prepends this dir to PATH before MaybeRunPlugin runs.
func PluginDataDir ¶ added in v0.6.1
PluginDataDir returns the per-plugin data directory for the given bare name (e.g. "pgr" for `entire-pgr`). The returned path is not created — that's the plugin's responsibility on first use.
Returns an error for names the dispatcher would never invoke (empty, flag-shaped, agent-protocol-reserved, "."/".." path-traversal, slashes). This guarantees ENTIRE_PLUGIN_DATA_DIR always points inside the managed data subtree.
func PluginPkgDir ¶ added in v0.10.0
PluginPkgDir returns the per-plugin package directory for the given bare name. Not created — callers use EnsurePluginPkgDir when writing.
func PrependPluginBinDirToPATH ¶ added in v0.6.1
PrependPluginBinDirToPATH prepends the managed bin dir to the process's PATH so the kubectl dispatcher discovers managed-installed plugins. Idempotent against an already-prepended dir.
Returns a restore closure the caller invokes to revert PATH to its previous value. Restoring matters when no plugin runs: built-in commands and the subprocesses they spawn (git, hooks, less, …) should see the user's original PATH, not one with the managed plugin dir prepended. When a plugin *is* dispatched, callers can simply skip the restore — the process exits anyway, and the plugin child intentionally inherits the prepended PATH so it can spawn sibling managed plugins.
Errors and no-op cases (already-prepended, lookup failure) return a no-op restore so callers always have a safe func to call. Failures are emitted at debug level — the surface symptom ("my managed plugin doesn't run") is otherwise silent and hard to diagnose; a debug log surfaces the cause for users who flip log_level=DEBUG.
func RemoveInstalledPlugin ¶ added in v0.6.1
RemoveInstalledPlugin removes every managed-dir entry whose bare name matches name. Symlinks are unlinked without touching the source file.
Iterating all variants matters on Windows, where entire-foo.exe, entire-foo.bat, and entire-foo.cmd all map to bare name "foo" and could otherwise leave a runnable variant behind after `entire plugin remove foo`. On Unix the loop typically runs once.
func RemoveManagedPlugin ¶ added in v0.10.0
RemoveManagedPlugin removes a plugin's bin entries and its pkg dir. The dependency guard lives in the command layer so --force can bypass it.
func RemovePluginPkg ¶ added in v0.10.0
RemovePluginPkg deletes the plugin's pkg dir (binary + manifest). Missing dir is not an error — local-dev installs never had one.
func RenderUserFacingError ¶ added in v0.10.1
RenderUserFacingError cleans an error for display: it drops the `security "BearerAuth": security source "BearerAuth":` segments ogen's generated control-plane client wraps every auth failure in, which name the OpenAPI security scheme that failed to resolve and so say nothing a user can act on (see coreapi.StripSecurityWrapping).
It exists as a named function because there is more than one place the CLI turns an error into text, and they can't share one: main.go prints the error a command returns, renderCoreError feeds the mirror-add wizard (which prints its own errors and returns a SilentError, so main.go never sees them), and the search TUI captures err.Error() into its model before the command returns nil. Call this at any new site that renders an error for a user rather than adding another strip.
func ResolveAgentTranscriptPath ¶ added in v0.10.0
ResolveAgentTranscriptPath returns the path to an existing subagent transcript for agentID, or "" when none exists.
It prefers the current layout, paths.SubagentsDir (which is also what the turn-end extractor scans), and falls back to the legacy sibling layout — agent-<id>.jsonl directly beside the main transcript — so sessions recorded by older agent versions still resolve.
Order is the whole point: resolving only the legacy path silently yielded "" for every modern Claude Code session, which left task checkpoints without a subagent transcript and made file extraction fall back to scanning the main transcript, where a subagent's edits never appear.
An empty agentID never resolves — agent-.jsonl is not a real transcript.
strategy.resolveTaskTranscriptPath duplicates this exact layout logic (the strategy package cannot import cli, so it cannot call this function directly) — a layout change here must be mirrored there.
func SaveEntireSettings ¶
func SaveEntireSettings(ctx context.Context, s *settings.EntireSettings) error
SaveEntireSettings saves the Entire settings to .entire/settings.json.
func SaveEntireSettingsLocal ¶
func SaveEntireSettingsLocal(ctx context.Context, s *settings.EntireSettings) error
SaveEntireSettingsLocal saves the Entire settings to .entire/settings.local.json.
func SavePluginManifest ¶ added in v0.10.0
func SavePluginManifest(m *PluginManifest) error
SavePluginManifest writes the manifest into the plugin's pkg dir.
func ShouldSkipOnDefaultBranch ¶
ShouldSkipOnDefaultBranch checks if we're on the default branch. Returns (shouldSkip, branchName). If shouldSkip is true, the caller should skip the operation to avoid polluting main/master history. If the branch cannot be determined, returns (false, "") to allow the operation.
Types ¶
type BootstrapOptions ¶ added in v0.11.0
type BootstrapOptions struct {
// InitRepo is true if --init-repo was passed (accept git init without prompt).
InitRepo bool
// NoInitRepo is true if --no-init-repo was passed (decline without prompt).
NoInitRepo bool
// InitialCommitMessage overrides the default commit message prompt.
InitialCommitMessage string
// SkipInitialCommit leaves the newly-created files unstaged so the
// user can commit themselves.
SkipInitialCommit bool
// Yes accepts all defaults without prompting: init repo and commit with
// the default message.
Yes bool
}
BootstrapOptions holds flags that let `entire enable` run on a folder that isn't yet a git repository. All fields are optional; supplying one skips the matching interactive prompt.
Bootstrap is deliberately local-only: it runs `git init` and (optionally) an initial commit, and never creates or pushes to a remote. Publishing a directory is the user's call to make with their own forge tooling (`gh repo create`, `entire repo create`, a web UI), not a side effect of enabling Entire.
type DepAction ¶ added in v0.10.0
type DepAction struct {
Name string
RepoURL string
MinVersion string
// Upgrade is true when the dependency is installed but below
// MinVersion; the action reinstalls at the latest tag.
Upgrade bool
// CurrentTag is the installed tag for upgrades.
CurrentTag string
}
DepAction is one planned dependency install or upgrade.
type DepPlan ¶ added in v0.10.0
type DepPlan struct {
Actions []DepAction
// Warnings are non-blocking observations, e.g. a dependency satisfied
// from raw $PATH whose version cannot be verified.
Warnings []string
}
DepPlan is the result of resolving a plugin's transitive requirements.
func PlanDependencyInstalls ¶ added in v0.10.0
func PlanDependencyInstalls(ctx context.Context, rootReqs []PluginRequirement, idx *PluginIndex) (*DepPlan, error)
PlanDependencyInstalls resolves the transitive requirements of rootReqs into ordered install/upgrade actions. Missing dependencies must be resolvable to a repo URL via the requirement itself or the index. The visited set plus a depth bound make cycles an error path, not a hang.
type EnableOptions ¶ added in v0.4.9
type EnableOptions struct {
UseLocalSettings bool
UseProjectSettings bool
ForceHooks bool
SkipPushSessions bool
CheckpointRemote string
CheckpointPushRemote string
// CheckpointBackend selects the persistent checkpoint storage backend
// ("branch"/"refs" or the canonical "git-branch"/"git-refs"). Empty leaves
// the current/default (git-branch) backend in place.
CheckpointBackend string
Telemetry bool
AbsoluteGitHookPath bool
// SuppressDoneMessage tells `runEnableInteractive` to skip its final
// "Ready." line and the "commit the configuration files" hint. Set
// when the caller is running the bootstrap flow, which takes over
// presentation of the final state (commit, push, done).
SuppressDoneMessage bool
Yes bool
// ImportHistory opts into importing the selected agents' pre-existing
// session history during first-time setup. Deliberately NOT implied by
// Yes: ingesting a month of local transcripts is not a setup default (see
// maybeOfferSessionImport).
ImportHistory bool
SearchSkill bool
AgentHelpSkill bool
// contains filtered or unexported fields
}
EnableOptions holds the flags for `entire enable`.
type EntireSettings ¶
type EntireSettings = settings.EntireSettings
EntireSettings is an alias for settings.EntireSettings.
type FileChanges ¶ added in v0.4.3
type FileChanges struct {
Modified []string // Modified or staged files
New []string // Untracked files (filtered if previouslyUntracked provided)
Deleted []string // Deleted files (staged or unstaged)
}
FileChanges holds categorized file changes from git status.
func DetectFileChanges ¶ added in v0.4.3
func DetectFileChanges(ctx context.Context, previouslyUntracked []string) (*FileChanges, error)
DetectFileChanges returns categorized file changes from the current git status.
previouslyUntracked controls new-file detection:
- nil: all untracked files go into New
- non-nil: only untracked files NOT in the pre-existing set go into New
Modified includes both worktree and staging modified/added files. Deleted includes both staged and unstaged deletions. All results exclude .entire/ directory.
The status walk is budget-bounded (gitrepo.StatusWithBudget) because every caller but one is an agent-hook capture path. User-attended commands use detectFileChangesUnbounded instead.
type GitAuthor ¶
GitAuthor represents the git user configuration
func GetGitAuthor ¶
GetGitAuthor retrieves the git user.name and user.email from the repository config. It checks local config first, then falls back to global config. If go-git can't find the config, it falls back to using the git command. Returns fallback defaults if no user is configured anywhere.
type InstallPluginOptions ¶ added in v0.6.1
type InstallPluginOptions struct {
// SourcePath is the absolute (or working-dir-relative) path to the plugin
// executable. Its basename — minus any platform extension — must match
// `entire-<name>` so the dispatcher can resolve it.
SourcePath string
// Force replaces an already-installed plugin with the same name.
Force bool
}
InstallPluginOptions configures InstallPluginFromPath.
type InstalledPlugin ¶ added in v0.6.1
type InstalledPlugin struct {
// Name is the bare plugin name (without the `entire-` prefix and any
// platform-specific extension).
Name string
// Path is the absolute path inside the managed bin dir.
Path string
// Symlink is true when Path is a symlink to a source location elsewhere
// (the typical local-dev install). LinkTarget is populated in that case.
Symlink bool
LinkTarget string
}
InstalledPlugin describes a single entry in the managed bin dir.
func FindInstalledPlugin ¶ added in v0.6.1
func FindInstalledPlugin(name string) (*InstalledPlugin, error)
FindInstalledPlugin returns the entry for the given bare name, or nil if it isn't installed in the managed dir.
func InstallPluginFromPath ¶ added in v0.6.1
func InstallPluginFromPath(opts InstallPluginOptions) (*InstalledPlugin, error)
InstallPluginFromPath links or copies SourcePath into the managed bin dir (materializeManagedEntry). The caller is responsible for built-in conflict checks (resolvePlugin already gates dispatch on rootCmd.Find — installing a name that shadows a built-in is allowed but the built-in still wins at runtime).
Refuses names the dispatcher will never invoke (agent-protocol prefix, flag-shaped, "."/"..", slashes), and refuses self-install when the source is the same file as the would-be managed entry. The replace step is atomic: the new entry is created under a temp name and renamed onto <dest>, so a failed --force never leaves the previous install missing.
func ListInstalledPlugins ¶ added in v0.6.1
func ListInstalledPlugins() ([]*InstalledPlugin, error)
ListInstalledPlugins enumerates entries in the managed bin dir whose name starts with `entire-`. Sorted by bare name. A missing dir returns no error and an empty slice.
type PluginDoctorIssue ¶ added in v0.10.0
type PluginDoctorIssue struct {
Plugin string
Problem string
Fix string
// Note marks a state worth reporting that is not a fault — nothing needs
// fixing, so it does not make `plugin doctor` exit non-zero.
Note bool
}
PluginDoctorIssue is one problem found by RunPluginDoctor.
func RunPluginDoctor ¶ added in v0.10.0
func RunPluginDoctor(ctx context.Context) ([]PluginDoctorIssue, error)
RunPluginDoctor checks every managed plugin: bin entry present, dangling local-dev symlinks, dependency presence and min_versions, and (macOS) a quarantine attribute that would block execution.
type PluginIndex ¶ added in v0.10.0
type PluginIndex struct {
// Version is the declared schema version. Advisory only — see
// loadPluginIndexFromDir for why it isn't enforced.
Version int `json:"version"`
Plugins []PluginIndexEntry `json:"plugins"`
}
PluginIndex is the parsed catalog. Decoding is deliberately lenient (unknown fields ignored) so an index that grows new fields doesn't break older CLI versions fleet-wide.
func SyncPluginIndex ¶ added in v0.10.0
SyncPluginIndex returns the catalog for indexURL, cloning or refreshing the local copy as needed. force bypasses the TTL. When a refresh fails but a previous copy exists, the stale copy is used with a warning logged — discovery shouldn't hard-fail because a laptop is offline.
func (*PluginIndex) Find ¶ added in v0.10.0
func (idx *PluginIndex) Find(name string) *PluginIndexEntry
Find returns the entry with the given bare name, or nil.
func (*PluginIndex) FindByRepoURL ¶ added in v0.10.0
func (idx *PluginIndex) FindByRepoURL(repoURL string) *PluginIndexEntry
FindByRepoURL returns the entry published at repoURL, or nil. Comparison normalizes the .git suffix and trailing slashes.
The name matters as much as the presence: a URL install of a listed repo is trusted and never prompts, so the catalog entry is the only thing that says what the plugin should be called. Without it the remote picks the name unchallenged, and --force would replace whichever plugin it named.
func (*PluginIndex) Search ¶ added in v0.10.0
func (idx *PluginIndex) Search(term string) []PluginIndexEntry
Search returns entries whose name or description contains term (case-insensitive). An empty term returns everything.
type PluginIndexEntry ¶ added in v0.10.0
type PluginIndexEntry struct {
Name string `json:"name"`
RepoURL string `json:"repo_url"`
Description string `json:"description,omitempty"`
Official bool `json:"official,omitempty"`
// Platforms lists supported GOOS values when the plugin doesn't ship
// the full matrix; empty means all.
Platforms []string `json:"platforms,omitempty"`
}
PluginIndexEntry describes one plugin in the catalog.
type PluginManifest ¶ added in v0.10.0
type PluginManifest struct {
// Name is the bare plugin name ("run" for entire-run).
Name string `yaml:"name"`
// RepoURL is the full git URL the plugin was installed from.
RepoURL string `yaml:"repo_url"`
// Tag is the git tag that was installed (e.g. "v0.2.1").
Tag string `yaml:"tag"`
// Asset is the release asset filename the binary came from. Empty for
// raw-binary downloads where the asset name equals the binary name.
Asset string `yaml:"asset,omitempty"`
// SHA256 is the hex digest of the downloaded asset.
SHA256 string `yaml:"sha256,omitempty"`
// BinarySHA256 is the hex digest of the installed binary under
// pkg/<name>/. Distinct from SHA256, which covers the downloaded asset —
// usually an archive, and discarded with the staging dir. Recording the
// binary is what lets `plugin doctor` detect post-install tampering.
BinarySHA256 string `yaml:"binary_sha256,omitempty"`
// Unverified records that no checksum manifest authenticated the
// download (installed with --allow-unverified). Surfaced by doctor.
Unverified bool `yaml:"unverified,omitempty"`
// Pinned marks installs done with --pin; upgrade skips them.
Pinned bool `yaml:"pinned,omitempty"`
// InstalledAt is when the install (or last upgrade) completed.
InstalledAt time.Time `yaml:"installed_at,omitempty"`
// Requires is the dependency list from the plugin's entire-plugin.yml
// at the installed tag.
Requires []PluginRequirement `yaml:"requires,omitempty"`
}
PluginManifest records how a managed plugin was installed. Settings configure behavior; manifests record facts. The dependency list is copied from the plugin's metadata at install time so reverse-dependency checks (remove guard, doctor) work offline.
func ListPluginManifests ¶ added in v0.10.0
func ListPluginManifests() ([]*PluginManifest, error)
ListPluginManifests returns the manifests of every remote-installed plugin, sorted by name. Pkg entries without a readable manifest are skipped — a half-removed plugin shouldn't break listing.
func LoadPluginManifest ¶ added in v0.10.0
func LoadPluginManifest(name string) (*PluginManifest, error)
LoadPluginManifest reads the manifest for name. Returns (nil, nil) when the plugin has no manifest — local-dev installs and raw-PATH plugins.
type PluginMetadata ¶ added in v0.10.0
type PluginMetadata struct {
// Name is the bare plugin name. When empty, derived from the repo URL
// basename (entire-run → run).
Name string `yaml:"name,omitempty"`
// Description is a one-line summary shown by info/search.
Description string `yaml:"description,omitempty"`
// DownloadURL overrides the per-forge release-asset URL convention.
// Template placeholders: {name} {tag} {version} {os} {arch} {asset}.
// When {asset} is present, candidate asset filenames are substituted;
// otherwise the expanded template is fetched as-is.
DownloadURL string `yaml:"download_url,omitempty"`
// Requires lists plugins this plugin needs at runtime.
Requires []PluginRequirement `yaml:"requires,omitempty"`
}
PluginMetadata is the author-side declaration committed at the root of a plugin repository as entire-plugin.yml. Everything is optional — a repo without the file installs fine; the name then derives from the repo URL.
func ParsePluginMetadata ¶ added in v0.10.0
func ParsePluginMetadata(data []byte) (*PluginMetadata, error)
ParsePluginMetadata decodes entire-plugin.yml content.
Decoding is lenient: unknown keys are ignored, matching the choice made for index.json. Both are artifacts read by every CLI version ever shipped, and refusing one an older binary doesn't fully understand breaks it permanently for everyone on that version — the plugin author cannot fix it for them. entire-plugin.yml has no version field to gate on either, so the first author to adopt any future field (min_cli_version, bin_name, …) would break installs on every older CLI.
This deliberately gives up catching author typos here, which strict decoding did. The trade is asymmetric: a misspelled key costs the author one confused test run against their own plugin, while a forward-compatibility break is unfixable and fleet-wide. Author-side validation belongs in a lint command, not in the hot path every user's install runs through.
type PluginRequirement ¶ added in v0.10.0
type PluginRequirement struct {
// Name is the bare plugin name of the dependency, resolved through the
// plugin index.
Name string `yaml:"name"`
// MinVersion is the minimum acceptable tag (e.g. "v0.2.0"). Minimum
// only — there is deliberately no range syntax.
MinVersion string `yaml:"min_version,omitempty"`
}
PluginRequirement declares a dependency on another plugin. Shared between the author-side metadata file (entire-plugin.yml) and the install-side manifest so the two can never drift.
There is deliberately no repo_url. A missing dependency resolves by name through the plugin index, so the URL a dependency install fetches from always comes from the curated catalog rather than from the requiring plugin's author. With an author-supplied URL, installing one plugin meant fetching and executing a binary from a URL its author chose — and dependency planning contacted that URL *before* the confirmation prompt. The capability is not gone, the authority moved: a user can still install an out-of-catalog dependency by URL themselves, with the usual untrusted-source prompt, after which the requirement is satisfied. Consent belongs to the user, not the author.
A dependency must therefore be indexed before a dependent can ship, the same constraint krew, Homebrew and apt impose.
type PrePromptState ¶
type PrePromptState struct {
SessionID string `json:"session_id"`
Timestamp string `json:"timestamp"`
UntrackedFiles []string `json:"untracked_files"`
// UntrackedScanSkipped records that the pre-prompt untracked scan failed
// (e.g. the status walk breached its wall-clock budget). Turn-end must
// then skip new-file detection entirely: with no baseline, every
// untracked file in the worktree would be misreported as created by this
// turn.
UntrackedScanSkipped bool `json:"untracked_scan_skipped,omitempty"`
// TranscriptOffset is the unified transcript position when this state was captured.
// For Claude Code (JSONL), this is the line count.
// For Gemini CLI (JSON), this is the message count.
// Zero means not set or session just started.
TranscriptOffset int `json:"transcript_offset,omitempty"`
// LastTranscriptIdentifier is the agent-specific identifier at the transcript position.
// UUID for Claude Code, message ID for Gemini CLI. Optional metadata.
LastTranscriptIdentifier string `json:"last_transcript_identifier,omitempty"`
// Deprecated: StartMessageIndex is the old Gemini-specific field.
// Migrated to TranscriptOffset on load.
StartMessageIndex int `json:"start_message_index,omitempty"`
// Deprecated: StepTranscriptStart is the old Claude-specific field.
// Migrated to TranscriptOffset on load.
StepTranscriptStart int `json:"step_transcript_start,omitempty"`
// Deprecated: LastTranscriptLineCount is the oldest name for transcript position.
// Migrated to TranscriptOffset on load.
LastTranscriptLineCount int `json:"last_transcript_line_count,omitempty"`
}
PrePromptState stores the state captured before a user prompt
func LoadPrePromptState ¶
func LoadPrePromptState(ctx context.Context, sessionID string) (*PrePromptState, error)
LoadPrePromptState loads previously captured state. Returns nil if no state file exists.
func (*PrePromptState) PreUntrackedFiles ¶ added in v0.4.3
func (s *PrePromptState) PreUntrackedFiles() []string
PreUntrackedFiles returns the untracked files list, or nil if the receiver is nil. This nil-vs-empty distinction lets DetectFileChanges know whether to skip new-file detection. When the receiver is non-nil but UntrackedFiles is nil (e.g., old state files deserialized with "untracked_files": null), returns an empty non-nil slice so that all current untracked files are correctly treated as new.
type PreTaskState ¶
type PreTaskState struct {
ToolUseID string `json:"tool_use_id"`
Timestamp string `json:"timestamp"`
UntrackedFiles []string `json:"untracked_files"`
// UntrackedScanSkipped mirrors PrePromptState.UntrackedScanSkipped for the
// subagent path: when set, subagent-end must skip new-file detection.
UntrackedScanSkipped bool `json:"untracked_scan_skipped,omitempty"`
}
PreTaskState stores the state captured before a task execution
func LoadPreTaskState ¶
func LoadPreTaskState(ctx context.Context, toolUseID string) (*PreTaskState, error)
LoadPreTaskState loads previously captured task state. Returns nil if no state file exists.
func (*PreTaskState) PreUntrackedFiles ¶ added in v0.4.3
func (s *PreTaskState) PreUntrackedFiles() []string
PreUntrackedFiles returns the untracked files list, or nil if the receiver is nil. See PrePromptState.PreUntrackedFiles for nil-vs-empty semantics.
type RemoteInstallOptions ¶ added in v0.10.0
type RemoteInstallOptions struct {
// Pin, when non-empty, installs exactly this tag and marks the
// manifest pinned so upgrade skips it.
Pin string
// Force replaces an existing managed entry with the same name.
Force bool
// AllowUnverified permits installing a release that publishes no
// checksums.txt covering this platform. Off by default: downloading and
// executing an unauthenticated binary is the supply-chain risk the
// checksum path exists to remove, so it takes an explicit opt-in.
AllowUnverified bool
}
RemoteInstallOptions configures InstallPluginFromRepo. It holds only genuine options — the repository and the expected name are required arguments, because a caller that omits either is making a decision, not accepting a default.
type RemoteInstallResult ¶ added in v0.10.0
type RemoteInstallResult struct {
Installed *InstalledPlugin
Manifest *PluginManifest
Metadata *PluginMetadata
// SkippedTags lists newer tags that were passed over for missing
// assets, newest first. Callers surface these as warnings.
SkippedTags []string
// ReplacedFrom is the repository a --force install displaced, set only
// when it differs from the one just installed. --force is *for* replacing,
// so this is not an error — but the confirmation for a URL install names a
// URL, never the plugin it is about to overwrite, and the remote picks that
// name. Surfacing it is what turns an uninformed replacement into an
// informed one, and gives the user the URL to put things back.
ReplacedFrom string
}
RemoteInstallResult is what a successful remote install produced.
func ExecuteDepPlan ¶ added in v0.10.0
func ExecuteDepPlan(ctx context.Context, plan *DepPlan, allowUnverified bool) ([]*RemoteInstallResult, error)
ExecuteDepPlan runs the planned installs. Upgrades pass Force. allowUnverified is inherited from the root install so a single --allow-unverified covers the whole transitive set the user confirmed, rather than failing partway through on the first dependency without published checksums.
func InstallPluginFromRepo ¶ added in v0.10.0
func InstallPluginFromRepo(ctx context.Context, repoURL, expectedName string, opts RemoteInstallOptions) (*RemoteInstallResult, error)
InstallPluginFromRepo installs a plugin from a git repository URL. Dependency resolution deliberately does not happen here — callers (the install command) plan and confirm dependency installs first. expectedName is the plugin name the caller has already committed to — the index entry the user asked for, the requirement being satisfied, or the plugin being upgraded. Pass "" only for a bare `install <url>`, where the repository legitimately names itself; installRepoAtTag explains why a mismatch is otherwise fatal.
It is a required argument rather than an options field on purpose. As a field it could be silently omitted, and omitting it reopens a no-prompt name-substitution hole; as an argument, passing "" is a visible choice at the call site.
type SilentError ¶
type SilentError struct {
Err error
}
SilentError wraps an error to signal that the error message has already been printed to the user. main.go checks for this type to avoid duplicate output.
func NewSilentError ¶
func NewSilentError(err error) *SilentError
NewSilentError creates a SilentError wrapping the given error. Use this when you've already printed a user-friendly error message and don't want main.go to print the error again.
func (*SilentError) AlreadyPrinted ¶ added in v0.7.8
func (e *SilentError) AlreadyPrinted() bool
AlreadyPrinted reports that the user-facing message has already been written.
func (*SilentError) Error ¶
func (e *SilentError) Error() string
func (*SilentError) Unwrap ¶
func (e *SilentError) Unwrap() error
type SubagentCheckpointHookInput ¶
type SubagentCheckpointHookInput struct {
SessionID string `json:"session_id"`
TranscriptPath string `json:"transcript_path"`
ToolName string `json:"tool_name"`
ToolUseID string `json:"tool_use_id"`
ToolInput json.RawMessage `json:"tool_input"`
ToolResponse json.RawMessage `json:"tool_response"`
}
SubagentCheckpointHookInput represents the JSON input from PostToolUse hooks for subagent checkpoint creation (TodoWrite, Edit, Write)
type TempFileDeleteError ¶ added in v0.4.6
TempFileDeleteError contains a file name and the error that occurred during deletion.
type UpgradeOutcome ¶ added in v0.10.0
type UpgradeOutcome struct {
Name string
// Pinned: skipped because the manifest is pinned.
Pinned bool
// UpToDate: already at the newest tag.
UpToDate bool
// FromTag/ToTag are set when an upgrade actually happened.
FromTag, ToTag string
}
UpgradeOutcome describes what UpgradeInstalledPlugin did.
func UpgradeInstalledPlugin ¶ added in v0.10.0
func UpgradeInstalledPlugin(ctx context.Context, name string) (*UpgradeOutcome, error)
UpgradeInstalledPlugin re-resolves the newest tag for a remote-installed plugin and reinstalls when it differs from the manifest's tag. Plugins without a manifest (local-dev symlinks) are not upgradable.
Source Files
¶
- activity_cmd.go
- activity_render.go
- activity_tui.go
- activity_types.go
- agent_group.go
- agent_help_cmd.go
- api_client.go
- api_cmd.go
- attach.go
- attach_transcript.go
- attribution.go
- auth.go
- auth_context.go
- authcmd.go
- browser_open_other.go
- cell_fanout.go
- cell_target.go
- checkpoint_api_reader.go
- checkpoint_backend.go
- checkpoint_group.go
- checkpoint_list.go
- checkpoint_resume.go
- checkpoint_tokens.go
- clean.go
- cluster_group.go
- cluster_list.go
- codex_hook_diagnostics.go
- commit_message.go
- config.go
- constants.go
- context_flag.go
- corecmd.go
- dispatch.go
- dispatch_jurisdiction.go
- dispatch_tui.go
- dispatch_wizard.go
- dispatch_wizard_scope.go
- doctor.go
- doctor_bundle.go
- doctor_logs.go
- doctor_migrate.go
- entireapi_client.go
- entiredir_guard.go
- errors.go
- experts_cmd.go
- experts_tui.go
- explain.go
- explain_export.go
- explain_repo.go
- explain_summary_provider.go
- flaggroups.go
- git_operations.go
- grant.go
- head_checkpoint_flags.go
- help.go
- hook_guard.go
- hook_registry.go
- hooks.go
- hooks_claudecode_posttodo.go
- hooks_cmd.go
- hooks_git_cmd.go
- import_cmd.go
- import_link.go
- import_progress.go
- import_sync_notice.go
- keys.go
- labs.go
- lifecycle.go
- login.go
- logout.go
- mcp.go
- model_label.go
- names.go
- org.go
- plugin.go
- plugin_confirm.go
- plugin_deps.go
- plugin_env.go
- plugin_fetch.go
- plugin_gitremote.go
- plugin_group.go
- plugin_index.go
- plugin_install_remote.go
- plugin_manifest.go
- plugin_official.go
- plugin_on_demand.go
- plugin_progress.go
- plugin_signal_unix.go
- plugin_store.go
- plugin_store_unix.go
- progress.go
- project.go
- recap.go
- recap_errors.go
- recap_tui.go
- remote_topology.go
- repo.go
- repo_access.go
- repo_clone.go
- repo_mirror.go
- repo_mirror_add_wizard.go
- repo_mirror_probe.go
- repo_mirror_ref.go
- repo_mirror_remove.go
- repo_native_mirror.go
- repo_protection.go
- repo_readiness.go
- repo_remote.go
- repo_remote_url.go
- resolveref.go
- resume.go
- resume_continue.go
- resume_picker.go
- review_bridge.go
- review_context.go
- review_helpers.go
- review_target.go
- root.go
- runner_apply.go
- runner_gather.go
- runner_group.go
- runner_init.go
- runner_prompt.go
- runner_setup.go
- search_cmd.go
- search_telemetry.go
- search_tui.go
- search_v4.go
- session_adopt.go
- session_current.go
- session_finalize.go
- session_sweep.go
- session_tokens.go
- sessions.go
- setup.go
- setup_agent_help_skill.go
- setup_bootstrap.go
- setup_checkpoint_remote.go
- setup_external_agents.go
- setup_identity.go
- setup_import.go
- setup_managed_scaffold.go
- setup_search_skill.go
- state.go
- status.go
- status_style.go
- tokens_profile.go
- trace.go
- trace_cmd.go
- trail_approval_cmd.go
- trail_checkout_worktree.go
- trail_cmd.go
- trail_comment_cmd.go
- trail_context_cache.go
- trail_resume_cmd.go
- trail_review_cmd.go
- trail_review_patch.go
- trail_watch_cmd.go
- transcript.go
- uninstall_output.go
- utils.go
Directories
¶
| Path | Synopsis |
|---|---|
|
Package agent provides interfaces and types for integrating with coding agents.
|
Package agent provides interfaces and types for integrating with coding agents. |
|
claudecode
Package claudecode implements the Agent interface for Claude Code.
|
Package claudecode implements the Agent interface for Claude Code. |
|
codex
Package codex implements the Agent interface for OpenAI's Codex CLI.
|
Package codex implements the Agent interface for OpenAI's Codex CLI. |
|
copilotcli
Package copilotcli implements the Agent interface for GitHub Copilot CLI.
|
Package copilotcli implements the Agent interface for GitHub Copilot CLI. |
|
cursor
Package cursor implements the Agent interface for Cursor.
|
Package cursor implements the Agent interface for Cursor. |
|
external
Package external provides an adapter that bridges external agent binaries (discovered via PATH as entire-agent-<name>) to the agent.Agent interface.
|
Package external provides an adapter that bridges external agent binaries (discovered via PATH as entire-agent-<name>) to the agent.Agent interface. |
|
factoryaidroid
Package factoryaidroid implements the Agent interface for Factory AI Droid.
|
Package factoryaidroid implements the Agent interface for Factory AI Droid. |
|
geminicli
Package geminicli implements the Agent interface for Gemini CLI.
|
Package geminicli implements the Agent interface for Gemini CLI. |
|
opencode
Package opencode implements the Agent interface for OpenCode.
|
Package opencode implements the Agent interface for OpenCode. |
|
pi
Package pi implements the Agent interface for the pi coding agent (https://github.com/earendil-works/pi-mono).
|
Package pi implements the Agent interface for the pi coding agent (https://github.com/earendil-works/pi-mono). |
|
pi/pijsonl
Package pijsonl provides shared parsing primitives for Pi's session JSONL format.
|
Package pijsonl provides shared parsing primitives for Pi's session JSONL format. |
|
skilldiscovery
Package skilldiscovery holds the per-agent registries (curated built-ins, install hints) and the keyword match helper that the `entire review` picker uses to discover review-adjacent skills.
|
Package skilldiscovery holds the per-agent registries (curated built-ins, install hints) and the keyword match helper that the `entire review` picker uses to discover review-adjacent skills. |
|
spawn
Package spawn provides the Spawner interface used by both `entire review` and `entire investigate` to start an agent process non-interactively.
|
Package spawn provides the Spawner interface used by both `entire review` and `entire investigate` to start an agent process non-interactively. |
|
testutil
Package testutil provides shared test utilities for agent packages.
|
Package testutil provides shared test utilities for agent packages. |
|
vogon
Package vogon implements the Agent interface for a deterministic test agent used as an E2E canary.
|
Package vogon implements the Agent interface for a deterministic test agent used as an E2E canary. |
|
Package agentimport imports a coding agent's pre-existing local transcripts into Entire as read-only, commit-less checkpoints on the v1 metadata branch.
|
Package agentimport imports a coding agent's pre-existing local transcripts into Entire as read-only, commit-less checkpoints on the v1 metadata branch. |
|
Package benchutil provides test fixture helpers for CLI benchmarks.
|
Package benchutil provides test fixture helpers for CLI benchmarks. |
|
Package checkpoint provides types and interfaces for checkpoint storage.
|
Package checkpoint provides types and interfaces for checkpoint storage. |
|
fsstore
Package fsstore is a reference, test-only persistent checkpoint backend that stores checkpoints as JSON files on disk.
|
Package fsstore is a reference, test-only persistent checkpoint backend that stores checkpoints as JSON files on disk. |
|
id
Package id provides the CheckpointID type for identifying checkpoints.
|
Package id provides the CheckpointID type for identifying checkpoints. |
|
Package entiredir owns access to the repository's .entire directory.
|
Package entiredir owns access to the repository's .entire directory. |
|
Package execx provides explicit helpers for spawning subprocesses with a chosen TTY attachment mode, replacing env-var signalling with real OS state.
|
Package execx provides explicit helpers for spawning subprocesses with a chosen TTY attachment mode, replacing env-var signalling with real OS state. |
|
Package experimental gates the visibility of experimental CLI commands.
|
Package experimental gates the visibility of experimental CLI commands. |
|
Package gitdir owns access to the git common directory — .git in an ordinary checkout, and the main repository's .git when running from a linked worktree.
|
Package gitdir owns access to the git common directory — .git in an ordinary checkout, and the main repository's .git when running from a linked worktree. |
|
Package gitexec runs the git CLI from inside the codebase.
|
Package gitexec runs the git CLI from inside the codebase. |
|
Package gitremote provides general-purpose git remote URL utilities: parsing, resolving, and redacting remote URLs.
|
Package gitremote provides general-purpose git remote URL utilities: parsing, resolving, and redacting remote URLs. |
|
Package interactive provides TTY-related helpers shared between the cli and strategy packages without inducing an import cycle (strategy cannot import cli).
|
Package interactive provides TTY-related helpers shared between the cli and strategy packages without inducing an import cycle (strategy cannot import cli). |
|
internal
|
|
|
flock
Package flock provides a small cross-process advisory-lock primitive built on POSIX flock (Unix) / LockFileEx (Windows).
|
Package flock provides a small cross-process advisory-lock primitive built on POSIX flock (Unix) / LockFileEx (Windows). |
|
Package jsonutil provides JSON utilities with consistent formatting.
|
Package jsonutil provides JSON utilities with consistent formatting. |
|
Package logging provides structured logging for the Entire CLI using slog.
|
Package logging provides structured logging for the Entire CLI using slog. |
|
Package mdrender renders markdown to terminal-styled output using the shared entire CLI base16 palette (magenta H1, cyan H2, blue H3, plus chroma syntax highlighting).
|
Package mdrender renders markdown to terminal-styled output using the shared entire CLI base16 palette (magenta H1, cyan H2, blue H3, plus chroma syntax highlighting). |
|
Package osroot provides traversal-resistant file I/O helpers built on os.Root (Go 1.24+).
|
Package osroot provides traversal-resistant file I/O helpers built on os.Root (Go 1.24+). |
|
Package palette is the single source of truth for terminal colors used across the Entire CLI.
|
Package palette is the single source of truth for terminal colors used across the Entire CLI. |
|
Package proclive captures a process's identity (PID plus a start-time fingerprint) and later reports whether that exact process is still alive.
|
Package proclive captures a process's identity (PID plus a start-time fingerprint) and later reports whether that exact process is still alive. |
|
Package procutil holds helpers for cancelling spawned subprocesses.
|
Package procutil holds helpers for cancelling spawned subprocesses. |
|
Package provenance owns the env-var contract that lets the lifecycle hook recognize a spawned agent process as part of `entire review` or `entire investigate`.
|
Package provenance owns the env-var contract that lets the lifecycle hook recognize a spawned agent process as part of `entire review` or `entire investigate`. |
|
Package recap contains the server-backed data types and static renderer behind `entire recap`.
|
Package recap contains the server-backed data types and static renderer behind `entire recap`. |
|
Package review — see env.go for package-level rationale.
|
Package review — see env.go for package-level rationale. |
|
types
Package types defines the per-agent abstraction interfaces for `entire review`.
|
Package types defines the per-agent abstraction interfaces for `entire review`. |
|
Package runnerdefaults embeds the canonical generic trail runner configs, so `entire runner setup` can scaffold them into a repository that has none yet.
|
Package runnerdefaults embeds the canonical generic trail runner configs, so `entire runner setup` can scaffold them into a repository that has none yet. |
|
Package search provides search functionality via the Entire search service.
|
Package search provides search functionality via the Entire search service. |
|
Package settings provides configuration loading for Entire.
|
Package settings provides configuration loading for Entire. |
|
Pre-push OPF rewrite for the git-refs checkpoint backend, the sibling of manual_commit_opf_rewrite.go's entire/checkpoints/v1 rewrite.
|
Pre-push OPF rewrite for the git-refs checkpoint backend, the sibling of manual_commit_opf_rewrite.go's entire/checkpoints/v1 rewrite. |
|
Package stringutil provides UTF-8 safe string manipulation utilities.
|
Package stringutil provides UTF-8 safe string manipulation utilities. |
|
Package summarize provides AI-powered summarization of development sessions.
|
Package summarize provides AI-powered summarization of development sessions. |
|
Package testutil provides shared test utilities for both integration and e2e tests.
|
Package testutil provides shared test utilities for both integration and e2e tests. |
|
gitenv
Package gitenv isolates test git invocations from the host's git config.
|
Package gitenv isolates test git invocations from the host's git config. |
|
Package trail provides types and helpers for managing trail metadata.
|
Package trail provides types and helpers for managing trail metadata. |
|
Package trailers provides parsing and formatting for Entire commit message trailers.
|
Package trailers provides parsing and formatting for Entire commit message trailers. |
|
Package transcript provides shared types and utilities for parsing JSONL transcripts.
|
Package transcript provides shared types and utilities for parsing JSONL transcripts. |
|
compact
Package compact converts full.jsonl transcripts into a normalized, compact transcript.jsonl format.
|
Package compact converts full.jsonl transcripts into a normalized, compact transcript.jsonl format. |
|
imageextract
Package imageextract externalizes inline base64 images from an agent's session transcript into a checkpoint asset store, replacing each with a compact, path-bearing placeholder, and re-injects them byte-exactly on restore.
|
Package imageextract externalizes inline base64 images from an agent's session transcript into a checkpoint asset store, replacing each with a compact, path-bearing placeholder, and re-injects them byte-exactly on restore. |
|
Package tuiutil hosts width-aware text helpers for fixed-width TUI dashboards: ANSI/control-char stripping, display-width-based truncation and padding, and a compact duration formatter.
|
Package tuiutil hosts width-aware text helpers for fixed-width TUI dashboards: ANSI/control-char stripping, display-width-based truncation and padding, and a compact duration formatter. |
|
Package uiform builds huh forms wired to Entire's standard theme and accessibility behavior.
|
Package uiform builds huh forms wired to Entire's standard theme and accessibility behavior. |
|
Package validation provides input validation functions for the Entire CLI.
|
Package validation provides input validation functions for the Entire CLI. |
|
Package worktreedir owns access to the files of the working tree itself.
|
Package worktreedir owns access to the files of the working tree itself. |