feat: rename install flags and unify .install dispatch

--install now takes a git URL or an installed bundle name: categories
are redirected to the new --install-builtins, installed names become
implicit updates, and source-shaped values install remotely. The old
--install-from keeps its exact behavior as a hidden deprecated alias.
The REPL's .install gains the same unified dispatch while keeping
.install <category> and .install remote <url> back-compat.
This commit is contained in:
2026-08-24 11:15:12 -06:00
parent 0e5d85f2ff
commit bca85a4017
7 changed files with 502 additions and 34 deletions
+41
View File
@@ -3264,6 +3264,17 @@ impl RequestContext {
let mut values: Vec<String> =
AssetCategory::NAMES.iter().map(|s| s.to_string()).collect();
values.push("remote".to_string());
values.extend(
BundleStore::load()
.map(|store| {
store
.bundle_names()
.into_iter()
.map(str::to_string)
.collect::<Vec<_>>()
})
.unwrap_or_default(),
);
super::map_completion_values(values)
}
".uninstall" => {
@@ -4979,6 +4990,36 @@ mod tests {
);
}
#[test]
#[serial]
fn repl_complete_install_offers_categories_remote_and_bundles() {
let _guard = TestConfigDirGuard::new();
let mut store = BundleStore::load().unwrap();
store
.upsert_bundle(
"omc",
crate::config::bundles::InstallMetadata {
source: "https://github.com/x/omc".to_string(),
git_ref: None,
commit: "abc123".to_string(),
version: None,
description: None,
homepage: None,
},
)
.unwrap();
let ctx = create_test_ctx();
let values = ctx.repl_complete(".install", &[""], "");
for expected in ["agents", "remote", "omc"] {
assert!(
values.iter().any(|(name, _)| name == expected),
"missing '{expected}'; got: {values:?}"
);
}
}
#[test]
#[serial]
fn exit_agent_clears_all_agent_state() {