Skip to main content

Module cli

Module cli 

Source

Re-exportsยง

use super::components::scan_extensions; ๐Ÿ”’
use super::InstalledPluginEntry; ๐Ÿ”’
use super::MarketplaceEntry; ๐Ÿ”’
use super::MarketplaceSourceEntry; ๐Ÿ”’
use super::PluginCapability; ๐Ÿ”’
use super::PluginRunRowStatus; ๐Ÿ”’
use super::PluginUpdateRecord; ๐Ÿ”’
use super::PluginUpdateRun; ๐Ÿ”’
use super::PluginsInventorySnapshot; ๐Ÿ”’
use super::classify_update_row; ๐Ÿ”’
use crate::env::git_command; ๐Ÿ”’
use serde::Deserialize; ๐Ÿ”’
use serde::Deserialize; ๐Ÿ”’
use serde_json::Value; ๐Ÿ”’
use std::path::Path; ๐Ÿ”’
use std::path::PathBuf; ๐Ÿ”’
use std::process::Command; ๐Ÿ”’

Structsยง

AvailablePluginJson ๐Ÿ”’
BatchOut
The batchโ€™s outcome: the finished run, the rollback records for the rows that moved, the plugins whose update stated the restart contract, and the post-batch inventory when the refresh landed.
BatchPlan
Everything one update batch needs beyond its queued rows. The caller owns plan capture: which plugins, their per-row cwd, and the marketplace clone HEADs a later rollback restores.
InstalledPluginJson ๐Ÿ”’
MarketplaceListJson ๐Ÿ”’
MarketplaceSourceJson ๐Ÿ”’
PluginDetails
A pluginโ€™s claude plugin details projection: the always-on token cost every session pays for the plugin being installed. The shape lives in forge_primitives::plugins beside the snapshot that carries it. A pluginโ€™s claude plugin details projection: the always-on token cost every session pays for the plugin being installed.
UpdateOutcome
One claude plugin update call: the combined CLI output (the update classifier reads it, the CLI exits 0 on some failures) plus whether the output states the restart contract.
UpdateRunner
The CLI surface one update batch runs through; injectable so tests drive a whole batch without shelling out. The production instance wraps the claude subprocess calls.

Enumsยง

PluginRollbackOutcome
How a rollbackโ€™s CLI steps landed.

Functionsยง

execute_update_batch
Run a queued update batch: one CLI call per row, sequentially, continuing past failures. Every row reaches a terminal status in plan order; on_progress observes each intermediate run state.
fail_still_running ๐Ÿ”’
fetch_plugin_details
Fetch the always-on cost for (plugin id, version) requests, sequentially, one claude plugin details call each. A plugin whose details fail is simply absent from the map - a missing cost reads as no badge, never as an error on the pane.
fetch_plugin_details_inner ๐Ÿ”’
The requested version travels with the cost: an update landing between the request and the merge must not pin the old cost under the new versionโ€™s key.
inventory_from_disk_blocking
The disk-only inventory: registry, settings and manifests, no claude spawn. The TTL refresh path runs this; None when no plugins root resolves.
marketplace_head
The marketplace cloneโ€™s HEAD, or None when the location is not a git checkout (a directory-sourced marketplace) or git fails. This ref is what a rollback later restores.
now_rfc3339 ๐Ÿ”’
output_states_restart_required
The CLIโ€™s own contract: an applied update lands only after a restart, stated in the update output.
parse_always_on_tokens ๐Ÿ”’
The always-on token cost parsed from a details output, recorded from the CLI (โ€œ Always-on: ~450 tok added to every sessionโ€œ).
parse_json_command ๐Ÿ”’
plugin_details
One pluginโ€™s claude plugin details projection.
plugin_details_blocking ๐Ÿ”’
plugin_update_args
The claude plugin update invocation for one installed entry.
refresh_inventory
refresh_inventory_blocking ๐Ÿ”’
resolve_claude_path ๐Ÿ”’
rollback_claude_args ๐Ÿ”’
The two claude plugin steps of a rollback, in order: install the version the rolled-back manifest points at, then move the marketplace clone forward again so other plugins keep tracking the latest. Swapping them would silently re-pin the clone at the old ref.
rollback_git_args ๐Ÿ”’
The two git steps of a rollback, in order: fetch the pre-update ref, then detach the marketplace clone onto it so claude plugin update resolves the version that manifest points at.
run_cli_command
Run one claude plugin ... action without the trailing inventory refresh, so a section-level run can interleave per-plugin work with progress updates and refresh once at the end. Returns the resolved claude path (reuse it across a run) plus the CLIโ€™s combined stdout+stderr - the update classifier needs the output, because the CLI exits 0 on some failures.
run_cli_command_and_refresh
run_command ๐Ÿ”’
run_plugin_rollback
Roll one plugin back to its recorded previous version: restore the marketplace clone to the pre-update ref, let claude plugin update install the version that manifest points at, then move the clone forward again so other plugins keep tracking the latest. A failed git or plugin-update step aborts with Err; only the trailing clone-restore failure lands as [PluginRollbackOutcome:: RolledBackCloneParked].
scan_components_dir ๐Ÿ”’
The disk scan over the resolved plugins root. A root that cannot resolve warns: an empty scan must never read as a clean install.
timed_json_command ๐Ÿ”’
parse_json_command with a per-call duration line, so the โ€œwhy is the pane slowโ€ question is answerable per spawn.
update_plugin
Update one installed plugin in one scope.

Type Aliasesยง

RunnerFut
One future handed back by the UpdateRunner seams.
RunnerRefreshResult
The refresh seamโ€™s result: the inventory plus a resolved claude path.
RunnerUpdateResult
The update seamโ€™s result: the resolved claude path plus the CLIโ€™s combined stdout+stderr.
SharedRefreshFn ๐Ÿ”’
SharedUpdateFn ๐Ÿ”’